Fix footer visibility and improve footer update selectors

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-07 00:54:44 +00:00
parent 185651b659
commit 3a4c464a03
2 changed files with 11 additions and 12 deletions

View File

@@ -238,6 +238,7 @@ echo $navbar ?>
data-remember-order="true"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-toolbar="#toolbar"
data-sort-name="Sequence"
data-sort-order="asc"

View File

@@ -5,21 +5,21 @@ var monitors = {}; // Store monitors by ID for function modal
// Update footer with dynamic totals
function updateFooter(footer) {
// Target the footer within the bootstrap-table wrapper
var footerRow = $j('#consoleTable tfoot tr');
// Update monitor count (in Id column if shown)
if ($j('tfoot .colId').length) {
$j('tfoot .colId').html('Total: ' + footer.monitor_count);
}
footerRow.find('td.colId').html('Total: ' + footer.monitor_count);
// Update bandwidth/FPS (in Function column)
if ($j('tfoot .colFunction').length) {
$j('tfoot .colFunction').html(footer.bandwidth_fps);
}
footerRow.find('td.colFunction').html(footer.bandwidth_fps);
// Update event totals
var eventPeriods = ['Total', 'Hour', 'Day', 'Week', 'Month', 'Archived'];
eventPeriods.forEach(function(period) {
var cell = $j('tfoot td.colEvents:eq(' + eventPeriods.indexOf(period) + ')');
if (cell.length) {
var eventCells = footerRow.find('td.colEvents');
eventPeriods.forEach(function(period, index) {
if (eventCells.length > index) {
var cell = $j(eventCells[index]);
var link = cell.find('a');
if (link.length) {
// Preserve the link but update the count
@@ -34,9 +34,7 @@ function updateFooter(footer) {
});
// Update zone count
if ($j('tfoot .colZones').length) {
$j('tfoot .colZones').text(footer.total_zones);
}
footerRow.find('td.colZones').text(footer.total_zones);
}
// Called by bootstrap-table to retrieve monitor data