tortoise-orm-studio 1.0.0__py3-none-any.whl

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.
Files changed (68) hide show
  1. tortoise_orm_studio/__init__.py +11 -0
  2. tortoise_orm_studio/adapters/__init__.py +1 -0
  3. tortoise_orm_studio/adapters/aiohttp_adapter.py +31 -0
  4. tortoise_orm_studio/adapters/asgi.py +89 -0
  5. tortoise_orm_studio/adapters/base.py +25 -0
  6. tortoise_orm_studio/adapters/django_adapter.py +84 -0
  7. tortoise_orm_studio/adapters/quart_adapter.py +32 -0
  8. tortoise_orm_studio/adapters/registry.py +39 -0
  9. tortoise_orm_studio/adapters/sanic_adapter.py +39 -0
  10. tortoise_orm_studio/auth.py +34 -0
  11. tortoise_orm_studio/cli.py +41 -0
  12. tortoise_orm_studio/core/__init__.py +1 -0
  13. tortoise_orm_studio/core/aerich.py +86 -0
  14. tortoise_orm_studio/core/ai.py +87 -0
  15. tortoise_orm_studio/core/audit.py +69 -0
  16. tortoise_orm_studio/core/config.py +58 -0
  17. tortoise_orm_studio/core/filters.py +94 -0
  18. tortoise_orm_studio/core/handler.py +249 -0
  19. tortoise_orm_studio/core/http.py +55 -0
  20. tortoise_orm_studio/core/i18n.py +18 -0
  21. tortoise_orm_studio/core/introspect.py +197 -0
  22. tortoise_orm_studio/core/manifest.py +128 -0
  23. tortoise_orm_studio/core/pagination.py +59 -0
  24. tortoise_orm_studio/core/permissions.py +46 -0
  25. tortoise_orm_studio/core/plugins.py +214 -0
  26. tortoise_orm_studio/core/ratelimit.py +32 -0
  27. tortoise_orm_studio/core/scoping.py +23 -0
  28. tortoise_orm_studio/core/serializers.py +61 -0
  29. tortoise_orm_studio/core/service.py +594 -0
  30. tortoise_orm_studio/plugins.py +8 -0
  31. tortoise_orm_studio/static/ALPINE_LICENSE.txt +11 -0
  32. tortoise_orm_studio/static/_types.d.ts +706 -0
  33. tortoise_orm_studio/static/a11y.js +115 -0
  34. tortoise_orm_studio/static/ai.js +66 -0
  35. tortoise_orm_studio/static/alpine.min.js +23 -0
  36. tortoise_orm_studio/static/app.css +514 -0
  37. tortoise_orm_studio/static/app.js +1443 -0
  38. tortoise_orm_studio/static/audit.js +171 -0
  39. tortoise_orm_studio/static/copy-as.js +118 -0
  40. tortoise_orm_studio/static/er-layout.js +227 -0
  41. tortoise_orm_studio/static/er.js +296 -0
  42. tortoise_orm_studio/static/filters.js +114 -0
  43. tortoise_orm_studio/static/i18n.en.js +190 -0
  44. tortoise_orm_studio/static/i18n.js +140 -0
  45. tortoise_orm_studio/static/i18n.zh-CN.js +189 -0
  46. tortoise_orm_studio/static/index.html +515 -0
  47. tortoise_orm_studio/static/inline-edit.js +107 -0
  48. tortoise_orm_studio/static/json-view.js +161 -0
  49. tortoise_orm_studio/static/migrations.js +139 -0
  50. tortoise_orm_studio/static/palette.js +141 -0
  51. tortoise_orm_studio/static/pending.js +240 -0
  52. tortoise_orm_studio/static/pickers.js +230 -0
  53. tortoise_orm_studio/static/playground.js +105 -0
  54. tortoise_orm_studio/static/query-history.js +84 -0
  55. tortoise_orm_studio/static/shortcuts.js +145 -0
  56. tortoise_orm_studio/static/state-hash.js +112 -0
  57. tortoise_orm_studio/static/tabs.js +368 -0
  58. tortoise_orm_studio/static/theme-init.js +33 -0
  59. tortoise_orm_studio/static/theme.js +106 -0
  60. tortoise_orm_studio/static/toasts.js +76 -0
  61. tortoise_orm_studio/static/views.js +70 -0
  62. tortoise_orm_studio/static/widgets.js +345 -0
  63. tortoise_orm_studio/studio.py +51 -0
  64. tortoise_orm_studio-1.0.0.dist-info/METADATA +177 -0
  65. tortoise_orm_studio-1.0.0.dist-info/RECORD +68 -0
  66. tortoise_orm_studio-1.0.0.dist-info/WHEEL +4 -0
  67. tortoise_orm_studio-1.0.0.dist-info/entry_points.txt +2 -0
  68. tortoise_orm_studio-1.0.0.dist-info/licenses/LICENSE +13 -0
