Skip to content
Merged
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
15 changes: 11 additions & 4 deletions app/src/sim/ui/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,18 @@ export function createSim(opts: SimOpts = {}): SimView {
const framing = conn.framing === "auto"
? findProtocol(shape!, server?.schemaNs ?? "", server?.protocol ?? "")?.protocol.framing ?? "?"
: conn.framing;
const status = document.createElement("span");
const dot = document.createElement("span");
dot.className = `conn-dot ${err || dead ? "err" : "ok"}`;
dot.textContent = "●";
status.append(dot, ` ${err ? `refused · ${err}` : dead ? "timed out" : "live"}`);
inspectorEl.append(
section("connection"),
facts([
["client", client?.name ?? conn.clientId],
["server", server?.name ?? conn.serverId],
["framing", framing],
["status", err ? `refused · ${err}` : dead ? "timed out" : "live"],
["status", status],
]),
);
if (err) inspectorEl.append(muted(`connection refused · ${err}`, "err"));
Expand All @@ -898,7 +904,7 @@ export function createSim(opts: SimOpts = {}): SimView {
redraw();
}),
);
} else inspectorEl.append(muted("● live", "ok"));
}

inspectorEl.append(section("faults"));
inspectorEl.append(faultControls(conn));
Expand Down Expand Up @@ -1311,7 +1317,7 @@ function row(label: string, control: HTMLElement): HTMLElement {
r.append(l, control);
return r;
}
function facts(pairs: [string, string][]): HTMLElement {
function facts(pairs: [string, string | Node][]): HTMLElement {
const f = div("insp-facts");
for (const [k, v] of pairs) {
const kv = div("fact");
Expand All @@ -1320,7 +1326,8 @@ function facts(pairs: [string, string][]): HTMLElement {
kk.textContent = k;
const vv = document.createElement("span");
vv.className = "fact-v";
vv.textContent = v;
if (typeof v === "string") vv.textContent = v;
else vv.append(v);
kv.append(kk, vv);
f.append(kv);
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,12 @@ body.mode-simulate #gen-controls {
border-top: 1px solid var(--border);
padding-top: 0.6rem;
}
/* the first section heads the panel — no divider above nothing */
.sim-inspector > .insp-section:first-child {
margin-top: 0.1rem;
border-top: none;
padding-top: 0;
}
.insp-facts {
display: grid;
gap: 0.25rem;
Expand Down Expand Up @@ -696,6 +702,7 @@ body.mode-simulate #gen-controls {
.conn-dot {
color: var(--muted);
font-size: 0.7rem;
vertical-align: middle;
}
.conn-dot.ok {
color: var(--ok);
Expand Down
Loading