feat(config,channels): format-neutral config resolution and truthful channel state
Loader.Resolve() selects TOML/YAML files or a config directory as the production entry point, replacing the TOML-only Overlay() as the default path. Add internal/channels.Manager, reporting each adapter's actual runtime lifecycle (configured/starting/running/degraded/failed) instead of inferring health from configuration presence alone. Wire channel reload through a per-adapter seam. Fixes #55
This commit is contained in:
1 parent
0d500a4ca9
commit
472d8d717c
9 files changed
+373
-14
No files matched your search
@@ -61,12 +61,21 @@ export function channelsPage() {
|
||||
el(
|
||||
"div.card-head",
|
||||
el("h3.card-title", channel.name),
|
||||
channel.configured ? pill("connected", "ok") : pill("not configured", "idle"),
|
||||
pill(channel.state || (channel.configured ? "configured" : "stopped"), stateTone(channel.state, channel.configured)),
|
||||
),
|
||||
el("p.channel-desc", channel.description),
|
||||
el("p.channel-detail", channel.detail),
|
||||
channel.reload_supported
|
||||
? el("button.btn", { onclick: async (event) => { event.currentTarget.disabled = true; try { await api.channelReload(channel.id || channel.name.toLowerCase()); await load(); } catch (err) { event.currentTarget.disabled = false; } } }, "Reload")
|
||||
: el("p.channel-detail", "Reload requires a daemon restart for this adapter."),
|
||||
);
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
function stateTone(state, configured) {
|
||||
if (state === "running") return "ok";
|
||||
if (state === "failed" || state === "degraded") return "warn";
|
||||
return configured ? "idle" : "idle";
|
||||
}
|
||||
@@ -65,12 +65,22 @@ export function settingsPage() {
|
||||
agentCard(cfg.agent),
|
||||
storageCard(cfg.storage, cfg.containers),
|
||||
webCard(cfg.web),
|
||||
provenanceCard(cfg.provenance),
|
||||
);
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
function provenanceCard(origins) {
|
||||
if (!origins?.length) return section("Configuration sources", "The files that supplied the running configuration.", empty("Source provenance is unavailable."));
|
||||
return section(
|
||||
"Configuration sources",
|
||||
"Applied from top to bottom; later entries take precedence over earlier ones.",
|
||||
el("div.cfg-rows", ...origins.map((origin) => row(`${origin.layer} ${origin.role}${origin.feature ? ` (${origin.feature})` : ""}`, origin.path))),
|
||||
);
|
||||
}
|
||||
|
||||
function section(title, sub, ...children) {
|
||||
return el(
|
||||
"div.card.cfg-section",
|
||||
|
||||
Reference in new issue
Block a user