@@ -0,0 +1,296 @@
1
+ // @ts-check
2
+ /**
3
+ * CSP-safe, in-app ER diagram renderer.
4
+ *
5
+ * No Mermaid, no CDN, no `<style>` injection, no inline `style=` attributes:
6
+ * the SVG is built with createElementNS and every colour comes from a CSS
7
+ * class in app.css that reads a theme token. Geometry comes from the pure
8
+ * `er-layout.js` module. The Mermaid *text* view is retained for copy/download.
9
+ *
10
+ * window.StudioEr.render(schema, options) -> HTMLElement
11
+ * Types: ErAPI, Schema, ModelDesc from _types.d.ts.
12
+ */
13
+ (function (/** @type {Window & { StudioEr?: ErAPI, StudioErLayout?: any, StudioToasts?: any }} */ global) {
14
+ "use strict";
15
+
16
+ var NS = "http://www.w3.org/2000/svg";
17
+
18
+ /**
19
+ * @param {string} tag
20
+ * @param {Record<string, any>} attrs
21
+ * @param {Array<Node|string>} [children]
22
+ * @returns {SVGElement}
23
+ */
24
+ function svgEl(tag, attrs, children) {
25
+ /** @type {SVGElement} */ var el = /** @type {any} */ (document.createElementNS(NS, tag));
26
+ for (var k of Object.keys(attrs || {})) {
27
+ var v = attrs[k];
28
+ if (v === undefined || v === null) continue;
29
+ el.setAttribute(k, String(v)); // attributes, never `style=`
30
+ }
31
+ for (var c of children || []) {
32
+ el.appendChild(typeof c === "string" ? document.createTextNode(c) : c);
33
+ }
34
+ return el;
35
+ }
36
+
37
+ /**
38
+ * @template {keyof HTMLElementTagNameMap} K
39
+ * @param {K} tag
40
+ * @param {Record<string, any>} props
41
+ * @param {Array<Node|string>} [children]
42
+ * @returns {HTMLElementTagNameMap[K]}
43
+ */
44
+ function create(tag, props, children) {
45
+ /** @type {any} */ var el = document.createElement(tag);
46
+ for (var k of Object.keys(props || {})) {
47
+ var v = props[k];
48
+ if (v === undefined) continue;
49
+ if (k === "class") el.className = v;
50
+ else if (k.startsWith("on") && typeof v === "function") el.addEventListener(k.slice(2), v);
51
+ else if (k in el) el[k] = v;
52
+ else el.setAttribute(k, String(v));
53
+ }
54
+ for (var c of children || []) {
55
+ el.appendChild(typeof c === "string" ? document.createTextNode(c) : c);
56
+ }
57
+ return el;
58
+ }
59
+
60
+ /** @param {string} msg @param {"success"|"error"} kind */
61
+ function toast(msg, kind) {
62
+ var T = global.StudioToasts;
63
+ if (T) T.show(msg, kind);
64
+ }
65
+
66
+ /** @param {string} text */
67
+ function copyText(text) {
68
+ if (!navigator.clipboard) return Promise.reject(new Error("clipboard unavailable"));
69
+ return navigator.clipboard.writeText(text);
70
+ }
71
+
72
+ /** @param {string} filename @param {Blob} blob */
73
+ function download(filename, blob) {
74
+ var reader = new FileReader();
75
+ reader.onload = function () {
76
+ var a = create("a", { href: String(reader.result), download: filename });
77
+ document.body.appendChild(a);
78
+ a.click();
79
+ document.body.removeChild(a);
80
+ };
81
+ reader.readAsDataURL(blob);
82
+ }
83
+
84
+ /** @returns {any} */
85
+ function geometry() {
86
+ var L = global.StudioErLayout;
87
+ if (!L) throw new Error("er-layout.js must load before er.js");
88
+ return L;
89
+ }
90
+
91
+ /**
92
+ * @param {any} box
93
+ * @param {(key: string) => void} onOpen
94
+ * @returns {SVGElement}
95
+ */
96
+ function renderBox(box, onOpen) {
97
+ var L = geometry();
98
+ // The accessible name includes every visible label in the box (title,
99
+ // field icons, names and kinds) so axe's label/content check is satisfied.
100
+ var labelParts = [box.app + "." + box.name];
101
+ box.fields.forEach(function (/** @type {Field} */ f) {
102
+ labelParts.push((f.pk ? "\u25a0" : "\u00b7") + f.name + f.kind);
103
+ });
104
+ var g = svgEl("g", {
105
+ class: "er-box", "data-model": box.key, role: "button", tabindex: "0",
106
+ "aria-label": "Open " + labelParts.join(""),
107
+ });
108
+ g.appendChild(svgEl("rect", { class: "er-box-bg", x: box.x, y: box.y,
109
+ width: box.width, height: box.height, rx: 6 }));
110
+ g.appendChild(svgEl("rect", { class: "er-box-header", x: box.x, y: box.y,
111
+ width: box.width, height: L.HEADER_H, rx: 6 }));
112
+ g.appendChild(svgEl("text", { class: "er-box-title", x: box.x + 10, y: box.y + 20 },
113
+ [box.app + "." + box.name]));
114
+
115
+ box.fields.forEach(function (/** @type {Field} */ f, /** @type {number} */ i) {
116
+ var y = box.y + L.HEADER_H + 13 + i * L.FIELD_H;
117
+ var row = svgEl("g", { class: f.pk ? "er-field er-field-pk" : "er-field",
118
+ "aria-hidden": "true" });
119
+ row.appendChild(svgEl("text", { class: "er-field-icon", x: box.x + 10, y: y },
120
+ [f.pk ? "\u25a0" : "\u00b7"]));
121
+ row.appendChild(svgEl("text", { class: "er-field-name", x: box.x + 26, y: y }, [f.name]));
122
+ row.appendChild(svgEl("text", { class: "er-field-kind", x: box.x + box.width - 10, y: y,
123
+ "text-anchor": "end" }, [f.kind]));
124
+ g.appendChild(row);
125
+ });
126
+
127
+ /** @param {Event} ev */
128
+ function open(ev) {
129
+ ev.preventDefault();
130
+ onOpen(box.key);
131
+ }
132
+ g.addEventListener("click", open);
133
+ g.addEventListener("keydown", function (/** @type {any} */ ev) {
134
+ if (ev.key === "Enter" || ev.key === " ") open(ev);
135
+ });
136
+ return g;
137
+ }
138
+
139
+ /** @param {any[]} edges @param {any[]} boxes @returns {SVGElement} */
140
+ function renderEdges(edges, boxes) {
141
+ var L = geometry();
142
+ var layer = svgEl("g", { class: "er-edge-layer", "aria-hidden": "true" });
143
+ edges.forEach(function (/** @type {any} */ edge) {
144
+ var paths = L.edgePaths(edge, boxes);
145
+ var group = svgEl("g", { class: "er-edge er-edge-" + edge.type });
146
+ paths.paths.forEach(function (/** @type {string} */ d) {
147
+ group.appendChild(svgEl("path", { d: d }));
148
+ });
149
+ group.appendChild(svgEl("title", {}, [edge.from + " -> " + edge.to + " (" + edge.name + ")"]));
150
+ layer.appendChild(group);
151
+ });
152
+ return layer;
153
+ }
154
+
155
+ /**
156
+ * Serialise the live SVG to standalone SVG text. The exported file needs
157
+ * its own colours, so token values are copied into a `<style>` block in the
158
+ * exported copy only — the page itself never injects one.
159
+ * @param {SVGElement} svg
160
+ * @returns {string}
161
+ */
162
+ function serialise(svg) {
163
+ var clone = /** @type {SVGElement} */ (svg.cloneNode(true));
164
+ var names = ["er-bg", "er-box-bg", "er-box-header", "er-box-title", "er-field",
165
+ "er-field-pk", "er-field-name", "er-field-kind", "er-field-icon",
166
+ "er-edge", "er-edge-fk", "er-edge-o2o", "er-edge-m2m"];
167
+ var computed = window.getComputedStyle ? window.getComputedStyle(document.documentElement) : null;
168
+ var css = "";
169
+ if (computed) {
170
+ names.forEach(function (/** @type {string} */ name) {
171
+ var value = computed.getPropertyValue("--" + name);
172
+ if (value) css += "." + name + "{color:" + value + ";fill:" + value + ";stroke:" + value + "}\n";
173
+ });
174
+ }
175
+ if (css) clone.insertBefore(svgEl("style", {}, [css]), clone.firstChild);
176
+ return new XMLSerializer().serializeToString(clone);
177
+ }
178
+
179
+ /** @param {SVGElement} svg */
180
+ function exportSvg(svg) {
181
+ download("schema.svg", new Blob([serialise(svg)], { type: "image/svg+xml;charset=utf-8" }));
182
+ toast("Downloaded schema.svg", "success");
183
+ }
184
+
185
+ /** @param {SVGElement} svg */
186
+ function exportPng(svg) {
187
+ var text = serialise(svg);
188
+ // jsconfig has no DOM lib detail for SVGSVGElement.viewBox; parse the
189
+ // attribute we set ourselves (the only source of the export size).
190
+ var vb = (svg.getAttribute("viewBox") || "0 0 400 300").split(/[\s,]+/).map(Number);
191
+ var width = Math.max(1, Math.round(vb[2] || 400));
192
+ var height = Math.max(1, Math.round(vb[3] || 300));
193
+ var url = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(text)));
194
+ var img = new Image();
195
+ img.onload = function () {
196
+ var canvas = create("canvas", { width: width, height: height });
197
+ var ctx = canvas.getContext("2d");
198
+ if (!ctx) { toast("Canvas unavailable", "error"); return; }
199
+ ctx.drawImage(img, 0, 0, width, height);
200
+ canvas.toBlob(function (/** @type {Blob|null} */ blob) {
201
+ if (!blob) { toast("PNG export failed", "error"); return; }
202
+ download("schema.png", blob);
203
+ toast("Downloaded schema.png", "success");
204
+ }, "image/png");
205
+ };
206
+ img.onerror = function () { toast("PNG export failed", "error"); };
207
+ img.src = url;
208
+ }
209
+
210
+ /**
211
+ * @param {Schema | null} schema
212
+ * @param {{ onOpen?: (key: string) => void, mermaid?: string | null }} [options]
213
+ * @returns {HTMLElement}
214
+ */
215
+ function render(schema, options) {
216
+ var opts = options || {};
217
+ var root = create("div", { class: "er-panel" });
218
+ var models = schema && schema.models ? schema.models : [];
219
+ if (!models.length) {
220
+ root.appendChild(create("p", { class: "mut" }, ["No schema available."]));
221
+ return root;
222
+ }
223
+
224
+ var L = geometry();
225
+ var mermaid = opts.mermaid || "";
226
+ var actions = create("div", { class: "er-actions" });
227
+ /** @param {string} label @param {() => void} fn */
228
+ function button(label, fn) {
229
+ var b = create("button", { type: "button" }, [label]);
230
+ b.addEventListener("click", fn);
231
+ actions.appendChild(b);
232
+ }
233
+
234
+ var boxes = L.layout(models);
235
+ var edges = L.edges(models);
236
+ var vb = L.viewBox(boxes);
237
+ var svg = svgEl("svg", {
238
+ class: "er-svg", viewBox: vb.x + " " + vb.y + " " + vb.width + " " + vb.height,
239
+ role: "group", "aria-label": "Entity relationship diagram",
240
+ });
241
+ var viewport = svgEl("g", { class: "er-viewport", transform: "translate(0 0) scale(1)" });
242
+ viewport.appendChild(renderEdges(edges, boxes));
243
+ boxes.forEach(function (/** @type {any} */ box) {
244
+ viewport.appendChild(renderBox(box, opts.onOpen || function () {}));
245
+ });
246
+ svg.appendChild(viewport);
247
+ root.appendChild(actions);
248
+
249
+ // --- pan / zoom entirely through the SVG `transform` attribute --------
250
+ var tx = 0, ty = 0, scale = 1;
251
+ /** @type {{ x: number, y: number } | null} */
252
+ var drag = null;
253
+ /** @param {number} x @param {number} y */
254
+ function apply(x, y) {
255
+ viewport.setAttribute("transform", "translate(" + x + " " + y + ") scale(" + scale + ")");
256
+ tx = x; ty = y;
257
+ }
258
+ svg.addEventListener("pointerdown", function (/** @type {any} */ ev) {
259
+ drag = { x: ev.clientX - tx, y: ev.clientY - ty };
260
+ });
261
+ svg.addEventListener("pointermove", function (/** @type {any} */ ev) {
262
+ if (drag) apply(ev.clientX - drag.x, ev.clientY - drag.y);
263
+ });
264
+ window.addEventListener("pointerup", function () { drag = null; });
265
+ svg.addEventListener("wheel", function (/** @type {any} */ ev) {
266
+ ev.preventDefault();
267
+ scale = Math.max(0.3, Math.min(3, scale * (ev.deltaY < 0 ? 1.1 : 1 / 1.1)));
268
+ apply(tx, ty);
269
+ });
270
+ button("Zoom in", function () { scale = Math.min(3, scale * 1.2); apply(tx, ty); });
271
+ button("Zoom out", function () { scale = Math.max(0.3, scale / 1.2); apply(tx, ty); });
272
+ button("Reset", function () { scale = 1; apply(0, 0); });
273
+
274
+ root.appendChild(svg);
275
+ button("Export SVG", function () { exportSvg(svg); });
276
+ button("Export PNG", function () { exportPng(svg); });
277
+
278
+ if (mermaid) {
279
+ button("Copy Mermaid", function () {
280
+ copyText(mermaid).then(function () { toast("Copied", "success"); },
281
+ function () { toast("Copy failed", "error"); });
282
+ });
283
+ button("Download .mmd", function () {
284
+ download("schema.mmd", new Blob([mermaid], { type: "text/plain;charset=utf-8" }));
285
+ toast("Downloaded schema.mmd", "success");
286
+ });
287
+ root.appendChild(create("details", { class: "er-mermaid-details" }, [
288
+ create("summary", {}, ["Mermaid source"]),
289
+ create("pre", { class: "er-text" }, [mermaid]),
290
+ ]));
291
+ }
292
+ return root;
293
+ }
294
+
295
+ global.StudioEr = { render: render, serialise: serialise };
296
+ })(window);
@@ -0,0 +1,114 @@
1
+ // @ts-check
2
+ /**
3
+ * Filter predicates for the list-view filter builder.
4
+ *
5
+ * Operator map mirrors core/filters.py — the tests keep them in sync.
6
+ * Types (Field, FieldKind, FilterPredicate) come from _types.d.ts.
7
+ */
8
+
9
+ (function (/** @type {Window & { StudioFilters?: any }} */ global) {
10
+ "use strict";
11
+
12
+ /** @type {Set<string>} */
13
+ const TEXT_KINDS = new Set(["string", "text", "enum"]);
14
+ /** @type {Set<string>} */
15
+ const UNFILTERABLE = new Set(["json", "binary"]);
16
+ /** @type {string[]} */
17
+ const BASE_OPS = ["eq", "ne", "in", "isnull", "gt", "gte", "lt", "lte"];
18
+ /** @type {string[]} */
19
+ const TEXT_OPS = ["contains", "icontains", "startswith", "istartswith", "endswith", "iendswith"];
20
+
21
+ /**
22
+ * @param {Field} field
23
+ * @returns {string[]}
24
+ */
25
+ function opsForField(field) {
26
+ if (UNFILTERABLE.has(field.kind)) return ["isnull"];
27
+ if (TEXT_KINDS.has(field.kind)) return BASE_OPS.concat(TEXT_OPS);
28
+ return BASE_OPS.slice();
29
+ }
30
+
31
+ /**
32
+ * @param {Field} field
33
+ * @param {string} op
34
+ * @param {unknown} raw
35
+ * @returns {unknown}
36
+ */
37
+ function normalizeValue(field, op, raw) {
38
+ if (op === "isnull") return raw === "true" || raw === true;
39
+ if (op === "in") {
40
+ return String(raw).split(",").map(function (s) { return s.trim(); }).filter(Boolean);
41
+ }
42
+ switch (field.kind) {
43
+ case "int": return parseInt(String(raw), 10);
44
+ case "float": return parseFloat(String(raw));
45
+ case "bool": return raw === "true" || raw === true;
46
+ case "decimal": return String(raw);
47
+ case "fk":
48
+ case "o2o":
49
+ // Coerce to the related model's pk type
50
+ switch (field.pk_kind) {
51
+ case "int": return parseInt(String(raw), 10);
52
+ case "float": return parseFloat(String(raw));
53
+ default: return String(raw);
54
+ }
55
+ default: return raw;
56
+ }
57
+ }
58
+
59
+ /**
60
+ * @param {FilterPredicate} f
61
+ * @returns {string}
62
+ */
63
+ function label(f) {
64
+ const v = Array.isArray(f.value) ? f.value.join(", ") : String(f.value);
65
+ return f.field + " " + f.op + " " + v;
66
+ }
67
+
68
+ /**
69
+ * @param {Field} field
70
+ * @param {string} op
71
+ * @param {unknown} raw
72
+ * @returns {string|null}
73
+ */
74
+ function validate(field, op, raw) {
75
+ if (op === "isnull") {
76
+ if (raw !== true && raw !== "true" && raw !== false && raw !== "false") {
77
+ return "isnull needs true or false";
78
+ }
79
+ return null;
80
+ }
81
+ if (raw === "" || raw === null || raw === undefined) return "Required";
82
+ if (op === "in") {
83
+ const parts = String(raw).split(",").map(function (s) { return s.trim(); }).filter(Boolean);
84
+ if (parts.length === 0) return "At least one value";
85
+ if (field.kind === "int") {
86
+ for (let i = 0; i < parts.length; i++) {
87
+ if (!/^-?\d+$/.test(parts[i])) return "Non-integer in list";
88
+ }
89
+ }
90
+ if (field.kind === "float" || field.kind === "decimal") {
91
+ for (let i = 0; i < parts.length; i++) {
92
+ if (!/^-?\d+(\.\d+)?$/.test(parts[i])) return "Non-number in list";
93
+ }
94
+ }
95
+ return null;
96
+ }
97
+ if (field.kind === "int" && !/^-?\d+$/.test(String(raw))) return "Must be an integer";
98
+ if ((field.kind === "float" || field.kind === "decimal") && !/^-?\d+(\.\d+)?$/.test(String(raw))) {
99
+ return "Must be a number";
100
+ }
101
+ return null;
102
+ }
103
+
104
+ global.StudioFilters = {
105
+ opsForField: opsForField,
106
+ normalizeValue: normalizeValue,
107
+ label: label,
108
+ validate: validate,
109
+ TEXT_KINDS: TEXT_KINDS,
110
+ UNFILTERABLE: UNFILTERABLE,
111
+ BASE_OPS: BASE_OPS,
112
+ TEXT_OPS: TEXT_OPS,
113
+ };
114
+ })(window);
@@ -0,0 +1,190 @@
1
+ // @ts-check
2
+ "use strict";
3
+ /** English strings. Loaded after i18n.js, before app.js. No HTML, no inline handlers. */
4
+ (/** @type {any} */ (window).StudioI18n).register("en", {
5
+ "nav.list": "List",
6
+ "nav.playground": "Playground",
7
+ "nav.er": "ER Diagram",
8
+ "nav.migrations": "Migrations",
9
+ "nav.audit": "Audit",
10
+ "nav.plugins": "Plugins",
11
+
12
+ "theme.label": "Color theme",
13
+ "views.saved": "Saved Views",
14
+ "views.saveCurrent": "Save current…",
15
+ "views.delete": "Delete view",
16
+ "connection.label": "Connection",
17
+ "connection.default": "(default)",
18
+
19
+ "model.filterPlaceholder": "Filter models…",
20
+ "model.filter": "Filter models",
21
+ "model.pin": "Pin model",
22
+ "model.unpin": "Unpin model",
23
+ "tab.close": "Close {title}",
24
+ "tab.new": "New tab",
25
+ "tab.split": "Split",
26
+
27
+ "list.searchPlaceholder": "search (Enter)",
28
+ "list.rows": "{count} rows",
29
+ "list.density.compact": "Compact",
30
+ "list.density.comfortable": "Comfortable",
31
+ "list.new": "New",
32
+ "list.undoInline": "Undo edit",
33
+ "list.clear": "Clear",
34
+ "list.columns": "Columns",
35
+ "list.emptyState": "No rows match this view. Try clearing filters or search.",
36
+ "list.prev": "Prev",
37
+ "list.next": "Next",
38
+ "list.selected": "{count} selected",
39
+ "list.deleteSelected": "Delete selected",
40
+ "list.copyOptions": "Copy options",
41
+ "list.copyAs": "Copy as",
42
+ "list.copyJson": "JSON",
43
+ "list.copyCreate": "create()",
44
+ "list.copyCsv": "CSV line",
45
+ "list.copyRowAs": "Copy row {pk} as",
46
+ "list.copyOptionsFor": "Copy options for row {pk}",
47
+ "list.doubleClick": "Double-click to edit",
48
+ "list.filter.add": "+ Filter",
49
+ "list.filter.cancel": "Cancel",
50
+ "list.filter.value": "value",
51
+ "list.sortAsc": "{col} (asc)",
52
+ "list.sortDesc": "{col} (desc)",
53
+ "list.null": "NULL",
54
+
55
+ "ai.title": "Describe a filter",
56
+ "ai.prompt": "e.g. active users over 18",
57
+ "ai.field": "Filter description",
58
+ "ai.suggest": "Suggest filters",
59
+ "ai.apply": "Apply selected filters",
60
+ "ai.removeChip": "Remove filter chip",
61
+
62
+ "detail.label": "Row detail",
63
+ "detail.close": "Close detail drawer",
64
+ "detail.save": "Save",
65
+ "detail.delete": "Delete",
66
+ "detail.stage": "Stage change",
67
+ "detail.stageDelete": "Stage delete",
68
+ "detail.formMode.json": "JSON view",
69
+ "detail.formMode.form": "Form view",
70
+ "detail.jsonTree": "JSON tree",
71
+ "detail.applyEdits": "Apply edits",
72
+ "detail.jsonHint": "Edit the JSON text above, then Apply edits.",
73
+ "detail.dirty": "Unsaved changes",
74
+ "detail.changes": "Field changes",
75
+ "detail.rowJson": "Row JSON",
76
+ "detail.add": "+ Add",
77
+ "detail.remove": "Remove",
78
+ "detail.stageAdd": "Stage add",
79
+ "detail.stageRemove": "Stage remove",
80
+
81
+ "playground.title": "Query Playground",
82
+ "playground.hint": "Preview the Python call and generated SQL for a filter/sort combination.",
83
+ "playground.model": "Model",
84
+ "playground.filters": "Filters (JSON)",
85
+ "playground.search": "Search",
86
+ "playground.sort": "Sort",
87
+ "playground.limit": "Limit",
88
+ "playground.run": "Run Preview",
89
+ "playground.history": "History",
90
+ "playground.openInList": "Open in list view",
91
+ "playground.lastQuery": "Last query time",
92
+ "playground.recent": "Recent queries",
93
+ "playground.none": "No queries yet.",
94
+ "playground.clear": "Clear",
95
+
96
+ "er.title": "ER Diagram",
97
+ "er.hint": "Mermaid erDiagram text for all registered models.",
98
+
99
+ "migrations.title": "Migrations",
100
+ "migrations.hint": "Applied and pending Aerich migrations for the current connection.",
101
+
102
+ "audit.title": "Audit Log",
103
+ "audit.hint": "Every create / update / delete recorded by the audit hook.",
104
+ "audit.action": "Action",
105
+ "audit.any": "(any)",
106
+ "audit.model": "Model",
107
+ "audit.actor": "Actor",
108
+ "audit.apply": "Apply",
109
+ "audit.clear": "Clear",
110
+
111
+ "plugin.title": "Plugins",
112
+ "plugin.hint": "Actions contributed by installed plugins. Output is read-only.",
113
+
114
+ "pending.title": "Pending changes ({count})",
115
+ "pending.show": "Show",
116
+ "pending.hide": "Hide",
117
+ "pending.empty": "No staged changes.",
118
+ "pending.deleteRow": "delete row",
119
+ "pending.remove": "Remove staged change",
120
+ "pending.saveAll": "Save all",
121
+ "pending.undo": "Undo last",
122
+ "pending.discard": "Discard all",
123
+
124
+ "status.db": "DB: {conn}",
125
+ "status.readOnly": "READ ONLY",
126
+ "status.writeEnabled": "WRITE ENABLED",
127
+ "status.help": "Keyboard shortcuts",
128
+
129
+ "help.title": "Keyboard shortcuts",
130
+ "help.palette": "Command palette",
131
+ "help.focusSearch": "Focus search",
132
+ "help.move": "Move selection down / up",
133
+ "help.open": "Open selected row",
134
+ "help.back": "Back / close",
135
+ "help.models": "Go to models",
136
+ "help.this": "This help",
137
+ "common.close": "Close",
138
+
139
+ // Dynamic messages: the English source string is the key so a missing
140
+ // translation degrades to the original text, never to a raw key id.
141
+ "search: {q}": "search: {q}",
142
+ "no filters": "no filters",
143
+ "This tab has unsaved changes. Close it anyway?": "This tab has unsaved changes. Close it anyway?",
144
+ "No rows selected": "No rows selected",
145
+ "Cannot delete {n} rows (max {max})": "Cannot delete {n} rows (max {max})",
146
+ "Deleted {n} row(s)": "Deleted {n} row(s)",
147
+ "Invalid JSON: {msg}": "Invalid JSON: {msg}",
148
+ "Invalid JSON: expected an object": "Invalid JSON: expected an object",
149
+ "Created": "Created",
150
+ "Saved": "Saved",
151
+ "Delete this row?": "Delete this row?",
152
+ "Deleted": "Deleted",
153
+ "pickers.js not loaded": "pickers.js not loaded",
154
+ "Added {n}": "Added {n}",
155
+ "Removed {n}": "Removed {n}",
156
+ "This row has unsaved changes. Leave it anyway?": "This row has unsaved changes. Leave it anyway?",
157
+ "No change": "No change",
158
+ "Cell change staged": "Cell change staged",
159
+ "Undid last cell edit": "Undid last cell edit",
160
+ "Copied {label}": "Copied {label}",
161
+ "Copy failed": "Copy failed",
162
+ "JSON applied": "JSON applied",
163
+ "Change staged": "Change staged",
164
+ "Stage deletion of this row?": "Stage deletion of this row?",
165
+ "Deletion staged": "Deletion staged",
166
+ "{n} relation change(s) staged": "{n} relation change(s) staged",
167
+ "Saved all staged changes": "Saved all staged changes",
168
+ "Discarded all staged changes": "Discarded all staged changes",
169
+ "Query history cleared": "Query history cleared",
170
+ "Invalid filter JSON": "Invalid filter JSON",
171
+ "No model selected": "No model selected",
172
+ "Save view as (existing names overwrite):": "Save view as (existing names overwrite):",
173
+ "views.js not loaded": "views.js not loaded",
174
+ "Saved view: {name}": "Saved view: {name}",
175
+ "Deleted view: {name}": "Deleted view: {name}",
176
+ "list.removeFilter": "Remove filter",
177
+ "list.filter.addButton": "Add",
178
+ "detail.breadcrumb": "Breadcrumb",
179
+ "detail.relation": "{name} ({type})",
180
+ "a11y.openViews": "Open views",
181
+ "a11y.skip": "Skip to content",
182
+ "a11y.models": "Models",
183
+ "a11y.collapseSidebar": "Collapse sidebar",
184
+ "a11y.selectRow": "Select row {pk}",
185
+ "a11y.selectAll": "Select all visible rows",
186
+ "a11y.row": "Open row {pk}",
187
+ "a11y.search": "Search rows",
188
+ "a11y.filterValue": "Filter value",
189
+ "locale.label": "Language",
190
+ });