elysia-rack 0.2.2 → 0.4.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/README.md +37 -20
- package/dist/Dashboard-4wv82gwx.js +212 -0
- package/dist/Dashboard-jkvfzyk2.js +210 -0
- package/dist/Dashboard-zhg2jtq5.js +211 -0
- package/dist/{Panel-fbp3wrsw.js → Panel-1qkzh8t7.js} +355 -311
- package/dist/Panel-7zpqz8gy.js +782 -0
- package/dist/Panel-9mmh3tbh.js +790 -0
- package/dist/Panel-ba0qzknj.js +789 -0
- package/dist/Panel-e6jyf4rc.js +789 -0
- package/dist/index-0dwhzk3j.js +145 -0
- package/dist/{index-6v0ns1xn.js → index-b8sq8rbd.js} +1 -1
- package/dist/index-rg87f3v1.js +174 -0
- package/dist/panel-app.js +27 -11
- package/dist/panel.css +2 -1
- package/dist/rack/index.js +5 -5
- package/dist/rack/types/metadata.d.ts +2 -1
- package/dist/react/donate.d.ts +1 -1
- package/dist/react/index.js +40 -15
- package/dist/react/page/Panel.d.ts +1 -0
- package/dist/react/page/components/Icon.d.ts +10 -0
- package/dist/react/page/components/Masthead.d.ts +5 -4
- package/dist/react/render.d.ts +1 -1
- package/dist/react/types.d.ts +18 -2
- package/package.json +8 -3
- package/dist/Dashboard-0da8dvbv.js +0 -225
- package/dist/Dashboard-2j561p7c.js +0 -225
- package/dist/Dashboard-5mt9hnbw.js +0 -252
- package/dist/Dashboard-7gmx8c9y.js +0 -248
- package/dist/Dashboard-s8nfyf7s.js +0 -39
- package/dist/Dashboard-xkh2g9f7.js +0 -248
- package/dist/Dashboard-xpstr7fr.js +0 -172
- package/dist/Panel-3yrk3krj.js +0 -914
- package/dist/Panel-b7jhgvnm.js +0 -916
- package/dist/Panel-n0kstkyw.js +0 -735
- package/dist/Panel-pkvqf5v8.js +0 -912
- package/dist/Panel-wjxjtbmr.js +0 -753
- package/dist/Panel-za4av616.js +0 -753
- package/dist/index-h3zbq796.js +0 -39
- package/dist/index-tgk4jt4d.js +0 -63
- package/dist/index-xsfqad54.js +0 -187
- package/dist/index-zc7rgvmm.js +0 -13
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
flatRackTree,
|
|
3
|
-
getRackTree
|
|
4
|
-
} from "./index-tgk4jt4d.js";
|
|
5
|
-
import"./index-37x76zdn.js";
|
|
6
|
-
|
|
7
|
-
// src/react/page/components/Breadcrumb.tsx
|
|
8
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
9
|
-
function Breadcrumb({ trail }) {
|
|
10
|
-
return /* @__PURE__ */ jsxDEV("nav", {
|
|
11
|
-
"aria-label": "Breadcrumb",
|
|
12
|
-
className: "pb-3 text-sm",
|
|
13
|
-
children: /* @__PURE__ */ jsxDEV("ol", {
|
|
14
|
-
className: "flex flex-wrap items-center gap-1.5",
|
|
15
|
-
children: trail.map((item, i) => {
|
|
16
|
-
const last = i === trail.length - 1;
|
|
17
|
-
return /* @__PURE__ */ jsxDEV("li", {
|
|
18
|
-
className: "flex items-center gap-1.5",
|
|
19
|
-
children: [
|
|
20
|
-
i > 0 ? /* @__PURE__ */ jsxDEV("span", {
|
|
21
|
-
"aria-hidden": "true",
|
|
22
|
-
className: "text-text-muted",
|
|
23
|
-
children: "/"
|
|
24
|
-
}, undefined, false, undefined, this) : null,
|
|
25
|
-
item.href && !last ? /* @__PURE__ */ jsxDEV("a", {
|
|
26
|
-
href: item.href,
|
|
27
|
-
className: "text-text-muted hover:text-foreground",
|
|
28
|
-
children: item.label
|
|
29
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV("span", {
|
|
30
|
-
"aria-current": last ? "page" : undefined,
|
|
31
|
-
className: last ? "text-foreground font-semibold" : "text-text-muted",
|
|
32
|
-
children: item.label
|
|
33
|
-
}, undefined, false, undefined, this)
|
|
34
|
-
]
|
|
35
|
-
}, `${item.label}-${i}`, true, undefined, this);
|
|
36
|
-
})
|
|
37
|
-
}, undefined, false, undefined, this)
|
|
38
|
-
}, undefined, false, undefined, this);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// src/react/page/components/Sidebar.tsx
|
|
42
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
43
|
-
function SidebarItemView({ item, depth = 0 }) {
|
|
44
|
-
const hasChildren = item.children && item.children.length > 0;
|
|
45
|
-
return /* @__PURE__ */ jsxDEV2("li", {
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ jsxDEV2("a", {
|
|
48
|
-
href: item.href,
|
|
49
|
-
"aria-current": item.active ? "page" : undefined,
|
|
50
|
-
className: item.active ? "bg-sidebar-primary text-sidebar-primary-foreground flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-semibold" : "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex items-center gap-2 rounded-md px-2 py-1.5 text-sm",
|
|
51
|
-
style: depth > 0 ? { paddingLeft: `${8 + depth * 12}px` } : undefined,
|
|
52
|
-
children: [
|
|
53
|
-
item.icon ? /* @__PURE__ */ jsxDEV2("span", {
|
|
54
|
-
"aria-hidden": "true",
|
|
55
|
-
children: item.icon
|
|
56
|
-
}, undefined, false, undefined, this) : null,
|
|
57
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
58
|
-
children: item.label
|
|
59
|
-
}, undefined, false, undefined, this)
|
|
60
|
-
]
|
|
61
|
-
}, undefined, true, undefined, this),
|
|
62
|
-
hasChildren ? /* @__PURE__ */ jsxDEV2("ul", {
|
|
63
|
-
className: "border-sidebar-border mt-0.5 ml-2 flex flex-col gap-0.5 border-l py-1 pl-2",
|
|
64
|
-
children: item.children.map((child) => /* @__PURE__ */ jsxDEV2(SidebarItemView, {
|
|
65
|
-
item: child,
|
|
66
|
-
depth: depth + 1
|
|
67
|
-
}, child.id, false, undefined, this))
|
|
68
|
-
}, undefined, false, undefined, this) : null
|
|
69
|
-
]
|
|
70
|
-
}, undefined, true, undefined, this);
|
|
71
|
-
}
|
|
72
|
-
function hasActive(items) {
|
|
73
|
-
for (const it of items) {
|
|
74
|
-
if (it.active)
|
|
75
|
-
return true;
|
|
76
|
-
if (it.children && hasActive(it.children))
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
function Sidebar({ title, groups }) {
|
|
82
|
-
return /* @__PURE__ */ jsxDEV2("aside", {
|
|
83
|
-
className: "bg-sidebar text-sidebar-foreground border-sidebar-border min-h-0 w-64 shrink-0 overflow-y-auto rounded-lg border",
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
86
|
-
className: "border-sidebar-border border-b px-4 py-3",
|
|
87
|
-
children: /* @__PURE__ */ jsxDEV2("p", {
|
|
88
|
-
className: "font-koran text-xl font-black tracking-tight",
|
|
89
|
-
children: title
|
|
90
|
-
}, undefined, false, undefined, this)
|
|
91
|
-
}, undefined, false, undefined, this),
|
|
92
|
-
/* @__PURE__ */ jsxDEV2("nav", {
|
|
93
|
-
className: "flex flex-col gap-4 p-3",
|
|
94
|
-
children: groups.map((group) => /* @__PURE__ */ jsxDEV2("section", {
|
|
95
|
-
children: /* @__PURE__ */ jsxDEV2("details", {
|
|
96
|
-
className: "group",
|
|
97
|
-
open: hasActive(group.items) || undefined,
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ jsxDEV2("summary", {
|
|
100
|
-
className: "font-koran border-sidebar-border flex cursor-pointer list-none items-center justify-between border-b px-2 pb-1 text-base font-bold tracking-tight [&::-webkit-details-marker]:hidden",
|
|
101
|
-
children: [
|
|
102
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
103
|
-
children: group.name
|
|
104
|
-
}, undefined, false, undefined, this),
|
|
105
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
106
|
-
"aria-hidden": "true",
|
|
107
|
-
className: "text-text-muted text-xs transition group-open:rotate-180",
|
|
108
|
-
children: "▾"
|
|
109
|
-
}, undefined, false, undefined, this)
|
|
110
|
-
]
|
|
111
|
-
}, undefined, true, undefined, this),
|
|
112
|
-
/* @__PURE__ */ jsxDEV2("ul", {
|
|
113
|
-
className: "border-sidebar-border mt-1 ml-2 flex flex-col gap-0.5 border-l py-1 pl-2",
|
|
114
|
-
children: group.items.map((item) => /* @__PURE__ */ jsxDEV2(SidebarItemView, {
|
|
115
|
-
item
|
|
116
|
-
}, item.id, false, undefined, this))
|
|
117
|
-
}, undefined, false, undefined, this)
|
|
118
|
-
]
|
|
119
|
-
}, undefined, true, undefined, this)
|
|
120
|
-
}, group.name, false, undefined, this))
|
|
121
|
-
}, undefined, false, undefined, this)
|
|
122
|
-
]
|
|
123
|
-
}, undefined, true, undefined, this);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// src/react/page/Dashboard.tsx
|
|
127
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
128
|
-
function itemLabel(r) {
|
|
129
|
-
return r.metadata.pluralLabel ?? r.metadata.label ?? r.metadata.id;
|
|
130
|
-
}
|
|
131
|
-
function buildGroups(racks, selectedId) {
|
|
132
|
-
const byGroup = new Map;
|
|
133
|
-
for (const r of racks) {
|
|
134
|
-
if (r.metadata.hidden)
|
|
135
|
-
continue;
|
|
136
|
-
const name = r.metadata.group ?? "General";
|
|
137
|
-
let group = byGroup.get(name);
|
|
138
|
-
if (!group) {
|
|
139
|
-
group = { name, items: [] };
|
|
140
|
-
byGroup.set(name, group);
|
|
141
|
-
}
|
|
142
|
-
group.items.push({
|
|
143
|
-
id: r.metadata.id,
|
|
144
|
-
label: itemLabel(r),
|
|
145
|
-
icon: r.metadata.icon,
|
|
146
|
-
href: `?resource=${encodeURIComponent(r.metadata.id)}`,
|
|
147
|
-
active: r.metadata.id === selectedId
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
const groups = [...byGroup.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
151
|
-
for (const group of groups) {
|
|
152
|
-
const orderOf = (id) => racks.find((r) => r.metadata.id === id)?.metadata.order ?? 0;
|
|
153
|
-
group.items.sort((a, b) => orderOf(a.id) - orderOf(b.id) || a.label.localeCompare(b.label));
|
|
154
|
-
}
|
|
155
|
-
return groups;
|
|
156
|
-
}
|
|
157
|
-
function toSidebarItem(node, selectedId) {
|
|
158
|
-
return {
|
|
159
|
-
id: node.metadata.id,
|
|
160
|
-
label: itemLabel(node),
|
|
161
|
-
icon: node.metadata.icon,
|
|
162
|
-
href: `?resource=${encodeURIComponent(node.metadata.id)}`,
|
|
163
|
-
active: node.metadata.id === selectedId,
|
|
164
|
-
children: node.children.filter((c) => !c.metadata.hidden).map((c) => toSidebarItem(c, selectedId))
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
function buildGroupsFromTree(tree, selectedId) {
|
|
168
|
-
const byGroup = new Map;
|
|
169
|
-
for (const root of tree) {
|
|
170
|
-
if (root.metadata.hidden)
|
|
171
|
-
continue;
|
|
172
|
-
const name = root.metadata.group ?? "General";
|
|
173
|
-
let group = byGroup.get(name);
|
|
174
|
-
if (!group) {
|
|
175
|
-
group = { name, items: [] };
|
|
176
|
-
byGroup.set(name, group);
|
|
177
|
-
}
|
|
178
|
-
group.items.push(toSidebarItem(root, selectedId));
|
|
179
|
-
}
|
|
180
|
-
return [...byGroup.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
181
|
-
}
|
|
182
|
-
function treeFromRacks(racks) {
|
|
183
|
-
const nodes = new Map;
|
|
184
|
-
for (const r of racks)
|
|
185
|
-
nodes.set(r.metadata.id, { ...r, children: [] });
|
|
186
|
-
const roots = [];
|
|
187
|
-
for (const node of nodes.values()) {
|
|
188
|
-
const parentId = node.metadata.parent;
|
|
189
|
-
if (parentId && nodes.has(parentId) && parentId !== node.metadata.id) {
|
|
190
|
-
nodes.get(parentId).children.push(node);
|
|
191
|
-
} else {
|
|
192
|
-
roots.push(node);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const sort = (list) => {
|
|
196
|
-
list.sort((a, b) => {
|
|
197
|
-
const oa = a.metadata.order ?? 0;
|
|
198
|
-
const ob = b.metadata.order ?? 0;
|
|
199
|
-
if (oa !== ob)
|
|
200
|
-
return oa - ob;
|
|
201
|
-
return itemLabel(a).localeCompare(itemLabel(b));
|
|
202
|
-
});
|
|
203
|
-
for (const n of list)
|
|
204
|
-
if (n.children.length)
|
|
205
|
-
sort(n.children);
|
|
206
|
-
};
|
|
207
|
-
sort(roots);
|
|
208
|
-
return roots;
|
|
209
|
-
}
|
|
210
|
-
async function Dashboard(props) {
|
|
211
|
-
const tree = props.racks !== undefined ? treeFromRacks(props.racks.filter((r) => !r.metadata.hidden)) : getRackTree().filter((r) => !r.metadata.hidden);
|
|
212
|
-
const flat = props.racks !== undefined ? props.racks.filter((r) => !r.metadata.hidden) : flatRackTree(tree).filter((r) => !r.metadata.hidden);
|
|
213
|
-
const selected = flat.find((r) => r.metadata.id === props.resource) ?? flat[0];
|
|
214
|
-
const groups = tree.length ? buildGroupsFromTree(tree, selected?.metadata.id) : buildGroups(flat, selected?.metadata.id);
|
|
215
|
-
const trail = [
|
|
216
|
-
{ label: "Dashboard", href: "?" },
|
|
217
|
-
...selected?.metadata.group ? [{ label: selected.metadata.group }] : [],
|
|
218
|
-
...selected ? [{ label: itemLabel(selected) }] : []
|
|
219
|
-
];
|
|
220
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
221
|
-
className: "koran-paper font-koran-body text-foreground flex flex-col min-h-screen",
|
|
222
|
-
children: /* @__PURE__ */ jsxDEV3("div", {
|
|
223
|
-
className: "flex min-h-0 flex-1 gap-6 p-4 sm:p-6 h-full",
|
|
224
|
-
children: [
|
|
225
|
-
/* @__PURE__ */ jsxDEV3(Sidebar, {
|
|
226
|
-
title: props.name ?? "Panel",
|
|
227
|
-
groups
|
|
228
|
-
}, undefined, false, undefined, this),
|
|
229
|
-
/* @__PURE__ */ jsxDEV3("main", {
|
|
230
|
-
className: "flex min-w-0 flex-1 flex-col",
|
|
231
|
-
children: [
|
|
232
|
-
/* @__PURE__ */ jsxDEV3(Breadcrumb, {
|
|
233
|
-
trail
|
|
234
|
-
}, undefined, false, undefined, this),
|
|
235
|
-
selected ? /* @__PURE__ */ jsxDEV3("iframe", {
|
|
236
|
-
src: selected.path,
|
|
237
|
-
title: itemLabel(selected),
|
|
238
|
-
sandbox: "allow-scripts allow-same-origin allow-forms",
|
|
239
|
-
className: "bg-card min-h-0 w-full flex-1 rounded-lg"
|
|
240
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV3("p", {
|
|
241
|
-
className: "text-text-muted border-border rounded-lg border px-4 py-10 text-center",
|
|
242
|
-
children: "No resources registered. Mount a resource with rack() first."
|
|
243
|
-
}, undefined, false, undefined, this)
|
|
244
|
-
]
|
|
245
|
-
}, undefined, true, undefined, this)
|
|
246
|
-
]
|
|
247
|
-
}, undefined, true, undefined, this)
|
|
248
|
-
}, undefined, false, undefined, this);
|
|
249
|
-
}
|
|
250
|
-
export {
|
|
251
|
-
Dashboard as default
|
|
252
|
-
};
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Breadcrumb,
|
|
3
|
-
Masthead,
|
|
4
|
-
Sidebar
|
|
5
|
-
} from "./index-xsfqad54.js";
|
|
6
|
-
import {
|
|
7
|
-
getRackTree
|
|
8
|
-
} from "./index-4wxvmd8a.js";
|
|
9
|
-
import {
|
|
10
|
-
resolveDonateProp
|
|
11
|
-
} from "./index-6v0ns1xn.js";
|
|
12
|
-
import"./index-37x76zdn.js";
|
|
13
|
-
|
|
14
|
-
// src/react/page/Dashboard.tsx
|
|
15
|
-
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
16
|
-
function itemLabel(r) {
|
|
17
|
-
return r.metadata.pluralLabel ?? r.metadata.label ?? r.metadata.id;
|
|
18
|
-
}
|
|
19
|
-
function toSidebarItem(node, activeId) {
|
|
20
|
-
return {
|
|
21
|
-
id: node.metadata.id,
|
|
22
|
-
label: itemLabel(node),
|
|
23
|
-
icon: node.metadata.icon,
|
|
24
|
-
href: node.path,
|
|
25
|
-
active: node.metadata.id === activeId,
|
|
26
|
-
children: node.children.filter((c) => !c.metadata.hidden).map((c) => toSidebarItem(c, activeId))
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function buildGroupsFromTree(tree, activeId) {
|
|
30
|
-
const byGroup = new Map;
|
|
31
|
-
for (const root of tree) {
|
|
32
|
-
if (root.metadata.hidden)
|
|
33
|
-
continue;
|
|
34
|
-
const name = root.metadata.group ?? "General";
|
|
35
|
-
let group = byGroup.get(name);
|
|
36
|
-
if (!group) {
|
|
37
|
-
group = { name, items: [] };
|
|
38
|
-
byGroup.set(name, group);
|
|
39
|
-
}
|
|
40
|
-
group.items.push(toSidebarItem(root, activeId));
|
|
41
|
-
}
|
|
42
|
-
return [...byGroup.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
43
|
-
}
|
|
44
|
-
async function Dashboard(props) {
|
|
45
|
-
const tree = getRackTree().filter((r) => !r.metadata.hidden);
|
|
46
|
-
const groups = buildGroupsFromTree(tree, props.resource);
|
|
47
|
-
const totalResources = tree.length + tree.reduce((a, n) => a + n.children.length, 0);
|
|
48
|
-
const totalGroups = groups.length;
|
|
49
|
-
const donate = resolveDonateProp(props.donate);
|
|
50
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
51
|
-
className: "koran-paper font-koran-body text-foreground flex min-h-screen flex-col",
|
|
52
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
53
|
-
className: "flex flex-1 gap-6 p-4 sm:p-6",
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsxDEV(Sidebar, {
|
|
56
|
-
title: props.name ?? "Panel",
|
|
57
|
-
groups
|
|
58
|
-
}, undefined, false, undefined, this),
|
|
59
|
-
/* @__PURE__ */ jsxDEV("main", {
|
|
60
|
-
className: "flex min-w-0 flex-1 flex-col",
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ jsxDEV(Breadcrumb, {
|
|
63
|
-
trail: [{ label: "Dashboard" }]
|
|
64
|
-
}, undefined, false, undefined, this),
|
|
65
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
66
|
-
className: "mx-auto w-full max-w-5xl px-4 pb-10 sm:px-6",
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ jsxDEV(Masthead, {
|
|
69
|
-
title: props.name ?? "ERP Demo",
|
|
70
|
-
group: "Dashboard",
|
|
71
|
-
resource: "dashboard",
|
|
72
|
-
total: totalResources
|
|
73
|
-
}, undefined, false, undefined, this),
|
|
74
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
75
|
-
className: "grid grid-cols-2 gap-3 pb-6 lg:grid-cols-4",
|
|
76
|
-
children: [
|
|
77
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
78
|
-
className: "bg-card border-border rounded-lg border px-4 py-3",
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
81
|
-
className: "text-text-muted text-xs font-semibold tracking-widest uppercase",
|
|
82
|
-
children: "Resources"
|
|
83
|
-
}, undefined, false, undefined, this),
|
|
84
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
85
|
-
className: "font-koran text-2xl font-black",
|
|
86
|
-
children: totalResources
|
|
87
|
-
}, undefined, false, undefined, this),
|
|
88
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
89
|
-
className: "text-text-muted text-xs",
|
|
90
|
-
children: [
|
|
91
|
-
totalGroups,
|
|
92
|
-
" groups"
|
|
93
|
-
]
|
|
94
|
-
}, undefined, true, undefined, this)
|
|
95
|
-
]
|
|
96
|
-
}, undefined, true, undefined, this),
|
|
97
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
98
|
-
className: "bg-card border-border rounded-lg border px-4 py-3",
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
101
|
-
className: "text-text-muted text-xs font-semibold tracking-widest uppercase",
|
|
102
|
-
children: "Modules"
|
|
103
|
-
}, undefined, false, undefined, this),
|
|
104
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
105
|
-
className: "font-koran text-2xl font-black",
|
|
106
|
-
children: totalGroups
|
|
107
|
-
}, undefined, false, undefined, this),
|
|
108
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
109
|
-
className: "text-text-muted text-xs",
|
|
110
|
-
children: "Core → Governance"
|
|
111
|
-
}, undefined, false, undefined, this)
|
|
112
|
-
]
|
|
113
|
-
}, undefined, true, undefined, this),
|
|
114
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
115
|
-
className: "bg-card border-border rounded-lg border px-4 py-3",
|
|
116
|
-
children: [
|
|
117
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
118
|
-
className: "text-text-muted text-xs font-semibold tracking-widest uppercase",
|
|
119
|
-
children: "Status"
|
|
120
|
-
}, undefined, false, undefined, this),
|
|
121
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
122
|
-
className: "font-koran text-2xl font-black",
|
|
123
|
-
children: "Ready"
|
|
124
|
-
}, undefined, false, undefined, this),
|
|
125
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
126
|
-
className: "text-text-muted text-xs",
|
|
127
|
-
children: "PGlite in-memory"
|
|
128
|
-
}, undefined, false, undefined, this)
|
|
129
|
-
]
|
|
130
|
-
}, undefined, true, undefined, this),
|
|
131
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
132
|
-
className: "bg-card border-border rounded-lg border px-4 py-3",
|
|
133
|
-
children: [
|
|
134
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
135
|
-
className: "text-text-muted text-xs font-semibold tracking-widest uppercase",
|
|
136
|
-
children: "Tree"
|
|
137
|
-
}, undefined, false, undefined, this),
|
|
138
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
139
|
-
className: "font-koran text-2xl font-black",
|
|
140
|
-
children: tree.length
|
|
141
|
-
}, undefined, false, undefined, this),
|
|
142
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
143
|
-
className: "text-text-muted text-xs",
|
|
144
|
-
children: "root nodes"
|
|
145
|
-
}, undefined, false, undefined, this)
|
|
146
|
-
]
|
|
147
|
-
}, undefined, true, undefined, this)
|
|
148
|
-
]
|
|
149
|
-
}, undefined, true, undefined, this),
|
|
150
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
151
|
-
className: "border-border bg-card rounded-lg border",
|
|
152
|
-
children: [
|
|
153
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
154
|
-
className: "border-border flex items-center justify-between border-b px-4 py-3",
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ jsxDEV("h2", {
|
|
157
|
-
className: "text-sm font-semibold tracking-widest uppercase",
|
|
158
|
-
children: "Resource Tree"
|
|
159
|
-
}, undefined, false, undefined, this),
|
|
160
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
161
|
-
className: "text-text-muted text-xs",
|
|
162
|
-
children: [
|
|
163
|
-
totalResources,
|
|
164
|
-
" resources"
|
|
165
|
-
]
|
|
166
|
-
}, undefined, true, undefined, this)
|
|
167
|
-
]
|
|
168
|
-
}, undefined, true, undefined, this),
|
|
169
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
170
|
-
className: "divide-border divide-y",
|
|
171
|
-
children: [
|
|
172
|
-
groups.map((g) => /* @__PURE__ */ jsxDEV("div", {
|
|
173
|
-
className: "px-4 py-3",
|
|
174
|
-
children: [
|
|
175
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
176
|
-
className: "text-xs font-semibold tracking-widest uppercase text-form-label",
|
|
177
|
-
children: g.name
|
|
178
|
-
}, undefined, false, undefined, this),
|
|
179
|
-
/* @__PURE__ */ jsxDEV("ul", {
|
|
180
|
-
className: "mt-2 flex flex-wrap gap-2",
|
|
181
|
-
children: g.items.map((it) => /* @__PURE__ */ jsxDEV("li", {
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ jsxDEV("a", {
|
|
184
|
-
href: it.href,
|
|
185
|
-
className: "bg-secondary text-secondary-foreground inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium hover:underline",
|
|
186
|
-
children: [
|
|
187
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
188
|
-
children: it.icon ?? "•"
|
|
189
|
-
}, undefined, false, undefined, this),
|
|
190
|
-
" ",
|
|
191
|
-
it.label
|
|
192
|
-
]
|
|
193
|
-
}, undefined, true, undefined, this),
|
|
194
|
-
(it.children?.length ?? 0) > 0 && /* @__PURE__ */ jsxDEV("span", {
|
|
195
|
-
className: "text-text-muted ml-1 text-xs",
|
|
196
|
-
children: [
|
|
197
|
-
"+",
|
|
198
|
-
it.children?.length ?? 0,
|
|
199
|
-
" child"
|
|
200
|
-
]
|
|
201
|
-
}, undefined, true, undefined, this)
|
|
202
|
-
]
|
|
203
|
-
}, it.id, true, undefined, this))
|
|
204
|
-
}, undefined, false, undefined, this)
|
|
205
|
-
]
|
|
206
|
-
}, g.name, true, undefined, this)),
|
|
207
|
-
groups.length === 0 && /* @__PURE__ */ jsxDEV("p", {
|
|
208
|
-
className: "text-text-muted px-4 py-6 text-center text-sm",
|
|
209
|
-
children: "Belum ada resource terdaftar — pastikan rack() sudah dipanggil sebelum dashboard render."
|
|
210
|
-
}, undefined, false, undefined, this)
|
|
211
|
-
]
|
|
212
|
-
}, undefined, true, undefined, this)
|
|
213
|
-
]
|
|
214
|
-
}, undefined, true, undefined, this),
|
|
215
|
-
/* @__PURE__ */ jsxDEV("footer", {
|
|
216
|
-
className: "border-border text-text-muted mt-6 border-t pt-3 text-center text-xs tracking-widest uppercase",
|
|
217
|
-
children: [
|
|
218
|
-
donate.enabled ? /* @__PURE__ */ jsxDEV(Fragment, {
|
|
219
|
-
children: [
|
|
220
|
-
/* @__PURE__ */ jsxDEV("a", {
|
|
221
|
-
href: donate.url,
|
|
222
|
-
target: "_blank",
|
|
223
|
-
rel: "noopener noreferrer",
|
|
224
|
-
className: "hover:text-foreground underline decoration-dotted underline-offset-4",
|
|
225
|
-
children: [
|
|
226
|
-
donate.label,
|
|
227
|
-
" — ",
|
|
228
|
-
donate.url.replace("https://", "")
|
|
229
|
-
]
|
|
230
|
-
}, undefined, true, undefined, this),
|
|
231
|
-
" ·",
|
|
232
|
-
" "
|
|
233
|
-
]
|
|
234
|
-
}, undefined, true, undefined, this) : null,
|
|
235
|
-
"Printed by elysia-rack — ERP blueprint"
|
|
236
|
-
]
|
|
237
|
-
}, undefined, true, undefined, this)
|
|
238
|
-
]
|
|
239
|
-
}, undefined, true, undefined, this)
|
|
240
|
-
]
|
|
241
|
-
}, undefined, true, undefined, this)
|
|
242
|
-
]
|
|
243
|
-
}, undefined, true, undefined, this)
|
|
244
|
-
}, undefined, false, undefined, this);
|
|
245
|
-
}
|
|
246
|
-
export {
|
|
247
|
-
Dashboard as default
|
|
248
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import"./index-37x76zdn.js";
|
|
2
|
-
|
|
3
|
-
// src/react/page/Dashboard.tsx
|
|
4
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
|
-
async function Dashboard(props) {
|
|
6
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
7
|
-
className: "koran-paper font-koran-body text-foreground flex min-h-screen items-center justify-center p-6",
|
|
8
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
9
|
-
className: "bg-card border-border max-w-lg rounded-xl border px-8 py-12 text-center shadow-sm",
|
|
10
|
-
children: [
|
|
11
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
12
|
-
className: "text-text-muted text-xs font-semibold tracking-widest uppercase",
|
|
13
|
-
children: "Dashboard"
|
|
14
|
-
}, undefined, false, undefined, this),
|
|
15
|
-
/* @__PURE__ */ jsxDEV("h1", {
|
|
16
|
-
className: "font-koran mt-2 text-4xl font-black tracking-tight",
|
|
17
|
-
children: "Coming Soon"
|
|
18
|
-
}, undefined, false, undefined, this),
|
|
19
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
20
|
-
className: "text-text-muted mt-3 text-sm leading-relaxed",
|
|
21
|
-
children: [
|
|
22
|
-
props.name ? `${props.name} — ` : "",
|
|
23
|
-
"This dashboard is coming soon. Your panels are available via the sidebar in each resource view."
|
|
24
|
-
]
|
|
25
|
-
}, undefined, true, undefined, this),
|
|
26
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
27
|
-
className: "mt-6 flex justify-center",
|
|
28
|
-
children: /* @__PURE__ */ jsxDEV("span", {
|
|
29
|
-
className: "bg-primary text-primary-foreground rounded-md px-4 py-1.5 text-sm font-semibold",
|
|
30
|
-
children: "Stay tuned"
|
|
31
|
-
}, undefined, false, undefined, this)
|
|
32
|
-
}, undefined, false, undefined, this)
|
|
33
|
-
]
|
|
34
|
-
}, undefined, true, undefined, this)
|
|
35
|
-
}, undefined, false, undefined, this);
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
Dashboard as default
|
|
39
|
-
};
|