mirror of
https://github.com/infinition/Bjorn.git
synced 2026-03-16 01:01:58 +00:00
Add Loki and Sentinel utility classes for web API endpoints
- Implemented LokiUtils class with GET and POST endpoints for managing scripts, jobs, and payloads. - Added SentinelUtils class with GET and POST endpoints for managing events, rules, devices, and notifications. - Both classes include error handling and JSON response formatting.
This commit is contained in:
@@ -31,10 +31,12 @@ export async function mount(container) {
|
||||
// Fetch the configured refresh delay
|
||||
try {
|
||||
const data = await api.get('/get_web_delay', { timeout: 5000, retries: 1 });
|
||||
if (!tracker) return; /* unmounted while awaiting */
|
||||
if (data && typeof data.web_delay === 'number' && data.web_delay > 0) {
|
||||
delay = data.web_delay;
|
||||
}
|
||||
} catch (err) {
|
||||
if (!tracker) return; /* unmounted while awaiting */
|
||||
console.warn(`[${PAGE}] Failed to fetch web_delay, using default ${DEFAULT_DELAY}ms:`, err.message);
|
||||
delay = DEFAULT_DELAY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user