@crvouga/mockingbird-service-otel 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -1
- package/dist/{chunk-RBLBWTGH.js → chunk-FOS7KNLE.js} +355 -22
- package/dist/chunk-FOS7KNLE.js.map +7 -0
- package/dist/{chunk-P4R277MR.js → chunk-INRZUZHL.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-RBLBWTGH.js.map +0 -7
- /package/dist/{chunk-P4R277MR.js.map → chunk-INRZUZHL.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-otel
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.7.0 (2026-10-01)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- record SQL timelines and serve the admin explorer ([8ced17a](https://github.com/crvouga/mockingbird/commit/8ced17ac398e386ef4e9d7e01fc7744c34b95d07))
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
- `@crvouga/mockingbird-service-sqlite`
|
|
12
|
+
|
|
13
|
+
## 1.6.1 (2026-09-30)
|
|
14
|
+
|
|
15
|
+
### Fixes and improvements
|
|
16
|
+
|
|
17
|
+
- keep admin buttons pressed until the action finishes ([0aabfcb](https://github.com/crvouga/mockingbird/commit/0aabfcb5f392aa51e193f9c3f817d5877d92bc6a))
|
|
18
|
+
- size admin select fields like the text inputs beside them ([0fb3ef2](https://github.com/crvouga/mockingbird/commit/0fb3ef2ddbf43376c93a2ae6d87c6c9bf890dafc))
|
|
19
|
+
- keep admin section tabs wired when boot is renamed ([4eda25e](https://github.com/crvouga/mockingbird/commit/4eda25eacd59da048d196f7cc8369d7a02b47bfc))
|
|
20
|
+
|
|
21
|
+
## 1.6.0 (2026-09-29)
|
|
4
22
|
|
|
5
23
|
### Features
|
|
6
24
|
|
|
@@ -1647,6 +1647,167 @@ function faultPresetList(value) {
|
|
|
1647
1647
|
})
|
|
1648
1648
|
};
|
|
1649
1649
|
}
|
|
1650
|
+
function mountSqlExplorer(root, api) {
|
|
1651
|
+
const cell = (value) => {
|
|
1652
|
+
if (value === null || value === void 0)
|
|
1653
|
+
return "";
|
|
1654
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1655
|
+
return String(value);
|
|
1656
|
+
}
|
|
1657
|
+
return JSON.stringify(value) ?? "";
|
|
1658
|
+
};
|
|
1659
|
+
root.replaceChildren();
|
|
1660
|
+
const layout = document.createElement("div");
|
|
1661
|
+
layout.className = "sql-layout";
|
|
1662
|
+
const tables = document.createElement("div");
|
|
1663
|
+
tables.className = "sql-tables";
|
|
1664
|
+
const stack = document.createElement("div");
|
|
1665
|
+
stack.className = "stack";
|
|
1666
|
+
const banner = document.createElement("p");
|
|
1667
|
+
banner.className = "banner";
|
|
1668
|
+
const grid = document.createElement("div");
|
|
1669
|
+
const input = document.createElement("textarea");
|
|
1670
|
+
input.className = "sql-input";
|
|
1671
|
+
input.spellcheck = false;
|
|
1672
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1673
|
+
const actions = document.createElement("div");
|
|
1674
|
+
actions.className = "row-actions";
|
|
1675
|
+
const run = document.createElement("button");
|
|
1676
|
+
run.type = "button";
|
|
1677
|
+
run.textContent = "Run";
|
|
1678
|
+
actions.append(run);
|
|
1679
|
+
const result = document.createElement("pre");
|
|
1680
|
+
stack.append(banner, grid, input, actions, result);
|
|
1681
|
+
layout.append(tables, stack);
|
|
1682
|
+
root.append(layout);
|
|
1683
|
+
const showError = (error) => {
|
|
1684
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1685
|
+
banner.classList.add("show");
|
|
1686
|
+
};
|
|
1687
|
+
const clearError = () => {
|
|
1688
|
+
banner.textContent = "";
|
|
1689
|
+
banner.classList.remove("show");
|
|
1690
|
+
};
|
|
1691
|
+
const renderGrid = (columns, rows) => {
|
|
1692
|
+
grid.replaceChildren();
|
|
1693
|
+
if (columns.length === 0) {
|
|
1694
|
+
const empty = document.createElement("p");
|
|
1695
|
+
empty.className = "empty";
|
|
1696
|
+
empty.textContent = "No rows.";
|
|
1697
|
+
grid.append(empty);
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
const table = document.createElement("table");
|
|
1701
|
+
const head = document.createElement("thead");
|
|
1702
|
+
const headRow = document.createElement("tr");
|
|
1703
|
+
for (const column of columns) {
|
|
1704
|
+
const th = document.createElement("th");
|
|
1705
|
+
th.textContent = column;
|
|
1706
|
+
headRow.append(th);
|
|
1707
|
+
}
|
|
1708
|
+
head.append(headRow);
|
|
1709
|
+
const body = document.createElement("tbody");
|
|
1710
|
+
for (const row of rows) {
|
|
1711
|
+
const tr = document.createElement("tr");
|
|
1712
|
+
for (const column of columns) {
|
|
1713
|
+
const td = document.createElement("td");
|
|
1714
|
+
td.dataset.label = column;
|
|
1715
|
+
td.textContent = cell(row[column]);
|
|
1716
|
+
tr.append(td);
|
|
1717
|
+
}
|
|
1718
|
+
body.append(tr);
|
|
1719
|
+
}
|
|
1720
|
+
table.append(head, body);
|
|
1721
|
+
grid.append(table);
|
|
1722
|
+
};
|
|
1723
|
+
const rowsOf = (value) => {
|
|
1724
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1725
|
+
return [];
|
|
1726
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1727
|
+
};
|
|
1728
|
+
const columnsOf = (value, rows) => {
|
|
1729
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1730
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1731
|
+
if (named.length > 0)
|
|
1732
|
+
return named;
|
|
1733
|
+
}
|
|
1734
|
+
const first = rows[0];
|
|
1735
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1736
|
+
};
|
|
1737
|
+
let selected = "";
|
|
1738
|
+
const loadPage = async (schema, name) => {
|
|
1739
|
+
selected = `${schema}.${name}`;
|
|
1740
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1741
|
+
const rows = rowsOf(page);
|
|
1742
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1743
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1744
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1745
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1746
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1747
|
+
continue;
|
|
1748
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1749
|
+
}
|
|
1750
|
+
};
|
|
1751
|
+
const loadTables = async () => {
|
|
1752
|
+
const payload = await api.get("/sql/tables");
|
|
1753
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1754
|
+
tables.replaceChildren();
|
|
1755
|
+
if (listed.length === 0) {
|
|
1756
|
+
const empty = document.createElement("p");
|
|
1757
|
+
empty.className = "empty";
|
|
1758
|
+
empty.textContent = "No tables.";
|
|
1759
|
+
tables.append(empty);
|
|
1760
|
+
return;
|
|
1761
|
+
}
|
|
1762
|
+
for (const item of listed) {
|
|
1763
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1764
|
+
continue;
|
|
1765
|
+
const button = document.createElement("button");
|
|
1766
|
+
button.type = "button";
|
|
1767
|
+
button.dataset.schema = item.schema;
|
|
1768
|
+
button.dataset.table = item.name;
|
|
1769
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1770
|
+
tables.append(button);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
tables.addEventListener("click", (event) => {
|
|
1774
|
+
const target = event.target;
|
|
1775
|
+
if (!(target instanceof Element))
|
|
1776
|
+
return;
|
|
1777
|
+
const button = target.closest("button");
|
|
1778
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1779
|
+
return;
|
|
1780
|
+
const schema = button.dataset.schema;
|
|
1781
|
+
const name = button.dataset.table;
|
|
1782
|
+
if (schema === void 0 || name === void 0)
|
|
1783
|
+
return;
|
|
1784
|
+
clearError();
|
|
1785
|
+
loadPage(schema, name).catch(showError);
|
|
1786
|
+
});
|
|
1787
|
+
run.addEventListener("click", () => {
|
|
1788
|
+
const sql = input.value.trim();
|
|
1789
|
+
if (sql === "") {
|
|
1790
|
+
showError(new Error("Enter a statement"));
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
clearError();
|
|
1794
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
1795
|
+
const rows = rowsOf(payload);
|
|
1796
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
1797
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
1798
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
1799
|
+
result.textContent = `${count} rows${truncated}`;
|
|
1800
|
+
}).catch(showError);
|
|
1801
|
+
});
|
|
1802
|
+
const namespace = document.getElementById("namespace");
|
|
1803
|
+
if (namespace) {
|
|
1804
|
+
namespace.addEventListener("change", () => {
|
|
1805
|
+
clearError();
|
|
1806
|
+
loadTables().catch(showError);
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
loadTables().catch(showError);
|
|
1810
|
+
}
|
|
1650
1811
|
function bootAdmin(config) {
|
|
1651
1812
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1652
1813
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2087,6 +2248,50 @@ function bootAdmin(config) {
|
|
|
2087
2248
|
if (render)
|
|
2088
2249
|
await render();
|
|
2089
2250
|
}
|
|
2251
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2252
|
+
window.setTimeout(resolve, ms);
|
|
2253
|
+
});
|
|
2254
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2255
|
+
if (button.dataset.pending === "1")
|
|
2256
|
+
return;
|
|
2257
|
+
const label = button.textContent ?? "";
|
|
2258
|
+
const width = button.offsetWidth;
|
|
2259
|
+
button.dataset.pending = "1";
|
|
2260
|
+
button.classList.add("pressed");
|
|
2261
|
+
button.setAttribute("aria-busy", "true");
|
|
2262
|
+
button.style.minWidth = `${width}px`;
|
|
2263
|
+
button.textContent = pending;
|
|
2264
|
+
try {
|
|
2265
|
+
await work();
|
|
2266
|
+
button.textContent = done;
|
|
2267
|
+
await delay(1e3);
|
|
2268
|
+
} catch (error) {
|
|
2269
|
+
showError(error);
|
|
2270
|
+
} finally {
|
|
2271
|
+
button.textContent = label;
|
|
2272
|
+
button.style.minWidth = "";
|
|
2273
|
+
button.classList.remove("pressed");
|
|
2274
|
+
button.removeAttribute("aria-busy");
|
|
2275
|
+
delete button.dataset.pending;
|
|
2276
|
+
}
|
|
2277
|
+
};
|
|
2278
|
+
document.addEventListener("click", (event) => {
|
|
2279
|
+
const target = event.target;
|
|
2280
|
+
if (!(target instanceof Element))
|
|
2281
|
+
return;
|
|
2282
|
+
const button = target.closest("button");
|
|
2283
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2284
|
+
return;
|
|
2285
|
+
button.classList.add("pressed");
|
|
2286
|
+
const token = String(Date.now());
|
|
2287
|
+
button.dataset.press = token;
|
|
2288
|
+
window.setTimeout(() => {
|
|
2289
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2290
|
+
return;
|
|
2291
|
+
button.classList.remove("pressed");
|
|
2292
|
+
delete button.dataset.press;
|
|
2293
|
+
}, 450);
|
|
2294
|
+
});
|
|
2090
2295
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2091
2296
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2092
2297
|
refresh().catch(showError);
|
|
@@ -2097,7 +2302,7 @@ function bootAdmin(config) {
|
|
|
2097
2302
|
refresh().catch(showError);
|
|
2098
2303
|
});
|
|
2099
2304
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2100
|
-
refresh().catch(showError);
|
|
2305
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2101
2306
|
});
|
|
2102
2307
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2103
2308
|
const target = event.target;
|
|
@@ -2220,10 +2425,10 @@ function bootAdmin(config) {
|
|
|
2220
2425
|
}).then(() => renderFaults()).catch(showError);
|
|
2221
2426
|
});
|
|
2222
2427
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2223
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2428
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2224
2429
|
});
|
|
2225
2430
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2226
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2431
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2227
2432
|
});
|
|
2228
2433
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2229
2434
|
const target = event.target;
|
|
@@ -2279,6 +2484,22 @@ function bootAdmin(config) {
|
|
|
2279
2484
|
panel.script = value.script;
|
|
2280
2485
|
return panel;
|
|
2281
2486
|
};
|
|
2487
|
+
const decodeExtension = (value) => {
|
|
2488
|
+
if (!isRecord2(value))
|
|
2489
|
+
return void 0;
|
|
2490
|
+
if (value.kind === "sql") {
|
|
2491
|
+
return {
|
|
2492
|
+
kind: "sql",
|
|
2493
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2494
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2495
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2496
|
+
};
|
|
2497
|
+
}
|
|
2498
|
+
if (value.kind !== "panel")
|
|
2499
|
+
return void 0;
|
|
2500
|
+
const panel = decodePanel(value);
|
|
2501
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2502
|
+
};
|
|
2282
2503
|
const mountPanels = (panels) => {
|
|
2283
2504
|
const nav = el("nav", HTMLElement);
|
|
2284
2505
|
const views = el("views", HTMLElement);
|
|
@@ -2332,15 +2553,57 @@ function bootAdmin(config) {
|
|
|
2332
2553
|
return decoded === void 0 ? [] : [decoded];
|
|
2333
2554
|
});
|
|
2334
2555
|
mountPanels(panels);
|
|
2556
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2557
|
+
const decoded = decodeExtension(extension);
|
|
2558
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2559
|
+
});
|
|
2560
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2561
|
+
mountPanels(extensionPanels);
|
|
2562
|
+
for (const extension of extensions) {
|
|
2563
|
+
if (extension.kind !== "sql")
|
|
2564
|
+
continue;
|
|
2565
|
+
const nav = el("nav", HTMLElement);
|
|
2566
|
+
const views = el("views", HTMLElement);
|
|
2567
|
+
const button = document.createElement("button");
|
|
2568
|
+
button.type = "button";
|
|
2569
|
+
button.dataset.view = extension.id;
|
|
2570
|
+
button.textContent = extension.title;
|
|
2571
|
+
nav.append(button);
|
|
2572
|
+
const section = document.createElement("section");
|
|
2573
|
+
section.className = "view";
|
|
2574
|
+
section.id = `view-${extension.id}`;
|
|
2575
|
+
section.hidden = true;
|
|
2576
|
+
const title = document.createElement("h2");
|
|
2577
|
+
title.textContent = extension.title;
|
|
2578
|
+
const lede = document.createElement("p");
|
|
2579
|
+
lede.className = "lede";
|
|
2580
|
+
lede.textContent = extension.description;
|
|
2581
|
+
const body = document.createElement("div");
|
|
2582
|
+
body.className = "panel-body";
|
|
2583
|
+
section.append(title, lede, body);
|
|
2584
|
+
views.append(section);
|
|
2585
|
+
mountSqlExplorer(body, panelApi);
|
|
2586
|
+
}
|
|
2335
2587
|
return refresh();
|
|
2336
2588
|
}).catch(showError);
|
|
2337
2589
|
}
|
|
2338
|
-
var clientPrelude = [
|
|
2590
|
+
var clientPrelude = [
|
|
2591
|
+
isRecord2,
|
|
2592
|
+
mountAdminBrand,
|
|
2593
|
+
startAdminBrand,
|
|
2594
|
+
faultPresetList,
|
|
2595
|
+
mountSqlExplorer,
|
|
2596
|
+
bootAdmin
|
|
2597
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2339
2598
|
var adminClientSource = (config) => {
|
|
2340
2599
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2600
|
+
const entry = bootAdmin.name;
|
|
2601
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2602
|
+
throw new Error("admin client cannot call its boot function");
|
|
2603
|
+
}
|
|
2341
2604
|
return `<script>
|
|
2342
2605
|
${clientPrelude}
|
|
2343
|
-
|
|
2606
|
+
${entry}(${payload});
|
|
2344
2607
|
</script>`;
|
|
2345
2608
|
};
|
|
2346
2609
|
|
|
@@ -2381,19 +2644,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2381
2644
|
"GET /ui/manifest"
|
|
2382
2645
|
];
|
|
2383
2646
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2647
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2648
|
+
var checkPanel = (panel, seen, label) => {
|
|
2649
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2650
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2651
|
+
}
|
|
2652
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2653
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2654
|
+
}
|
|
2655
|
+
if (seen.has(panel.id))
|
|
2656
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2657
|
+
seen.add(panel.id);
|
|
2658
|
+
if (panel.title.trim() === "")
|
|
2659
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2660
|
+
};
|
|
2384
2661
|
var assertAdminUi = (ui) => {
|
|
2385
|
-
if (!ui
|
|
2662
|
+
if (!ui)
|
|
2386
2663
|
return;
|
|
2387
2664
|
const seen = /* @__PURE__ */ new Set();
|
|
2388
|
-
for (const panel of ui.panels)
|
|
2389
|
-
|
|
2390
|
-
|
|
2665
|
+
for (const panel of ui.panels ?? [])
|
|
2666
|
+
checkPanel(panel, seen, "admin panel");
|
|
2667
|
+
for (const extension of ui.extensions ?? []) {
|
|
2668
|
+
if (extension.kind === "panel") {
|
|
2669
|
+
checkPanel(extension, seen, "admin extension");
|
|
2670
|
+
continue;
|
|
2391
2671
|
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
seen.add(panel.id);
|
|
2395
|
-
if (panel.title.trim() === "")
|
|
2396
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2672
|
+
const id2 = extension.id ?? "sql";
|
|
2673
|
+
checkPanel({ id: id2, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2397
2674
|
}
|
|
2398
2675
|
};
|
|
2399
2676
|
|
|
@@ -2554,9 +2831,24 @@ var renderAdminDocument = (service) => {
|
|
|
2554
2831
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2555
2832
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2556
2833
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2557
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2558
|
-
padding: 7px 8px; min-height: 36px;
|
|
2559
|
-
}
|
|
2834
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2835
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
2836
|
+
}
|
|
2837
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
2838
|
+
the text fields in the same form. Paint it like those fields. */
|
|
2839
|
+
label.field select {
|
|
2840
|
+
-webkit-appearance: none; appearance: none;
|
|
2841
|
+
padding-right: 28px;
|
|
2842
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
|
|
2843
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
2844
|
+
}
|
|
2845
|
+
.stack > .field > input,
|
|
2846
|
+
.stack > .field > select,
|
|
2847
|
+
.stack > .field > textarea,
|
|
2848
|
+
dialog .field > input,
|
|
2849
|
+
dialog .field > select,
|
|
2850
|
+
dialog .field > textarea { width: 100%; }
|
|
2851
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2560
2852
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2561
2853
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2562
2854
|
background: var(--bg-elev);
|
|
@@ -2564,6 +2856,14 @@ var renderAdminDocument = (service) => {
|
|
|
2564
2856
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2565
2857
|
.btn-quiet { background: transparent; }
|
|
2566
2858
|
.btn-danger { color: var(--err); }
|
|
2859
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
2860
|
+
so the press itself has to stay visible. */
|
|
2861
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
2862
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
2863
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
2864
|
+
}
|
|
2865
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
2866
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2567
2867
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2568
2868
|
record or the full nav row would widen the page past the viewport. */
|
|
2569
2869
|
.layout {
|
|
@@ -2604,6 +2904,12 @@ var renderAdminDocument = (service) => {
|
|
|
2604
2904
|
border-radius: 999px; padding: 4px 8px;
|
|
2605
2905
|
}
|
|
2606
2906
|
.chip i { color: var(--faint); font-style: normal; }
|
|
2907
|
+
.sql-layout {
|
|
2908
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
2909
|
+
}
|
|
2910
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
2911
|
+
.sql-tables button { text-align: left; }
|
|
2912
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2607
2913
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2608
2914
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2609
2915
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2652,14 +2958,22 @@ var renderAdminDocument = (service) => {
|
|
|
2652
2958
|
input, select, textarea { font-size: 16px; }
|
|
2653
2959
|
.brand, .vendor, .controls { width: 100%; }
|
|
2654
2960
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2655
|
-
|
|
2961
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
2962
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
2963
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
2964
|
+
.layout {
|
|
2965
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2966
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
2967
|
+
align-content: start;
|
|
2968
|
+
}
|
|
2656
2969
|
nav.side {
|
|
2970
|
+
align-self: start; height: auto;
|
|
2657
2971
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2658
2972
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2659
2973
|
padding: 8px;
|
|
2660
2974
|
}
|
|
2661
2975
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2662
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
2976
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2663
2977
|
main { padding: 14px; }
|
|
2664
2978
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2665
2979
|
thead { display: none; }
|
|
@@ -2830,6 +3144,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
2830
3144
|
status: 200,
|
|
2831
3145
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
2832
3146
|
});
|
|
3147
|
+
var describeExtension = (extension) => {
|
|
3148
|
+
if (extension.kind === "sql") {
|
|
3149
|
+
return {
|
|
3150
|
+
kind: "sql",
|
|
3151
|
+
id: extension.id ?? "sql",
|
|
3152
|
+
title: extension.title ?? "SQL",
|
|
3153
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3154
|
+
};
|
|
3155
|
+
}
|
|
3156
|
+
return {
|
|
3157
|
+
kind: "panel",
|
|
3158
|
+
id: extension.id,
|
|
3159
|
+
title: extension.title,
|
|
3160
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3161
|
+
html: extension.html,
|
|
3162
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3163
|
+
};
|
|
3164
|
+
};
|
|
2833
3165
|
var adminUiRoutes = (service, ui) => {
|
|
2834
3166
|
const shell = () => renderAdminDocument(service);
|
|
2835
3167
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -2844,7 +3176,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
2844
3176
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
2845
3177
|
html: panel.html,
|
|
2846
3178
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
2847
|
-
}))
|
|
3179
|
+
})),
|
|
3180
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
2848
3181
|
})
|
|
2849
3182
|
};
|
|
2850
3183
|
};
|
|
@@ -3447,7 +3780,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3447
3780
|
};
|
|
3448
3781
|
|
|
3449
3782
|
// ../core/dist/version.js
|
|
3450
|
-
var PACKAGE_VERSION = true ? "1.
|
|
3783
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3451
3784
|
|
|
3452
3785
|
// ../core/dist/webhooks.js
|
|
3453
3786
|
var json4 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
|
|
@@ -5790,4 +6123,4 @@ export {
|
|
|
5790
6123
|
OtelAPI,
|
|
5791
6124
|
adminRow
|
|
5792
6125
|
};
|
|
5793
|
-
//# sourceMappingURL=chunk-
|
|
6126
|
+
//# sourceMappingURL=chunk-FOS7KNLE.js.map
|