@crvouga/mockingbird-service-rxvortex 1.7.0 → 1.8.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-K4Y2XYC2.js → chunk-AVPN4ARI.js} +2 -2
- package/dist/{chunk-ZRMQTUA3.js → chunk-TBKZ7IOI.js} +355 -22
- package/dist/chunk-TBKZ7IOI.js.map +7 -0
- 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-ZRMQTUA3.js.map +0 -7
- /package/dist/{chunk-K4Y2XYC2.js.map → chunk-AVPN4ARI.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-rxvortex
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.8.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.7.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.7.0 (2026-09-29)
|
|
4
22
|
|
|
5
23
|
### Features
|
|
6
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime,
|
|
3
3
|
parseCatalog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TBKZ7IOI.js";
|
|
5
5
|
|
|
6
6
|
// src/server.ts
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
@@ -419,4 +419,4 @@ export {
|
|
|
419
419
|
loadCatalogFile,
|
|
420
420
|
serveTarget
|
|
421
421
|
};
|
|
422
|
-
//# sourceMappingURL=chunk-
|
|
422
|
+
//# sourceMappingURL=chunk-AVPN4ARI.js.map
|
|
@@ -1865,6 +1865,167 @@ function faultPresetList(value) {
|
|
|
1865
1865
|
})
|
|
1866
1866
|
};
|
|
1867
1867
|
}
|
|
1868
|
+
function mountSqlExplorer(root, api) {
|
|
1869
|
+
const cell = (value) => {
|
|
1870
|
+
if (value === null || value === void 0)
|
|
1871
|
+
return "";
|
|
1872
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1873
|
+
return String(value);
|
|
1874
|
+
}
|
|
1875
|
+
return JSON.stringify(value) ?? "";
|
|
1876
|
+
};
|
|
1877
|
+
root.replaceChildren();
|
|
1878
|
+
const layout = document.createElement("div");
|
|
1879
|
+
layout.className = "sql-layout";
|
|
1880
|
+
const tables = document.createElement("div");
|
|
1881
|
+
tables.className = "sql-tables";
|
|
1882
|
+
const stack = document.createElement("div");
|
|
1883
|
+
stack.className = "stack";
|
|
1884
|
+
const banner = document.createElement("p");
|
|
1885
|
+
banner.className = "banner";
|
|
1886
|
+
const grid = document.createElement("div");
|
|
1887
|
+
const input = document.createElement("textarea");
|
|
1888
|
+
input.className = "sql-input";
|
|
1889
|
+
input.spellcheck = false;
|
|
1890
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1891
|
+
const actions = document.createElement("div");
|
|
1892
|
+
actions.className = "row-actions";
|
|
1893
|
+
const run = document.createElement("button");
|
|
1894
|
+
run.type = "button";
|
|
1895
|
+
run.textContent = "Run";
|
|
1896
|
+
actions.append(run);
|
|
1897
|
+
const result = document.createElement("pre");
|
|
1898
|
+
stack.append(banner, grid, input, actions, result);
|
|
1899
|
+
layout.append(tables, stack);
|
|
1900
|
+
root.append(layout);
|
|
1901
|
+
const showError = (error) => {
|
|
1902
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1903
|
+
banner.classList.add("show");
|
|
1904
|
+
};
|
|
1905
|
+
const clearError = () => {
|
|
1906
|
+
banner.textContent = "";
|
|
1907
|
+
banner.classList.remove("show");
|
|
1908
|
+
};
|
|
1909
|
+
const renderGrid = (columns, rows) => {
|
|
1910
|
+
grid.replaceChildren();
|
|
1911
|
+
if (columns.length === 0) {
|
|
1912
|
+
const empty = document.createElement("p");
|
|
1913
|
+
empty.className = "empty";
|
|
1914
|
+
empty.textContent = "No rows.";
|
|
1915
|
+
grid.append(empty);
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
const table = document.createElement("table");
|
|
1919
|
+
const head = document.createElement("thead");
|
|
1920
|
+
const headRow = document.createElement("tr");
|
|
1921
|
+
for (const column of columns) {
|
|
1922
|
+
const th = document.createElement("th");
|
|
1923
|
+
th.textContent = column;
|
|
1924
|
+
headRow.append(th);
|
|
1925
|
+
}
|
|
1926
|
+
head.append(headRow);
|
|
1927
|
+
const body = document.createElement("tbody");
|
|
1928
|
+
for (const row of rows) {
|
|
1929
|
+
const tr = document.createElement("tr");
|
|
1930
|
+
for (const column of columns) {
|
|
1931
|
+
const td = document.createElement("td");
|
|
1932
|
+
td.dataset.label = column;
|
|
1933
|
+
td.textContent = cell(row[column]);
|
|
1934
|
+
tr.append(td);
|
|
1935
|
+
}
|
|
1936
|
+
body.append(tr);
|
|
1937
|
+
}
|
|
1938
|
+
table.append(head, body);
|
|
1939
|
+
grid.append(table);
|
|
1940
|
+
};
|
|
1941
|
+
const rowsOf = (value) => {
|
|
1942
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1943
|
+
return [];
|
|
1944
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1945
|
+
};
|
|
1946
|
+
const columnsOf = (value, rows) => {
|
|
1947
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1948
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1949
|
+
if (named.length > 0)
|
|
1950
|
+
return named;
|
|
1951
|
+
}
|
|
1952
|
+
const first = rows[0];
|
|
1953
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1954
|
+
};
|
|
1955
|
+
let selected = "";
|
|
1956
|
+
const loadPage = async (schema, name) => {
|
|
1957
|
+
selected = `${schema}.${name}`;
|
|
1958
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1959
|
+
const rows = rowsOf(page);
|
|
1960
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1961
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1962
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1963
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1964
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1965
|
+
continue;
|
|
1966
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1967
|
+
}
|
|
1968
|
+
};
|
|
1969
|
+
const loadTables = async () => {
|
|
1970
|
+
const payload = await api.get("/sql/tables");
|
|
1971
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1972
|
+
tables.replaceChildren();
|
|
1973
|
+
if (listed.length === 0) {
|
|
1974
|
+
const empty = document.createElement("p");
|
|
1975
|
+
empty.className = "empty";
|
|
1976
|
+
empty.textContent = "No tables.";
|
|
1977
|
+
tables.append(empty);
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
for (const item of listed) {
|
|
1981
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1982
|
+
continue;
|
|
1983
|
+
const button = document.createElement("button");
|
|
1984
|
+
button.type = "button";
|
|
1985
|
+
button.dataset.schema = item.schema;
|
|
1986
|
+
button.dataset.table = item.name;
|
|
1987
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1988
|
+
tables.append(button);
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
tables.addEventListener("click", (event) => {
|
|
1992
|
+
const target = event.target;
|
|
1993
|
+
if (!(target instanceof Element))
|
|
1994
|
+
return;
|
|
1995
|
+
const button = target.closest("button");
|
|
1996
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1997
|
+
return;
|
|
1998
|
+
const schema = button.dataset.schema;
|
|
1999
|
+
const name = button.dataset.table;
|
|
2000
|
+
if (schema === void 0 || name === void 0)
|
|
2001
|
+
return;
|
|
2002
|
+
clearError();
|
|
2003
|
+
loadPage(schema, name).catch(showError);
|
|
2004
|
+
});
|
|
2005
|
+
run.addEventListener("click", () => {
|
|
2006
|
+
const sql = input.value.trim();
|
|
2007
|
+
if (sql === "") {
|
|
2008
|
+
showError(new Error("Enter a statement"));
|
|
2009
|
+
return;
|
|
2010
|
+
}
|
|
2011
|
+
clearError();
|
|
2012
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2013
|
+
const rows = rowsOf(payload);
|
|
2014
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2015
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2016
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2017
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2018
|
+
}).catch(showError);
|
|
2019
|
+
});
|
|
2020
|
+
const namespace = document.getElementById("namespace");
|
|
2021
|
+
if (namespace) {
|
|
2022
|
+
namespace.addEventListener("change", () => {
|
|
2023
|
+
clearError();
|
|
2024
|
+
loadTables().catch(showError);
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
loadTables().catch(showError);
|
|
2028
|
+
}
|
|
1868
2029
|
function bootAdmin(config) {
|
|
1869
2030
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1870
2031
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2305,6 +2466,50 @@ function bootAdmin(config) {
|
|
|
2305
2466
|
if (render)
|
|
2306
2467
|
await render();
|
|
2307
2468
|
}
|
|
2469
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2470
|
+
window.setTimeout(resolve, ms);
|
|
2471
|
+
});
|
|
2472
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2473
|
+
if (button.dataset.pending === "1")
|
|
2474
|
+
return;
|
|
2475
|
+
const label = button.textContent ?? "";
|
|
2476
|
+
const width = button.offsetWidth;
|
|
2477
|
+
button.dataset.pending = "1";
|
|
2478
|
+
button.classList.add("pressed");
|
|
2479
|
+
button.setAttribute("aria-busy", "true");
|
|
2480
|
+
button.style.minWidth = `${width}px`;
|
|
2481
|
+
button.textContent = pending;
|
|
2482
|
+
try {
|
|
2483
|
+
await work();
|
|
2484
|
+
button.textContent = done;
|
|
2485
|
+
await delay(1e3);
|
|
2486
|
+
} catch (error) {
|
|
2487
|
+
showError(error);
|
|
2488
|
+
} finally {
|
|
2489
|
+
button.textContent = label;
|
|
2490
|
+
button.style.minWidth = "";
|
|
2491
|
+
button.classList.remove("pressed");
|
|
2492
|
+
button.removeAttribute("aria-busy");
|
|
2493
|
+
delete button.dataset.pending;
|
|
2494
|
+
}
|
|
2495
|
+
};
|
|
2496
|
+
document.addEventListener("click", (event) => {
|
|
2497
|
+
const target = event.target;
|
|
2498
|
+
if (!(target instanceof Element))
|
|
2499
|
+
return;
|
|
2500
|
+
const button = target.closest("button");
|
|
2501
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2502
|
+
return;
|
|
2503
|
+
button.classList.add("pressed");
|
|
2504
|
+
const token = String(Date.now());
|
|
2505
|
+
button.dataset.press = token;
|
|
2506
|
+
window.setTimeout(() => {
|
|
2507
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2508
|
+
return;
|
|
2509
|
+
button.classList.remove("pressed");
|
|
2510
|
+
delete button.dataset.press;
|
|
2511
|
+
}, 450);
|
|
2512
|
+
});
|
|
2308
2513
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2309
2514
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2310
2515
|
refresh().catch(showError);
|
|
@@ -2315,7 +2520,7 @@ function bootAdmin(config) {
|
|
|
2315
2520
|
refresh().catch(showError);
|
|
2316
2521
|
});
|
|
2317
2522
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2318
|
-
refresh().catch(showError);
|
|
2523
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2319
2524
|
});
|
|
2320
2525
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2321
2526
|
const target = event.target;
|
|
@@ -2438,10 +2643,10 @@ function bootAdmin(config) {
|
|
|
2438
2643
|
}).then(() => renderFaults()).catch(showError);
|
|
2439
2644
|
});
|
|
2440
2645
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2441
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2646
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2442
2647
|
});
|
|
2443
2648
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2444
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2649
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2445
2650
|
});
|
|
2446
2651
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2447
2652
|
const target = event.target;
|
|
@@ -2497,6 +2702,22 @@ function bootAdmin(config) {
|
|
|
2497
2702
|
panel.script = value.script;
|
|
2498
2703
|
return panel;
|
|
2499
2704
|
};
|
|
2705
|
+
const decodeExtension = (value) => {
|
|
2706
|
+
if (!isRecord2(value))
|
|
2707
|
+
return void 0;
|
|
2708
|
+
if (value.kind === "sql") {
|
|
2709
|
+
return {
|
|
2710
|
+
kind: "sql",
|
|
2711
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2712
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2713
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
if (value.kind !== "panel")
|
|
2717
|
+
return void 0;
|
|
2718
|
+
const panel = decodePanel(value);
|
|
2719
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2720
|
+
};
|
|
2500
2721
|
const mountPanels = (panels) => {
|
|
2501
2722
|
const nav = el("nav", HTMLElement);
|
|
2502
2723
|
const views = el("views", HTMLElement);
|
|
@@ -2550,15 +2771,57 @@ function bootAdmin(config) {
|
|
|
2550
2771
|
return decoded === void 0 ? [] : [decoded];
|
|
2551
2772
|
});
|
|
2552
2773
|
mountPanels(panels);
|
|
2774
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2775
|
+
const decoded = decodeExtension(extension);
|
|
2776
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2777
|
+
});
|
|
2778
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2779
|
+
mountPanels(extensionPanels);
|
|
2780
|
+
for (const extension of extensions) {
|
|
2781
|
+
if (extension.kind !== "sql")
|
|
2782
|
+
continue;
|
|
2783
|
+
const nav = el("nav", HTMLElement);
|
|
2784
|
+
const views = el("views", HTMLElement);
|
|
2785
|
+
const button = document.createElement("button");
|
|
2786
|
+
button.type = "button";
|
|
2787
|
+
button.dataset.view = extension.id;
|
|
2788
|
+
button.textContent = extension.title;
|
|
2789
|
+
nav.append(button);
|
|
2790
|
+
const section = document.createElement("section");
|
|
2791
|
+
section.className = "view";
|
|
2792
|
+
section.id = `view-${extension.id}`;
|
|
2793
|
+
section.hidden = true;
|
|
2794
|
+
const title = document.createElement("h2");
|
|
2795
|
+
title.textContent = extension.title;
|
|
2796
|
+
const lede = document.createElement("p");
|
|
2797
|
+
lede.className = "lede";
|
|
2798
|
+
lede.textContent = extension.description;
|
|
2799
|
+
const body = document.createElement("div");
|
|
2800
|
+
body.className = "panel-body";
|
|
2801
|
+
section.append(title, lede, body);
|
|
2802
|
+
views.append(section);
|
|
2803
|
+
mountSqlExplorer(body, panelApi);
|
|
2804
|
+
}
|
|
2553
2805
|
return refresh();
|
|
2554
2806
|
}).catch(showError);
|
|
2555
2807
|
}
|
|
2556
|
-
var clientPrelude = [
|
|
2808
|
+
var clientPrelude = [
|
|
2809
|
+
isRecord2,
|
|
2810
|
+
mountAdminBrand,
|
|
2811
|
+
startAdminBrand,
|
|
2812
|
+
faultPresetList,
|
|
2813
|
+
mountSqlExplorer,
|
|
2814
|
+
bootAdmin
|
|
2815
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2557
2816
|
var adminClientSource = (config) => {
|
|
2558
2817
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2818
|
+
const entry = bootAdmin.name;
|
|
2819
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2820
|
+
throw new Error("admin client cannot call its boot function");
|
|
2821
|
+
}
|
|
2559
2822
|
return `<script>
|
|
2560
2823
|
${clientPrelude}
|
|
2561
|
-
|
|
2824
|
+
${entry}(${payload});
|
|
2562
2825
|
</script>`;
|
|
2563
2826
|
};
|
|
2564
2827
|
|
|
@@ -2599,19 +2862,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2599
2862
|
"GET /ui/manifest"
|
|
2600
2863
|
];
|
|
2601
2864
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2865
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2866
|
+
var checkPanel = (panel, seen, label) => {
|
|
2867
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2868
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2869
|
+
}
|
|
2870
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2871
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2872
|
+
}
|
|
2873
|
+
if (seen.has(panel.id))
|
|
2874
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2875
|
+
seen.add(panel.id);
|
|
2876
|
+
if (panel.title.trim() === "")
|
|
2877
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2878
|
+
};
|
|
2602
2879
|
var assertAdminUi = (ui) => {
|
|
2603
|
-
if (!ui
|
|
2880
|
+
if (!ui)
|
|
2604
2881
|
return;
|
|
2605
2882
|
const seen = /* @__PURE__ */ new Set();
|
|
2606
|
-
for (const panel of ui.panels)
|
|
2607
|
-
|
|
2608
|
-
|
|
2883
|
+
for (const panel of ui.panels ?? [])
|
|
2884
|
+
checkPanel(panel, seen, "admin panel");
|
|
2885
|
+
for (const extension of ui.extensions ?? []) {
|
|
2886
|
+
if (extension.kind === "panel") {
|
|
2887
|
+
checkPanel(extension, seen, "admin extension");
|
|
2888
|
+
continue;
|
|
2609
2889
|
}
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
seen.add(panel.id);
|
|
2613
|
-
if (panel.title.trim() === "")
|
|
2614
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2890
|
+
const id = extension.id ?? "sql";
|
|
2891
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2615
2892
|
}
|
|
2616
2893
|
};
|
|
2617
2894
|
|
|
@@ -2772,9 +3049,24 @@ var renderAdminDocument = (service) => {
|
|
|
2772
3049
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2773
3050
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2774
3051
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2775
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2776
|
-
padding: 7px 8px; min-height: 36px;
|
|
2777
|
-
}
|
|
3052
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3053
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3054
|
+
}
|
|
3055
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3056
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3057
|
+
label.field select {
|
|
3058
|
+
-webkit-appearance: none; appearance: none;
|
|
3059
|
+
padding-right: 28px;
|
|
3060
|
+
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");
|
|
3061
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3062
|
+
}
|
|
3063
|
+
.stack > .field > input,
|
|
3064
|
+
.stack > .field > select,
|
|
3065
|
+
.stack > .field > textarea,
|
|
3066
|
+
dialog .field > input,
|
|
3067
|
+
dialog .field > select,
|
|
3068
|
+
dialog .field > textarea { width: 100%; }
|
|
3069
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2778
3070
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2779
3071
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2780
3072
|
background: var(--bg-elev);
|
|
@@ -2782,6 +3074,14 @@ var renderAdminDocument = (service) => {
|
|
|
2782
3074
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2783
3075
|
.btn-quiet { background: transparent; }
|
|
2784
3076
|
.btn-danger { color: var(--err); }
|
|
3077
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3078
|
+
so the press itself has to stay visible. */
|
|
3079
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3080
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3081
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3082
|
+
}
|
|
3083
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3084
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2785
3085
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2786
3086
|
record or the full nav row would widen the page past the viewport. */
|
|
2787
3087
|
.layout {
|
|
@@ -2822,6 +3122,12 @@ var renderAdminDocument = (service) => {
|
|
|
2822
3122
|
border-radius: 999px; padding: 4px 8px;
|
|
2823
3123
|
}
|
|
2824
3124
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3125
|
+
.sql-layout {
|
|
3126
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3127
|
+
}
|
|
3128
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3129
|
+
.sql-tables button { text-align: left; }
|
|
3130
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2825
3131
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2826
3132
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2827
3133
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2870,14 +3176,22 @@ var renderAdminDocument = (service) => {
|
|
|
2870
3176
|
input, select, textarea { font-size: 16px; }
|
|
2871
3177
|
.brand, .vendor, .controls { width: 100%; }
|
|
2872
3178
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2873
|
-
|
|
3179
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3180
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3181
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3182
|
+
.layout {
|
|
3183
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3184
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3185
|
+
align-content: start;
|
|
3186
|
+
}
|
|
2874
3187
|
nav.side {
|
|
3188
|
+
align-self: start; height: auto;
|
|
2875
3189
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2876
3190
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2877
3191
|
padding: 8px;
|
|
2878
3192
|
}
|
|
2879
3193
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2880
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3194
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2881
3195
|
main { padding: 14px; }
|
|
2882
3196
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2883
3197
|
thead { display: none; }
|
|
@@ -3048,6 +3362,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
3048
3362
|
status: 200,
|
|
3049
3363
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3050
3364
|
});
|
|
3365
|
+
var describeExtension = (extension) => {
|
|
3366
|
+
if (extension.kind === "sql") {
|
|
3367
|
+
return {
|
|
3368
|
+
kind: "sql",
|
|
3369
|
+
id: extension.id ?? "sql",
|
|
3370
|
+
title: extension.title ?? "SQL",
|
|
3371
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3372
|
+
};
|
|
3373
|
+
}
|
|
3374
|
+
return {
|
|
3375
|
+
kind: "panel",
|
|
3376
|
+
id: extension.id,
|
|
3377
|
+
title: extension.title,
|
|
3378
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3379
|
+
html: extension.html,
|
|
3380
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3381
|
+
};
|
|
3382
|
+
};
|
|
3051
3383
|
var adminUiRoutes = (service, ui) => {
|
|
3052
3384
|
const shell = () => renderAdminDocument(service);
|
|
3053
3385
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3062,7 +3394,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3062
3394
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3063
3395
|
html: panel.html,
|
|
3064
3396
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3065
|
-
}))
|
|
3397
|
+
})),
|
|
3398
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3066
3399
|
})
|
|
3067
3400
|
};
|
|
3068
3401
|
};
|
|
@@ -3749,7 +4082,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3749
4082
|
};
|
|
3750
4083
|
|
|
3751
4084
|
// ../core/dist/version.js
|
|
3752
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4085
|
+
var PACKAGE_VERSION = true ? "1.8.0" : UNRELEASED_VERSION;
|
|
3753
4086
|
|
|
3754
4087
|
// ../core/dist/signing.js
|
|
3755
4088
|
var encoder = new TextEncoder();
|
|
@@ -5572,4 +5905,4 @@ export {
|
|
|
5572
5905
|
tokenCredential,
|
|
5573
5906
|
RxVortexAPI
|
|
5574
5907
|
};
|
|
5575
|
-
//# sourceMappingURL=chunk-
|
|
5908
|
+
//# sourceMappingURL=chunk-TBKZ7IOI.js.map
|