@crvouga/mockingbird-service-aha 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-NAZV2NIY.js → chunk-R4LJGILO.js} +355 -22
- package/dist/chunk-R4LJGILO.js.map +7 -0
- package/dist/{chunk-BWCUTHOM.js → chunk-XQ5WF3IO.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-NAZV2NIY.js.map +0 -7
- /package/dist/{chunk-BWCUTHOM.js.map → chunk-XQ5WF3IO.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-aha
|
|
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
|
|
|
@@ -1918,6 +1918,167 @@ function faultPresetList(value) {
|
|
|
1918
1918
|
})
|
|
1919
1919
|
};
|
|
1920
1920
|
}
|
|
1921
|
+
function mountSqlExplorer(root, api) {
|
|
1922
|
+
const cell = (value) => {
|
|
1923
|
+
if (value === null || value === void 0)
|
|
1924
|
+
return "";
|
|
1925
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1926
|
+
return String(value);
|
|
1927
|
+
}
|
|
1928
|
+
return JSON.stringify(value) ?? "";
|
|
1929
|
+
};
|
|
1930
|
+
root.replaceChildren();
|
|
1931
|
+
const layout = document.createElement("div");
|
|
1932
|
+
layout.className = "sql-layout";
|
|
1933
|
+
const tables = document.createElement("div");
|
|
1934
|
+
tables.className = "sql-tables";
|
|
1935
|
+
const stack = document.createElement("div");
|
|
1936
|
+
stack.className = "stack";
|
|
1937
|
+
const banner = document.createElement("p");
|
|
1938
|
+
banner.className = "banner";
|
|
1939
|
+
const grid = document.createElement("div");
|
|
1940
|
+
const input = document.createElement("textarea");
|
|
1941
|
+
input.className = "sql-input";
|
|
1942
|
+
input.spellcheck = false;
|
|
1943
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1944
|
+
const actions = document.createElement("div");
|
|
1945
|
+
actions.className = "row-actions";
|
|
1946
|
+
const run = document.createElement("button");
|
|
1947
|
+
run.type = "button";
|
|
1948
|
+
run.textContent = "Run";
|
|
1949
|
+
actions.append(run);
|
|
1950
|
+
const result = document.createElement("pre");
|
|
1951
|
+
stack.append(banner, grid, input, actions, result);
|
|
1952
|
+
layout.append(tables, stack);
|
|
1953
|
+
root.append(layout);
|
|
1954
|
+
const showError = (error2) => {
|
|
1955
|
+
banner.textContent = error2 instanceof Error ? error2.message : String(error2);
|
|
1956
|
+
banner.classList.add("show");
|
|
1957
|
+
};
|
|
1958
|
+
const clearError = () => {
|
|
1959
|
+
banner.textContent = "";
|
|
1960
|
+
banner.classList.remove("show");
|
|
1961
|
+
};
|
|
1962
|
+
const renderGrid = (columns, rows) => {
|
|
1963
|
+
grid.replaceChildren();
|
|
1964
|
+
if (columns.length === 0) {
|
|
1965
|
+
const empty = document.createElement("p");
|
|
1966
|
+
empty.className = "empty";
|
|
1967
|
+
empty.textContent = "No rows.";
|
|
1968
|
+
grid.append(empty);
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
const table = document.createElement("table");
|
|
1972
|
+
const head = document.createElement("thead");
|
|
1973
|
+
const headRow = document.createElement("tr");
|
|
1974
|
+
for (const column of columns) {
|
|
1975
|
+
const th = document.createElement("th");
|
|
1976
|
+
th.textContent = column;
|
|
1977
|
+
headRow.append(th);
|
|
1978
|
+
}
|
|
1979
|
+
head.append(headRow);
|
|
1980
|
+
const body = document.createElement("tbody");
|
|
1981
|
+
for (const row of rows) {
|
|
1982
|
+
const tr = document.createElement("tr");
|
|
1983
|
+
for (const column of columns) {
|
|
1984
|
+
const td = document.createElement("td");
|
|
1985
|
+
td.dataset.label = column;
|
|
1986
|
+
td.textContent = cell(row[column]);
|
|
1987
|
+
tr.append(td);
|
|
1988
|
+
}
|
|
1989
|
+
body.append(tr);
|
|
1990
|
+
}
|
|
1991
|
+
table.append(head, body);
|
|
1992
|
+
grid.append(table);
|
|
1993
|
+
};
|
|
1994
|
+
const rowsOf = (value) => {
|
|
1995
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1996
|
+
return [];
|
|
1997
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1998
|
+
};
|
|
1999
|
+
const columnsOf = (value, rows) => {
|
|
2000
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
2001
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
2002
|
+
if (named.length > 0)
|
|
2003
|
+
return named;
|
|
2004
|
+
}
|
|
2005
|
+
const first = rows[0];
|
|
2006
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
2007
|
+
};
|
|
2008
|
+
let selected = "";
|
|
2009
|
+
const loadPage = async (schema, name) => {
|
|
2010
|
+
selected = `${schema}.${name}`;
|
|
2011
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
2012
|
+
const rows = rowsOf(page);
|
|
2013
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
2014
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
2015
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
2016
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
2017
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2018
|
+
continue;
|
|
2019
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
const loadTables = async () => {
|
|
2023
|
+
const payload = await api.get("/sql/tables");
|
|
2024
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
2025
|
+
tables.replaceChildren();
|
|
2026
|
+
if (listed.length === 0) {
|
|
2027
|
+
const empty = document.createElement("p");
|
|
2028
|
+
empty.className = "empty";
|
|
2029
|
+
empty.textContent = "No tables.";
|
|
2030
|
+
tables.append(empty);
|
|
2031
|
+
return;
|
|
2032
|
+
}
|
|
2033
|
+
for (const item of listed) {
|
|
2034
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
2035
|
+
continue;
|
|
2036
|
+
const button = document.createElement("button");
|
|
2037
|
+
button.type = "button";
|
|
2038
|
+
button.dataset.schema = item.schema;
|
|
2039
|
+
button.dataset.table = item.name;
|
|
2040
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
2041
|
+
tables.append(button);
|
|
2042
|
+
}
|
|
2043
|
+
};
|
|
2044
|
+
tables.addEventListener("click", (event) => {
|
|
2045
|
+
const target = event.target;
|
|
2046
|
+
if (!(target instanceof Element))
|
|
2047
|
+
return;
|
|
2048
|
+
const button = target.closest("button");
|
|
2049
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2050
|
+
return;
|
|
2051
|
+
const schema = button.dataset.schema;
|
|
2052
|
+
const name = button.dataset.table;
|
|
2053
|
+
if (schema === void 0 || name === void 0)
|
|
2054
|
+
return;
|
|
2055
|
+
clearError();
|
|
2056
|
+
loadPage(schema, name).catch(showError);
|
|
2057
|
+
});
|
|
2058
|
+
run.addEventListener("click", () => {
|
|
2059
|
+
const sql = input.value.trim();
|
|
2060
|
+
if (sql === "") {
|
|
2061
|
+
showError(new Error("Enter a statement"));
|
|
2062
|
+
return;
|
|
2063
|
+
}
|
|
2064
|
+
clearError();
|
|
2065
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2066
|
+
const rows = rowsOf(payload);
|
|
2067
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2068
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2069
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2070
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2071
|
+
}).catch(showError);
|
|
2072
|
+
});
|
|
2073
|
+
const namespace = document.getElementById("namespace");
|
|
2074
|
+
if (namespace) {
|
|
2075
|
+
namespace.addEventListener("change", () => {
|
|
2076
|
+
clearError();
|
|
2077
|
+
loadTables().catch(showError);
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
loadTables().catch(showError);
|
|
2081
|
+
}
|
|
1921
2082
|
function bootAdmin(config) {
|
|
1922
2083
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1923
2084
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2358,6 +2519,50 @@ function bootAdmin(config) {
|
|
|
2358
2519
|
if (render)
|
|
2359
2520
|
await render();
|
|
2360
2521
|
}
|
|
2522
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2523
|
+
window.setTimeout(resolve, ms);
|
|
2524
|
+
});
|
|
2525
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2526
|
+
if (button.dataset.pending === "1")
|
|
2527
|
+
return;
|
|
2528
|
+
const label = button.textContent ?? "";
|
|
2529
|
+
const width = button.offsetWidth;
|
|
2530
|
+
button.dataset.pending = "1";
|
|
2531
|
+
button.classList.add("pressed");
|
|
2532
|
+
button.setAttribute("aria-busy", "true");
|
|
2533
|
+
button.style.minWidth = `${width}px`;
|
|
2534
|
+
button.textContent = pending;
|
|
2535
|
+
try {
|
|
2536
|
+
await work();
|
|
2537
|
+
button.textContent = done;
|
|
2538
|
+
await delay(1e3);
|
|
2539
|
+
} catch (error2) {
|
|
2540
|
+
showError(error2);
|
|
2541
|
+
} finally {
|
|
2542
|
+
button.textContent = label;
|
|
2543
|
+
button.style.minWidth = "";
|
|
2544
|
+
button.classList.remove("pressed");
|
|
2545
|
+
button.removeAttribute("aria-busy");
|
|
2546
|
+
delete button.dataset.pending;
|
|
2547
|
+
}
|
|
2548
|
+
};
|
|
2549
|
+
document.addEventListener("click", (event) => {
|
|
2550
|
+
const target = event.target;
|
|
2551
|
+
if (!(target instanceof Element))
|
|
2552
|
+
return;
|
|
2553
|
+
const button = target.closest("button");
|
|
2554
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2555
|
+
return;
|
|
2556
|
+
button.classList.add("pressed");
|
|
2557
|
+
const token = String(Date.now());
|
|
2558
|
+
button.dataset.press = token;
|
|
2559
|
+
window.setTimeout(() => {
|
|
2560
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2561
|
+
return;
|
|
2562
|
+
button.classList.remove("pressed");
|
|
2563
|
+
delete button.dataset.press;
|
|
2564
|
+
}, 450);
|
|
2565
|
+
});
|
|
2361
2566
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2362
2567
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2363
2568
|
refresh().catch(showError);
|
|
@@ -2368,7 +2573,7 @@ function bootAdmin(config) {
|
|
|
2368
2573
|
refresh().catch(showError);
|
|
2369
2574
|
});
|
|
2370
2575
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2371
|
-
refresh().catch(showError);
|
|
2576
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2372
2577
|
});
|
|
2373
2578
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2374
2579
|
const target = event.target;
|
|
@@ -2491,10 +2696,10 @@ function bootAdmin(config) {
|
|
|
2491
2696
|
}).then(() => renderFaults()).catch(showError);
|
|
2492
2697
|
});
|
|
2493
2698
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2494
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2699
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2495
2700
|
});
|
|
2496
2701
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2497
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2702
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2498
2703
|
});
|
|
2499
2704
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2500
2705
|
const target = event.target;
|
|
@@ -2550,6 +2755,22 @@ function bootAdmin(config) {
|
|
|
2550
2755
|
panel.script = value.script;
|
|
2551
2756
|
return panel;
|
|
2552
2757
|
};
|
|
2758
|
+
const decodeExtension = (value) => {
|
|
2759
|
+
if (!isRecord2(value))
|
|
2760
|
+
return void 0;
|
|
2761
|
+
if (value.kind === "sql") {
|
|
2762
|
+
return {
|
|
2763
|
+
kind: "sql",
|
|
2764
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2765
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2766
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2767
|
+
};
|
|
2768
|
+
}
|
|
2769
|
+
if (value.kind !== "panel")
|
|
2770
|
+
return void 0;
|
|
2771
|
+
const panel = decodePanel(value);
|
|
2772
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2773
|
+
};
|
|
2553
2774
|
const mountPanels = (panels) => {
|
|
2554
2775
|
const nav = el("nav", HTMLElement);
|
|
2555
2776
|
const views = el("views", HTMLElement);
|
|
@@ -2603,15 +2824,57 @@ function bootAdmin(config) {
|
|
|
2603
2824
|
return decoded === void 0 ? [] : [decoded];
|
|
2604
2825
|
});
|
|
2605
2826
|
mountPanels(panels);
|
|
2827
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2828
|
+
const decoded = decodeExtension(extension);
|
|
2829
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2830
|
+
});
|
|
2831
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2832
|
+
mountPanels(extensionPanels);
|
|
2833
|
+
for (const extension of extensions) {
|
|
2834
|
+
if (extension.kind !== "sql")
|
|
2835
|
+
continue;
|
|
2836
|
+
const nav = el("nav", HTMLElement);
|
|
2837
|
+
const views = el("views", HTMLElement);
|
|
2838
|
+
const button = document.createElement("button");
|
|
2839
|
+
button.type = "button";
|
|
2840
|
+
button.dataset.view = extension.id;
|
|
2841
|
+
button.textContent = extension.title;
|
|
2842
|
+
nav.append(button);
|
|
2843
|
+
const section = document.createElement("section");
|
|
2844
|
+
section.className = "view";
|
|
2845
|
+
section.id = `view-${extension.id}`;
|
|
2846
|
+
section.hidden = true;
|
|
2847
|
+
const title = document.createElement("h2");
|
|
2848
|
+
title.textContent = extension.title;
|
|
2849
|
+
const lede = document.createElement("p");
|
|
2850
|
+
lede.className = "lede";
|
|
2851
|
+
lede.textContent = extension.description;
|
|
2852
|
+
const body = document.createElement("div");
|
|
2853
|
+
body.className = "panel-body";
|
|
2854
|
+
section.append(title, lede, body);
|
|
2855
|
+
views.append(section);
|
|
2856
|
+
mountSqlExplorer(body, panelApi);
|
|
2857
|
+
}
|
|
2606
2858
|
return refresh();
|
|
2607
2859
|
}).catch(showError);
|
|
2608
2860
|
}
|
|
2609
|
-
var clientPrelude = [
|
|
2861
|
+
var clientPrelude = [
|
|
2862
|
+
isRecord2,
|
|
2863
|
+
mountAdminBrand,
|
|
2864
|
+
startAdminBrand,
|
|
2865
|
+
faultPresetList,
|
|
2866
|
+
mountSqlExplorer,
|
|
2867
|
+
bootAdmin
|
|
2868
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2610
2869
|
var adminClientSource = (config) => {
|
|
2611
2870
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2871
|
+
const entry = bootAdmin.name;
|
|
2872
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2873
|
+
throw new Error("admin client cannot call its boot function");
|
|
2874
|
+
}
|
|
2612
2875
|
return `<script>
|
|
2613
2876
|
${clientPrelude}
|
|
2614
|
-
|
|
2877
|
+
${entry}(${payload});
|
|
2615
2878
|
</script>`;
|
|
2616
2879
|
};
|
|
2617
2880
|
|
|
@@ -2652,19 +2915,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2652
2915
|
"GET /ui/manifest"
|
|
2653
2916
|
];
|
|
2654
2917
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2918
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2919
|
+
var checkPanel = (panel, seen, label) => {
|
|
2920
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2921
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2922
|
+
}
|
|
2923
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2924
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2925
|
+
}
|
|
2926
|
+
if (seen.has(panel.id))
|
|
2927
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2928
|
+
seen.add(panel.id);
|
|
2929
|
+
if (panel.title.trim() === "")
|
|
2930
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2931
|
+
};
|
|
2655
2932
|
var assertAdminUi = (ui) => {
|
|
2656
|
-
if (!ui
|
|
2933
|
+
if (!ui)
|
|
2657
2934
|
return;
|
|
2658
2935
|
const seen = /* @__PURE__ */ new Set();
|
|
2659
|
-
for (const panel of ui.panels)
|
|
2660
|
-
|
|
2661
|
-
|
|
2936
|
+
for (const panel of ui.panels ?? [])
|
|
2937
|
+
checkPanel(panel, seen, "admin panel");
|
|
2938
|
+
for (const extension of ui.extensions ?? []) {
|
|
2939
|
+
if (extension.kind === "panel") {
|
|
2940
|
+
checkPanel(extension, seen, "admin extension");
|
|
2941
|
+
continue;
|
|
2662
2942
|
}
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
seen.add(panel.id);
|
|
2666
|
-
if (panel.title.trim() === "")
|
|
2667
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2943
|
+
const id = extension.id ?? "sql";
|
|
2944
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2668
2945
|
}
|
|
2669
2946
|
};
|
|
2670
2947
|
|
|
@@ -2825,9 +3102,24 @@ var renderAdminDocument = (service) => {
|
|
|
2825
3102
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2826
3103
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2827
3104
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2828
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2829
|
-
padding: 7px 8px; min-height: 36px;
|
|
2830
|
-
}
|
|
3105
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3106
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3107
|
+
}
|
|
3108
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3109
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3110
|
+
label.field select {
|
|
3111
|
+
-webkit-appearance: none; appearance: none;
|
|
3112
|
+
padding-right: 28px;
|
|
3113
|
+
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");
|
|
3114
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3115
|
+
}
|
|
3116
|
+
.stack > .field > input,
|
|
3117
|
+
.stack > .field > select,
|
|
3118
|
+
.stack > .field > textarea,
|
|
3119
|
+
dialog .field > input,
|
|
3120
|
+
dialog .field > select,
|
|
3121
|
+
dialog .field > textarea { width: 100%; }
|
|
3122
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2831
3123
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2832
3124
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2833
3125
|
background: var(--bg-elev);
|
|
@@ -2835,6 +3127,14 @@ var renderAdminDocument = (service) => {
|
|
|
2835
3127
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2836
3128
|
.btn-quiet { background: transparent; }
|
|
2837
3129
|
.btn-danger { color: var(--err); }
|
|
3130
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3131
|
+
so the press itself has to stay visible. */
|
|
3132
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3133
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3134
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3135
|
+
}
|
|
3136
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3137
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2838
3138
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2839
3139
|
record or the full nav row would widen the page past the viewport. */
|
|
2840
3140
|
.layout {
|
|
@@ -2875,6 +3175,12 @@ var renderAdminDocument = (service) => {
|
|
|
2875
3175
|
border-radius: 999px; padding: 4px 8px;
|
|
2876
3176
|
}
|
|
2877
3177
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3178
|
+
.sql-layout {
|
|
3179
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3180
|
+
}
|
|
3181
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3182
|
+
.sql-tables button { text-align: left; }
|
|
3183
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2878
3184
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2879
3185
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2880
3186
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2923,14 +3229,22 @@ var renderAdminDocument = (service) => {
|
|
|
2923
3229
|
input, select, textarea { font-size: 16px; }
|
|
2924
3230
|
.brand, .vendor, .controls { width: 100%; }
|
|
2925
3231
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2926
|
-
|
|
3232
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3233
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3234
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3235
|
+
.layout {
|
|
3236
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3237
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3238
|
+
align-content: start;
|
|
3239
|
+
}
|
|
2927
3240
|
nav.side {
|
|
3241
|
+
align-self: start; height: auto;
|
|
2928
3242
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2929
3243
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2930
3244
|
padding: 8px;
|
|
2931
3245
|
}
|
|
2932
3246
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2933
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3247
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2934
3248
|
main { padding: 14px; }
|
|
2935
3249
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2936
3250
|
thead { display: none; }
|
|
@@ -3101,6 +3415,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
3101
3415
|
status: 200,
|
|
3102
3416
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3103
3417
|
});
|
|
3418
|
+
var describeExtension = (extension) => {
|
|
3419
|
+
if (extension.kind === "sql") {
|
|
3420
|
+
return {
|
|
3421
|
+
kind: "sql",
|
|
3422
|
+
id: extension.id ?? "sql",
|
|
3423
|
+
title: extension.title ?? "SQL",
|
|
3424
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3425
|
+
};
|
|
3426
|
+
}
|
|
3427
|
+
return {
|
|
3428
|
+
kind: "panel",
|
|
3429
|
+
id: extension.id,
|
|
3430
|
+
title: extension.title,
|
|
3431
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3432
|
+
html: extension.html,
|
|
3433
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3434
|
+
};
|
|
3435
|
+
};
|
|
3104
3436
|
var adminUiRoutes = (service, ui) => {
|
|
3105
3437
|
const shell = () => renderAdminDocument(service);
|
|
3106
3438
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3115,7 +3447,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3115
3447
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3116
3448
|
html: panel.html,
|
|
3117
3449
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3118
|
-
}))
|
|
3450
|
+
})),
|
|
3451
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3119
3452
|
})
|
|
3120
3453
|
};
|
|
3121
3454
|
};
|
|
@@ -3802,7 +4135,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3802
4135
|
};
|
|
3803
4136
|
|
|
3804
4137
|
// ../core/dist/version.js
|
|
3805
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4138
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3806
4139
|
|
|
3807
4140
|
// ../core/dist/signing.js
|
|
3808
4141
|
var encoder = new TextEncoder();
|
|
@@ -5522,4 +5855,4 @@ export {
|
|
|
5522
5855
|
apiKeyCredential,
|
|
5523
5856
|
AhaAPI
|
|
5524
5857
|
};
|
|
5525
|
-
//# sourceMappingURL=chunk-
|
|
5858
|
+
//# sourceMappingURL=chunk-R4LJGILO.js.map
|