web: keep the port strip in the header on every tab

The row of port icons lived in a card on the Dashboard, so link
state and speed were out of sight on every other tab. Move it into the
header between the title and the save button, a little smaller, and
poll /status.json whenever the page is open instead of only on the
Dashboard, Ports and Statistics tabs; the existing idle and hidden-tab
gating still pauses it. On narrow screens the strip wraps to its own
row under the title.
This commit is contained in:
d00f committed 2026-10-17 00:06:27 +02:00
1 parent d9fc20addf
commit 2415015a87
2 files changed
+17 -20

No files matched your search

+4 -6
View File
@@ -964,6 +964,7 @@ function pollStatus(){
});
}
var statusPoller=new Poller(pollStatus,2500);
statusPoller.start();
function needPorts(fn){
if(S.n)return fn();
pollStatus().then(fn).catch(function(){});
@@ -1108,8 +1109,7 @@ function dashStatus(){
});
}
tabHooks.dash={
enter:function(){statusPoller.start();pollInfo().catch(function(){})},
leave:function(){statusPoller.stop()},
enter:function(){pollInfo().catch(function(){})},
status:dashStatus,
};
@@ -1186,8 +1186,7 @@ function applyPort(i){
postCmds(cmds).then(loadMtu).catch(function(){});
}
tabHooks.ports={
enter:function(){statusPoller.start();needPorts(buildPorts)},
leave:function(){statusPoller.stop()},
enter:function(){needPorts(buildPorts)},
status:portsStatus,
};
@@ -1443,8 +1442,7 @@ function statsStatus(){
});
}
tabHooks.stats={
enter:function(){statusPoller.start()},
leave:function(){statusPoller.stop();if(ctrPoll)ctrPoll.stop()},
leave:function(){if(ctrPoll)ctrPoll.stop()},
status:statsStatus,
};