PLG: Add 'No Data' message for empty plugin tabs and enhance event data loading checks #1607

This commit is contained in:
Jokob @NetAlertX
2026-04-12 22:28:53 +00:00
parent 309315defc
commit b0c687a171
25 changed files with 55 additions and 15 deletions

View File

@@ -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;