72 lines
3.0 KiB
PHP
72 lines
3.0 KiB
PHP
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.3/semantic.min.js" integrity="sha512-gnoBksrDbaMnlE0rhhkcx3iwzvgBGz6mOEj4/Y5ZY09n55dYddx6+WYc72A55qEesV8VX2iMomteIwobeGK1BQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
|
|
<script type="text/javascript">
|
|
class APIClient {
|
|
static fetch(url, options=null) {
|
|
return fetchAPI(url, options)
|
|
}
|
|
}
|
|
function fetchAPI(url, options=null) {
|
|
if (options === null) {
|
|
options = {}
|
|
}
|
|
if (!Object.hasOwn(options, 'headers')) {
|
|
options['headers'] = {}
|
|
}
|
|
if (!Object.hasOwn(options['headers'], 'Authorization')) {
|
|
options['headers']['Authorization'] = 'Bearer {{md5($API_KEY)}}{{($login->isIn()) ? $login->getSeparator() . $login->getToken() : ''}}'
|
|
}
|
|
return fetch(url, options).then(response => {
|
|
if (response.ok) {
|
|
return response
|
|
}
|
|
throw new Error(JSON.stringify({code: response.status, message: response.statusText, url}))
|
|
}).catch(error => {
|
|
console.error(error)
|
|
})
|
|
}
|
|
const datatables_defaults = {
|
|
language: {
|
|
emptyTable: 'No hay datos disponibles',
|
|
info: 'Mostrando _START_ a _END_ de _TOTAL_ registros',
|
|
infoEmpty: 'Mostrando desde 0 a 0 de 0 registros',
|
|
infoFiltered: '(filtrado de _MAX_ registros totales)',
|
|
lengthMenu: 'Mostrar _MENU_ registros',
|
|
loadingRecords: 'Cargando...',
|
|
search: 'Buscar:',
|
|
zeroRecords: 'No se encontraron registros',
|
|
paginate: {
|
|
first: 'Primero',
|
|
last: 'Último',
|
|
next: 'Siguiente',
|
|
previous: 'Anterior',
|
|
},
|
|
aria: {
|
|
orderable: 'Ordenar por esta columna',
|
|
orderableReverse: 'Ordenar por esta columna en orden inverso',
|
|
}
|
|
}
|
|
}
|
|
const calendar_date_options = {
|
|
type: 'date',
|
|
firstDayOfWeek: 1,
|
|
today: true,
|
|
monthFirst: false,
|
|
text: {
|
|
days: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
|
|
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'],
|
|
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
|
months: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
|
|
monthsShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
|
today: 'Hoy',
|
|
now: 'Ahora',
|
|
},
|
|
formatter: {
|
|
date: 'DD-MM-YYYY'
|
|
},
|
|
}
|
|
</script>
|
|
|
|
@stack('page_scripts')
|