device tools init loading #1130

This commit is contained in:
jokob-sk
2025-08-05 08:06:42 +10:00
parent 0afd4ae115
commit 9b3947cc90
3 changed files with 1199 additions and 2 deletions

View File

@@ -323,6 +323,10 @@ scrape_configs:
credentials: <API_TOKEN>
```
### Grafana template
Grafana template sample: [Download json](./samples/API/Grafana_Dashboard.json)
## API Endpoint: /log files
This API endpoint retrieves files from the `/app/log` folder.

File diff suppressed because it is too large Load Diff

View File

@@ -443,6 +443,37 @@
}
// init first time
initNmapButtons();
initCopyFromDevice();
// -----------------------------------------------------------
var toolsPageInitialized = false;
function initDeviceToolsPage()
{
// Only proceed if .panTools is visible
if (!$('#panTools:visible').length) {
return; // exit early if nothing is visible
}
// init page once
if (toolsPageInitialized) return;
toolsPageInitialized = true;
initNmapButtons();
initCopyFromDevice();
hideSpinner();
}
// -----------------------------------------------------------------------------
// Recurring function to monitor the URL and reinitialize if needed
function deviceToolsPageUpdater() {
initDeviceToolsPage();
// Run updater again after delay
setTimeout(deviceToolsPageUpdater, 200);
}
// start updater
deviceToolsPageUpdater();
</script>