mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
intentando resolver conflictos
This commit is contained in:
279
ci4/app/Views/themes/vuexy/form/activity/activityList.php
Normal file
279
ci4/app/Views/themes/vuexy/form/activity/activityList.php
Normal file
@ -0,0 +1,279 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row g-4">
|
||||
<!-- OS cards -->
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['windows']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_windows"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-windows ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['mac']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_mac"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-apple ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['linux']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_linux"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-ubuntu ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=($logs['android']??'0') + ($logs['iphone']??'0')?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_mobile"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-device-mobile ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=($logs['ie']??'0') + ($logs['edge']??'0')?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_edge"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-edge ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['safari']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_safari"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-safari ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['firefox']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_firefox"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-firefox ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['chrome']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_chrome"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-chrome ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- \OS cards -->
|
||||
<!-- Activity Table -->
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header row">
|
||||
<div class="col-sm-6">
|
||||
<h4 class="card-title"><?= $title['page']??'' ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="table-responsive">
|
||||
<table id='activityTable' class="table table-striped table-hover" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang("Actividad.user")?></th>
|
||||
<th><?=lang("Actividad.level")?></th>
|
||||
<th><?=lang("Actividad.event")?></th>
|
||||
<th><?=lang("Actividad.ip")?></th>
|
||||
<th><?=lang("Actividad.os")?></th>
|
||||
<th><?=lang("Actividad.browser")?></th>
|
||||
<th><?=lang("Actividad.createdAt")?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- \Activity Table -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
const lastColNr = $('#activityTable').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#activityTable').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendors/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfActividad') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'user' },
|
||||
{ 'data': 'level' },
|
||||
{ 'data': 'event' },
|
||||
{ 'data': 'ip' },
|
||||
{ 'data': 'os' },
|
||||
{ 'data': 'browser' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [7];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="text-success bi bi-check-lg"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Paises.pais'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('activityList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user