mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-13 21:51:41 -07:00
PLG: Add 'No Data' message for empty plugin tabs and enhance event data loading checks #1607
This commit is contained in:
@@ -31,6 +31,12 @@
|
||||
<script>
|
||||
|
||||
function loadEventsData() {
|
||||
const mac = getMac();
|
||||
if (!mac) {
|
||||
console.warn("loadEventsData: mac not set, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
const hideConnections = $('#chkHideConnectionEvents')[0].checked;
|
||||
|
||||
let period = $("#period").val();
|
||||
@@ -65,7 +71,7 @@ function loadEventsData() {
|
||||
query,
|
||||
variables: {
|
||||
options: {
|
||||
eveMac: mac,
|
||||
eveMac: mac, // local const from getMac() above
|
||||
dateFrom: start,
|
||||
dateTo: end,
|
||||
limit: 500,
|
||||
@@ -163,6 +169,11 @@ function initDeviceEventsPage()
|
||||
return; // exit early if nothing is visible
|
||||
}
|
||||
|
||||
// Only proceed if mac is available
|
||||
if (!getMac()) {
|
||||
return; // exit early if mac is not yet set
|
||||
}
|
||||
|
||||
// init page once
|
||||
if (eventsPageInitialized) return; // ENSURE ONCE
|
||||
eventsPageInitialized = true;
|
||||
|
||||
Reference in New Issue
Block a user