fixed minis
This commit is contained in:
@@ -290,7 +290,7 @@ function nfNodeLabel(nf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fetchNetworkStatus() {
|
async function fetchNetworkStatus() {
|
||||||
const r = await fetch('/api/network/status');
|
const r = await fetch('./api/network/status');
|
||||||
if (!r.ok) throw new Error('HTTP ' + r.status);
|
if (!r.ok) throw new Error('HTTP ' + r.status);
|
||||||
return await r.json();
|
return await r.json();
|
||||||
}
|
}
|
||||||
@@ -437,7 +437,7 @@ async function pingNFs() {
|
|||||||
async function refreshAlerts() {
|
async function refreshAlerts() {
|
||||||
addLog('▸ Pulling latest alerts from Alertmanager…', 'run');
|
addLog('▸ Pulling latest alerts from Alertmanager…', 'run');
|
||||||
try {
|
try {
|
||||||
const r = await fetch('/api/alerts');
|
const r = await fetch('./api/alerts');
|
||||||
const d = await r.json();
|
const d = await r.json();
|
||||||
const alerts = d.alerts || [];
|
const alerts = d.alerts || [];
|
||||||
if (alerts.length === 0) {
|
if (alerts.length === 0) {
|
||||||
@@ -482,13 +482,13 @@ async function emulatedSession() {
|
|||||||
let lastIdx = 0;
|
let lastIdx = 0;
|
||||||
let pollTimer = null;
|
let pollTimer = null;
|
||||||
try {
|
try {
|
||||||
const startResp = await fetch('/api/emulated-session/start', { method: 'POST' });
|
const startResp = await fetch('./api/emulated-session/start', { method: 'POST' });
|
||||||
if (!startResp.ok) throw new Error('Failed to start session (HTTP ' + startResp.status + ')');
|
if (!startResp.ok) throw new Error('Failed to start session (HTTP ' + startResp.status + ')');
|
||||||
const { task_id } = await startResp.json();
|
const { task_id } = await startResp.json();
|
||||||
addLog(' Task started — polling for live output…', 'info');
|
addLog(' Task started — polling for live output…', 'info');
|
||||||
pollTimer = setInterval(async () => {
|
pollTimer = setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(`/api/emulated-session/status/${task_id}`);
|
const resp = await fetch(`./api/emulated-session/status/${task_id}`);
|
||||||
if (!resp.ok) throw new Error('Status fetch failed');
|
if (!resp.ok) throw new Error('Status fetch failed');
|
||||||
const data = await resp.json();
|
const data = await resp.json();
|
||||||
data.logs.slice(lastIdx).forEach(l => addLog(l.msg, l.type));
|
data.logs.slice(lastIdx).forEach(l => addLog(l.msg, l.type));
|
||||||
@@ -574,7 +574,7 @@ function exportLogs() {
|
|||||||
// ── Health dot ────────────────────────────────────────────────────────────
|
// ── Health dot ────────────────────────────────────────────────────────────
|
||||||
async function checkHealth() {
|
async function checkHealth() {
|
||||||
try {
|
try {
|
||||||
const r = await fetch('/health');
|
const r = await fetch('./health');
|
||||||
if (r.ok) {
|
if (r.ok) {
|
||||||
document.getElementById('dot').classList.remove('err');
|
document.getElementById('dot').classList.remove('err');
|
||||||
document.getElementById('connLabel').textContent = 'Service connected';
|
document.getElementById('connLabel').textContent = 'Service connected';
|
||||||
|
|||||||
Reference in New Issue
Block a user