FE: fixes

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2025-12-29 07:42:21 +11:00
parent ee5de27413
commit eb414b7e70

View File

@@ -4,11 +4,11 @@
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
?> ?>
<!-- ----------------------------------------------------------------------- --> <!-- ----------------------------------------------------------------------- -->
<!-- Hide Connections --> <!-- Hide Connections -->
<div class="col-sm-12 col-xs-12"> <div class="col-sm-12 col-xs-12">
<label class="col-sm-3 col-xs-10"> <label class="col-sm-3 col-xs-10">
<?= lang('DevDetail_Events_CheckBox');?> <?= lang('DevDetail_Events_CheckBox');?>
</label> </label>
<input class="checkbox blue col-sm-1 col-xs-2" id="chkHideConnectionEvents" type="checkbox" onChange="loadEventsData()"> <input class="checkbox blue col-sm-1 col-xs-2" id="chkHideConnectionEvents" type="checkbox" onChange="loadEventsData()">
@@ -30,10 +30,6 @@
<script> <script>
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
function loadEventsData() { function loadEventsData() {
const hideConnections = $('#chkHideConnectionEvents')[0].checked; const hideConnections = $('#chkHideConnectionEvents')[0].checked;
@@ -43,8 +39,8 @@ function loadEventsData() {
const rawSql = ` const rawSql = `
SELECT eve_DateTime, eve_DateTime, eve_EventType, eve_IP, eve_AdditionalInfo SELECT eve_DateTime, eve_DateTime, eve_EventType, eve_IP, eve_AdditionalInfo
FROM Events FROM Events
WHERE eve_MAC = "${mac}" WHERE eve_MAC = "${mac}"
AND ( AND (
(eve_EventType NOT IN ("Connected", "Disconnected", "VOIDED - Connected", "VOIDED - Disconnected")) (eve_EventType NOT IN ("Connected", "Disconnected", "VOIDED - Connected", "VOIDED - Disconnected"))
OR "${hideConnectionsStr}" = "false" OR "${hideConnectionsStr}" = "false"
@@ -56,7 +52,7 @@ function loadEventsData() {
// Manually load the data first // Manually load the data first
$.get(apiUrl, function (data) { $.get(apiUrl, function (data) {
const parsed = JSON.parse(data); const parsed = JSON.parse(data);
const rows = parsed.map(row => { const rows = parsed.map(row => {
const rawDate = row.eve_DateTime; const rawDate = row.eve_DateTime;
const formattedDate = rawDate ? localizeTimestamp(rawDate) : '-'; const formattedDate = rawDate ? localizeTimestamp(rawDate) : '-';
@@ -98,7 +94,7 @@ function initializeEventsDatatable (eventsRows) {
'columnDefs' : [ 'columnDefs' : [
{ orderData: [1], targets: [0] }, { orderData: [1], targets: [0] },
{ visible: false, targets: [1] }, { visible: false, targets: [1] },
{ {
targets: [0], targets: [0],
'createdCell': function (td, cellData, rowData, row, col) { 'createdCell': function (td, cellData, rowData, row, col) {
@@ -127,7 +123,7 @@ function initializeEventsDatatable (eventsRows) {
// INIT with polling for panel element visibility // INIT with polling for panel element visibility
// ----------------------------------------------- // -----------------------------------------------
var eventsPageInitialized = false; var eventsPageInitialized = false;
function initDeviceEventsPage() function initDeviceEventsPage()
{ {