BE+FE: change log

This commit is contained in:
jokob-sk
2026-07-06 15:00:41 +10:00
parent 887de65eb9
commit 7e6189cbd4
9 changed files with 41 additions and 42 deletions

View File

@@ -15,10 +15,8 @@
<div class="row">
<div class="col-xs-12">
<div class="box">
<!-- ===================== -->
<!-- Filter Bar -->
<!-- ===================== -->
<!-- Filter Bar -->
<div class="box-header" style="display:flex; gap:10px; flex-wrap:wrap; align-items:center;">
<select id="filterChangedBy" class="form-control" style="width:200px;">
<option value=""><?= lang('device_history_col_source'); ?> - All</option>
@@ -31,9 +29,7 @@
<?= lang('device_history_col_changes'); ?>
</div>
<!-- ===================== -->
<!-- Data Table -->
<!-- ===================== -->
<div class="box-body">
<table id="changeHistoryTable" class="table table-bordered table-striped">
<thead>
@@ -321,7 +317,7 @@
queryString += `?devGUID=${getDevDataByMac(urlMac, "devGUID")}`;
}
const url = `${apiBaseUrl}/${apiEndpoint}${encodeURIComponent(queryString)}`;
const url = `${apiBaseUrl}/${apiEndpoint}${queryString}`;
$.ajax({
url,

View File

@@ -2219,6 +2219,12 @@ textarea[readonly],
padding-top: 20px;
}
.pluginsCore .helpIcon
{
margin-left: -20px;
font-size: x-small;
}
/*Hidden special button*/
@media (max-width: 365px) {
@@ -2658,6 +2664,17 @@ table.dataTable tbody > tr.selected
font-size: x-small;
}
#panHistory
{
min-height:850px
}
#panHistory .change-log-skeleton-class
{
margin-left: 0px;
width: calc(100% - 40px);
}
/* -----------------------------------------------------------------------------
Loading Skeletons
----------------------------------------------------------------------------- */
@@ -2693,7 +2710,7 @@ table.dataTable tbody > tr.selected
/* Positioning anchors */
#settingsPage, #devicesPage, #deviceDetailsPage,
#eventsPage, #presencePage, #reportPage, #notifications, #wf-content-wrapper, #pluginsPage,
#panDetails, #panSessions, #panPresence, #panEvents, #appEvents {
#panDetails, #panSessions, #panPresence, #panEvents, #appEvents #panHistory{
position: relative;
}

View File

@@ -196,7 +196,12 @@ function initDeviceEventsPage()
// -----------------------------------------------------------------------------
// Recurring function to monitor the URL and reinitialize if needed
initLazyTab('#panEvents', initDeviceEventsPage);
function deviceEventsPageUpdater() {
initDeviceEventsPage();
// Run updater again after delay
setTimeout(deviceEventsPageUpdater, 200);
}
deviceEventsPageUpdater();

View File

@@ -1,7 +1,7 @@
<!-- Change log Table Skeleton === -->
<div id="change-log-skeleton" class=" spinnerTarget">
<div id="change-log-skeleton" class=" change-log-skeleton-class">
<section class="box">
<div class="skel-table-box spinnerTarget">
<div class="skel-table-box ">
<div class="skel-table-header-row">
<?php for ($j = 0; $j < 5; $j++): ?>
<span class="skel-th skel-shimmer"></span>

View File

@@ -1,26 +0,0 @@
<!-- Change Log Tab Skeleton =============================================== -->
<div id="skel-tab-history" class="skel-tab-pane spinnerTarget">
<!-- Filter row -->
<div style="display:flex; align-items:center; gap:10px; margin-bottom:12px; padding:0 2px;">
<span class="skel-shimmer" style="width:120px; height:28px; border-radius:4px; flex-shrink:0;"></span>
<span class="skel-shimmer" style="width:120px; height:28px; border-radius:4px; flex-shrink:0;"></span>
</div>
<!-- Table -->
<div class="skel-table-box">
<div class="skel-table-header-row">
<span class="skel-th skel-shimmer" style="flex:1.5"></span>
<span class="skel-th skel-shimmer" style="flex:1.5"></span>
<span class="skel-th skel-shimmer" style="flex:4"></span>
</div>
<?php for ($i = 0; $i < 6; $i++): ?>
<div class="skel-tr">
<span class="skel-td skel-shimmer" style="flex:1.5; max-width:16%"></span>
<span class="skel-td skel-shimmer" style="flex:1.5; max-width:14%"></span>
<div style="flex:4; display:flex; flex-direction:column; gap:4px; padding:4px 0;">
<span class="skel-td skel-shimmer" style="width:<?= 40 + ($i * 7) % 30 ?>%"></span>
<span class="skel-td skel-shimmer" style="width:<?= 30 + ($i * 11) % 25 ?>%"></span>
</div>
</div>
<?php endfor; ?>
</div>
</div>

View File

@@ -9,7 +9,10 @@
<!-- Main content ---------------------------------------------------------- -->
<?php require 'php/templates/skel_plugins.php'; ?>
<section class="content">
<section class="content pluginsCore">
<span class="helpIcon">
<a target="_blank" href="https://docs.netalertx.com/PLUGINS"><i class="fa fa-circle-question"></i></a>
</span>
<div class="plugin-filters hidden" >
<div class="input-group col-sm-12">
<label class="col-sm-3"><?= lang('Plugins_Filters_Mac');?></label>

View File

@@ -6,9 +6,11 @@
<!-- Page ------------------------------------------------------------------ -->
<div class="content-wrapper" id="wf-content-wrapper">
<div id="wf-content-wrapper" class="content-wrapper spinnerTarget" >
<?php require 'php/templates/skel_workflows.php'; ?>
<span class="helpIcon"> <a target="_blank" href="https://docs.netalertx.com/WORKFLOWS"><i class="fa fa-circle-question"></i></a></span>
<span class="helpIcon">
<a target="_blank" href="https://docs.netalertx.com/WORKFLOWS"><i class="fa fa-circle-question"></i></a>
</span>
<?php
require 'workflowsCore.php';
?>

View File

@@ -131,6 +131,7 @@ class Query(ObjectType):
devGUID=devGUID,
changedColumn=changedColumn,
changedBy=changedBy,
search=paging["search"]
)
else:
groups = h.get_all_grouped_history(
@@ -145,6 +146,7 @@ class Query(ObjectType):
total = h.get_total_group_count(
changedColumn=changedColumn,
changedBy=changedBy,
search=paging["search"]
)
return DeviceHistoryResult(

View File

@@ -115,12 +115,12 @@ class DevicesHistoryInstance:
"changedColumn": [r["changedColumn"] for r in col_rows],
}
def get_total_group_count(self, devGUID=None, changedColumn=None, changedBy=None):
def get_total_group_count(self, devGUID=None, changedColumn=None, changedBy=None, search=None):
"""
Return the total number of distinct change-event groups matching the
given filters. Used by the frontend to calculate total pages.
"""
clauses, params = self._build_clauses(devGUID, changedColumn, changedBy)
clauses, params = self._build_clauses(devGUID, changedColumn, changedBy, search)
where = f"WHERE {' AND '.join(clauses)}" if clauses else ""
rows = self._fetchall(