Dashboard: list the rules' quotas

A Quotas panel with each quota's allowance, use (or, per address, the
count and the busiest), a usage bar and the next reset. The usage bar
moves to widgets.js and the Rules page's usage dialog shares it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-21 10:20:04 +01:00
1 parent aeaada60ac
commit 1ccca33a30
5 files changed
+42 -13

No files matched your search

+7
View File
@@ -156,6 +156,13 @@ export function fmtBytes(n) {
return n + " bytes";
}
// usageBar draws used out of total as a bar, red once it is all used.
export function usageBar(used, total) {
const seg = h("div", { class: "seg leased" });
seg.style.width = Math.min(100, used / total * 100) + "%";
return h("div", { class: "usage" }, h("div", { class: "usage-bar" + (used >= total ? " full" : "") }, seg));
}
// quotas loads what the rules' quotas used, by rule ID ({} without
// log:read).
export async function quotas() {