Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/scripts/check-production-line-limit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ declare -A GRANDFATHERED=(
# guard was extended to TypeScript; each split has its own issue
# (re-pointed 2026-11-23 so every entry names the issue that
# removes it, per this guard's convention).
["pm-stack/aggregator/src/render.ts"]="#13051"
["pm-stack/aggregator/src/server.ts"]="#13052"
["pm-stack/aggregator/src/sources/live.ts"]="#13053"
# The id-worlds files below moved from pkgs/id/src/ to
Expand Down
2,009 changes: 2,009 additions & 0 deletions pm-stack/aggregator/src/render-aa.ts

Large diffs are not rendered by default.

561 changes: 561 additions & 0 deletions pm-stack/aggregator/src/render-alerts.ts

Large diffs are not rendered by default.

827 changes: 827 additions & 0 deletions pm-stack/aggregator/src/render-attention.ts

Large diffs are not rendered by default.

758 changes: 758 additions & 0 deletions pm-stack/aggregator/src/render-board.ts

Large diffs are not rendered by default.

1,460 changes: 1,460 additions & 0 deletions pm-stack/aggregator/src/render-core.ts

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions pm-stack/aggregator/src/render-dns.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// render.ts split (#13051): DNS register view.
// render.ts re-exports every public name from here; callers keep importing "./render.ts".

import { summarizeDns } from "./dns.ts";
import type { DnsEntry, DnsSection, Provenance, ProvenanceDetail } from "./model.ts";
import { dnsAnchor } from "./search-view.ts";

import { esc, fmtDate, freshnessChips, layout } from "./render-core.ts";

// --- DNS register page (#906 §1, data from #902) -----------------------------

function dnsTable(entries: DnsEntry[], renewingSoon: Set<DnsEntry>, nextRenewal?: DnsEntry | null): string {
const rows = entries
.map(
(e) =>
`<tr${e === nextRenewal ? ' id="dns-next-renewal"' : ""} data-dns-row data-dns-status="${esc(e.status)}" data-dns-renewing-soon="${renewingSoon.has(e)}"><td><strong id="${esc(dnsAnchor(e.domain))}">${esc(e.domain)}</strong></td><td>${esc(e.renewal)}</td><td>${e.priceUsd != null ? `$${e.priceUsd.toFixed(2)}` : "—"}</td><td>${esc(e.autoRenew)}</td><td>${esc(e.plan)}</td><td>${esc(e.review)}</td></tr>`,
)
.join("");
return `<div class="tblwrap"><table id="dns-register-table"><caption>Domain register</caption><thead><tr><th scope="col">Domain</th><th scope="col">Next renewal</th><th scope="col">Price (list)</th><th scope="col">Auto-renew</th><th scope="col">Plan / status</th><th scope="col">Review?</th></tr></thead><tbody>${rows || '<tr><td colspan="6" class="muted">none</td></tr>'}</tbody></table></div>`;
}

const DNS_FILTER_SCRIPT = `<script>
(function () {
var buttons = document.querySelectorAll("[data-dns-filter]");
var rows = document.querySelectorAll("[data-dns-row]");
buttons.forEach(function (button) {
button.addEventListener("click", function () {
var filter = button.getAttribute("data-dns-filter");
buttons.forEach(function (candidate) {
var selected = candidate === button;
candidate.classList.toggle("primary", selected);
candidate.setAttribute("aria-pressed", String(selected));
});
rows.forEach(function (row) {
var matches = filter === "all" || (filter === "renewing-soon"
? row.getAttribute("data-dns-renewing-soon") === "true"
: row.getAttribute("data-dns-status") === filter);
row.hidden = !matches;
});
});
});
var nextLink = document.querySelector("[data-dns-next-link]");
if (nextLink) {
nextLink.addEventListener("click", function () {
buttons.forEach(function (candidate) {
var selected = candidate.getAttribute("data-dns-filter") === "all";
candidate.classList.toggle("primary", selected);
candidate.setAttribute("aria-pressed", String(selected));
});
rows.forEach(function (row) { row.hidden = false; });
});
}
})();
</script>`;

export function renderDns(section: DnsSection | null, provenance: Provenance, detail?: ProvenanceDetail): string {
const chips = detail ? freshnessChips(detail, ["dns"]) : "";
if (!section) {
return layout(
"DNS register",
`<h1>DNS / domain register</h1><div class="banner">The register has not reached the dashboard yet — the fleet-feed collector embeds it from #902's register file, and no section is in the current feed. The register of record is the file the #902 pipeline maintains; this page only renders it.</div>`,
provenance,
"/dns",
"",
chips,
);
}
const s = summarizeDns(section);
const next = s.nextRenewal;
const soonTotal = Math.round(s.renewingSoon.reduce((sum, e) => sum + (e.priceUsd ?? 0), 0) * 100) / 100;
const renewingSoon = new Set(s.renewingSoon);
const filters = [
["all", "All", section.entries.length],
["active", "Active", s.active.length],
["earmarked", "Earmarked", s.earmarked.length],
["unused", "Unused", s.unused.length],
["renewing-soon", "Renewing soon", s.renewingSoon.length],
] as const;
const filterChips = filters
.map(
([filter, label, count], index) =>
`<button type="button" class="qchip dns-filter${index === 0 ? " primary" : ""}" data-dns-filter="${filter}" aria-pressed="${index === 0}">${label} (${count})</button>`,
)
.join("");
const body = `<h1>DNS / domain register</h1>
<p class="muted">${section.entries.length} domains · $${section.totalAnnualListUsd.toFixed(2)}/yr at list renewal prices · register parsed ${fmtDate(section.generatedAt)} (${esc(section.source)}). The register is maintained by the #902 pipeline — this page renders it, never edits it. Machine-first: <a href="/api/dns.json">/api/dns.json</a>.</p>
<div class="board">
<div class="card"><strong>Next renewal</strong><br>${
next
? `${esc(next.renewal)}${next.priceUsd != null ? ` · $${next.priceUsd.toFixed(2)}` : ""}<br><span class="muted">See <a href="#dns-next-renewal" data-dns-next-link>its row in the renewal-sorted register</a>.</span>`
: "—"
}</div>
<div class="card"><strong>Renewing in 45 days</strong><br>${s.renewingSoon.length} domain${s.renewingSoon.length === 1 ? "" : "s"} · $${soonTotal.toFixed(2)} at list price</div>
<div class="card"><strong>Auto-renew</strong><br>${s.autoRenew.on} ON · ${s.autoRenew.off} OFF · ${s.autoRenew.unknown} unknown</div>
<div class="card"><strong>Portfolio shape</strong><br>${s.active.length} in use · ${s.earmarked.length} unused but earmarked · ${s.unused.length} completely unused</div>
</div>
<h2>Domain register (${section.entries.length})</h2>
<div class="chips" role="group" aria-label="Filter domains by status">${filterChips}</div>
${dnsTable(section.entries, renewingSoon, next)}`;
return layout("DNS register", body, provenance, "/dns", DNS_FILTER_SCRIPT, chips);
}
Loading