Server statistics, multi-view record commands, and rc.3 fixes
Added:
- Server statistics: named's memory and CPU (from /proc), cache size,
sockets and client counts against their limits (statistics channel,
rndc status), host memory and load, and free disk space. Memory and
CPU are kept over time as gauges (sum and sample count, averaged in
timelines). Statistics page Server section, jarl stats server,
GET /stats/server.
- jarl record add|set|delete|disable|enable --view a,b | all: the same
change in each view, applied as one changeset.
- Blocking can be paused until resumed (jarl block pause indefinitely,
"Until I resume", {"indefinitely": true}).
Changed:
- List options (allow-transfer, forwarders, ...) get their braces added
when given without them.
- The dashboard lists named-checkconf's warnings about the running
configuration; the CLI prints them after an apply.
- Stats page: tile and card rows fill their width, and the queries and
failed answers charts share margins so their time axes line up.
- Dashboard: options have their own tile.
- 24-hour times in the web UI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b097e10bef
commit
7be0762f48
48 files changed
+1346
-128
No files matched your search
@@ -39,15 +39,15 @@ export async function render(el, params, query) {
|
||||
} catch (e) { mount(checkOut, errorBox(e)); }
|
||||
};
|
||||
|
||||
const paused = status.paused_until;
|
||||
const paused = status.paused_until || status.paused_indefinitely;
|
||||
mount(el,
|
||||
h("div", { class: "page-head" },
|
||||
h("div", { class: "grow" }, h("h1", null, "Blocking"),
|
||||
h("div", { class: "muted" }, "Answer \"doesn't exist\" for ads, trackers and malware, for the devices that use this server to resolve names. Your rules come first, then the blocklists.")),
|
||||
writable && !paused && (lists.length || rules.length) ? pauseControls() : null),
|
||||
paused ? h("div", { class: "msg warn" },
|
||||
h("strong", null, "Blocking is paused until " + new Date(paused).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) + ": "),
|
||||
"every name is answered normally. It resumes by itself. ",
|
||||
h("strong", null, status.paused_indefinitely ? "Blocking is paused: " : "Blocking is paused until " + new Date(paused).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }) + ": "),
|
||||
status.paused_indefinitely ? "every name is answered normally until you resume it. " : "every name is answered normally. It resumes by itself. ",
|
||||
writable ? h("button", { class: "small", onclick: () => pause(0) }, "Resume now") : null) : null,
|
||||
h("div", { class: "panel" },
|
||||
h("form", { class: "actions", onsubmit: runCheck },
|
||||
@@ -61,20 +61,22 @@ export async function render(el, params, query) {
|
||||
// show it when it happens.
|
||||
let wait = 0;
|
||||
if (lists.some((l) => l.state === "waiting")) wait = 4000;
|
||||
if (paused) wait = Math.max(1000, Math.min(wait || Infinity, new Date(paused) - Date.now() + 3000));
|
||||
if (status.paused_until) wait = Math.max(1000, Math.min(wait || Infinity, new Date(status.paused_until) - Date.now() + 3000));
|
||||
if (wait) refreshTimer = setTimeout(() => { if (location.hash.startsWith("#/blocking") && el.isConnected) rerender(); }, wait);
|
||||
}
|
||||
|
||||
function pauseControls() {
|
||||
const length = select([["5", "5 minutes"], ["15", "15 minutes"], ["60", "1 hour"], ["240", "4 hours"]], "15");
|
||||
const length = select([["5", "5 minutes"], ["15", "15 minutes"], ["60", "1 hour"], ["240", "4 hours"], ["-1", "Until I resume"]], "15");
|
||||
return h("div", { class: "actions" }, length, h("button", { title: "Answer every name normally for a while, to see whether blocking is what breaks something", onclick: () => pause(Number(length.value)) }, "Pause blocking"));
|
||||
}
|
||||
|
||||
// pause pauses blocking for minutes, or resumes it (0). It applies at
|
||||
// once, also with a draft open: it's for trying something now.
|
||||
// pause pauses blocking for minutes (-1: until resumed), or resumes it
|
||||
// (0). It applies at once, also with a draft open: it's for trying
|
||||
// something now.
|
||||
async function pause(minutes) {
|
||||
try {
|
||||
await api("POST", minutes ? "/blocking/pause" : "/blocking/resume", minutes ? { body: { minutes } } : {});
|
||||
const body = minutes < 0 ? { indefinitely: true } : { minutes };
|
||||
await api("POST", minutes ? "/blocking/pause" : "/blocking/resume", minutes ? { body } : {});
|
||||
toast(minutes ? "Blocking paused" : "Blocking resumed");
|
||||
rerender();
|
||||
} catch (e) { toast(e.message, "err", 8000); }
|
||||
|
||||
Reference in new issue
Block a user