@alepha/devtools 0.16.0 → 0.19.1
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 +1 -5
- package/dist/index.browser.js +224 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.ts +349 -321
- package/dist/index.js +293 -186
- package/dist/index.js.map +1 -1
- package/package.json +30 -23
- package/src/assets.ts +6 -0
- package/src/{api/entities → entities}/logs.ts +2 -2
- package/src/index.browser.ts +11 -0
- package/src/index.shared.ts +15 -0
- package/src/index.ts +11 -37
- package/src/{api/providers → providers}/DevToolsMetadataProvider.ts +84 -47
- package/src/providers/DevToolsProvider.ts +280 -0
- package/src/{api/schemas → schemas}/DevActionMetadata.ts +8 -0
- package/src/{api/schemas → schemas}/DevEntityMetadata.ts +3 -0
- package/src/{api/schemas → schemas}/DevMetadata.ts +13 -2
- package/src/{api/schemas → schemas}/DevPageMetadata.ts +3 -0
- package/src/{api/schemas → schemas}/DevTopicMetadata.ts +1 -0
- package/src/ui/AppRouter.tsx +55 -59
- package/src/ui/components/DevLayout.tsx +104 -84
- package/src/ui/components/configuration/ConfigAtoms.page.tsx +5 -0
- package/src/ui/components/configuration/ConfigAtoms.tsx +511 -0
- package/src/ui/components/configuration/ConfigEnv.page.tsx +5 -0
- package/src/ui/components/configuration/ConfigEnv.tsx +230 -0
- package/src/ui/components/configuration/DevConfiguration.tsx +36 -0
- package/src/ui/components/configuration/index.ts +3 -0
- package/src/ui/components/dashboard/DevDashboard.tsx +482 -0
- package/src/ui/components/database/DatabaseEditor.page.tsx +23 -0
- package/src/ui/components/database/DatabaseEditor.tsx +399 -0
- package/src/ui/components/database/DatabaseErd.page.tsx +28 -0
- package/src/ui/components/database/DatabaseErd.tsx +107 -0
- package/src/ui/components/database/DevDatabase.tsx +36 -0
- package/src/ui/components/database/EntityNode.tsx +83 -0
- package/src/ui/components/explorer/DevExplorer.tsx +351 -0
- package/src/ui/components/explorer/ExplorerTree.tsx +178 -0
- package/src/ui/components/explorer/panels/DevPanelAction.tsx +499 -0
- package/src/ui/components/explorer/panels/DevPanelCache.tsx +73 -0
- package/src/ui/components/explorer/panels/DevPanelPage.tsx +96 -0
- package/src/ui/components/explorer/panels/DevPanelQueue.tsx +51 -0
- package/src/ui/components/explorer/panels/DevPanelTopic.tsx +56 -0
- package/src/ui/components/explorer/panels/index.ts +5 -0
- package/src/ui/components/graph/DevDependencyGraph.tsx +35 -60
- package/src/ui/components/graph/GraphControls.tsx +10 -11
- package/src/ui/components/graph/NodeDetails.tsx +22 -29
- package/src/ui/components/graph/ProviderNode.tsx +4 -4
- package/src/ui/components/graph/helpers.ts +1 -1
- package/src/ui/components/logs/DevLogs.tsx +661 -0
- package/src/ui/components/logs/index.ts +1 -0
- package/src/ui/components/shared/TreeView.tsx +189 -0
- package/src/ui/main.css +17 -0
- package/src/ui/main.ts +2 -6
- package/LICENSE +0 -21
- package/assets/devtools/actions.html +0 -21
- package/assets/devtools/actions.html.br +0 -0
- package/assets/devtools/actions.html.gz +0 -0
- package/assets/devtools/asset.BJSLFcNT.css +0 -1
- package/assets/devtools/asset.BJSLFcNT.css.br +0 -0
- package/assets/devtools/asset.BJSLFcNT.css.gz +0 -0
- package/assets/devtools/asset.BZV40eAE.css +0 -1
- package/assets/devtools/asset.BZV40eAE.css.br +0 -0
- package/assets/devtools/asset.BZV40eAE.css.gz +0 -0
- package/assets/devtools/atoms.html +0 -21
- package/assets/devtools/atoms.html.br +0 -0
- package/assets/devtools/atoms.html.gz +0 -0
- package/assets/devtools/caches.html +0 -21
- package/assets/devtools/caches.html.br +0 -0
- package/assets/devtools/caches.html.gz +0 -0
- package/assets/devtools/chunk.1h5GuATm.js +0 -1
- package/assets/devtools/chunk.1h5GuATm.js.br +0 -0
- package/assets/devtools/chunk.1h5GuATm.js.gz +0 -0
- package/assets/devtools/chunk.3PgxxOdM.js +0 -1
- package/assets/devtools/chunk.3PgxxOdM.js.br +0 -0
- package/assets/devtools/chunk.3PgxxOdM.js.gz +0 -0
- package/assets/devtools/chunk.A_W3H6Aa.js +0 -1
- package/assets/devtools/chunk.A_W3H6Aa.js.br +0 -0
- package/assets/devtools/chunk.A_W3H6Aa.js.gz +0 -0
- package/assets/devtools/chunk.B5tL0VjH.js +0 -1
- package/assets/devtools/chunk.B5tL0VjH.js.br +0 -0
- package/assets/devtools/chunk.B5tL0VjH.js.gz +0 -0
- package/assets/devtools/chunk.B8p_Szro.js +0 -1
- package/assets/devtools/chunk.B8p_Szro.js.br +0 -0
- package/assets/devtools/chunk.B8p_Szro.js.gz +0 -0
- package/assets/devtools/chunk.BANy8c2v.js +0 -1
- package/assets/devtools/chunk.BANy8c2v.js.br +0 -0
- package/assets/devtools/chunk.BANy8c2v.js.gz +0 -0
- package/assets/devtools/chunk.BKph0hv1.js +0 -1
- package/assets/devtools/chunk.BKph0hv1.js.br +0 -0
- package/assets/devtools/chunk.BKph0hv1.js.gz +0 -0
- package/assets/devtools/chunk.BUs1kuwE.js +0 -1
- package/assets/devtools/chunk.BUs1kuwE.js.br +0 -0
- package/assets/devtools/chunk.BUs1kuwE.js.gz +0 -0
- package/assets/devtools/chunk.BVIEr21R.js +0 -1
- package/assets/devtools/chunk.BVIEr21R.js.br +0 -0
- package/assets/devtools/chunk.BVIEr21R.js.gz +0 -0
- package/assets/devtools/chunk.Bb3re2d8.js +0 -1
- package/assets/devtools/chunk.Bb3re2d8.js.br +0 -2
- package/assets/devtools/chunk.Bb3re2d8.js.gz +0 -0
- package/assets/devtools/chunk.BjFrJKj1.js +0 -1
- package/assets/devtools/chunk.BjFrJKj1.js.br +0 -2
- package/assets/devtools/chunk.BjFrJKj1.js.gz +0 -0
- package/assets/devtools/chunk.BkXzz14p.js +0 -1
- package/assets/devtools/chunk.BkXzz14p.js.br +0 -0
- package/assets/devtools/chunk.BkXzz14p.js.gz +0 -0
- package/assets/devtools/chunk.BlqFPyLh.js +0 -1
- package/assets/devtools/chunk.BlqFPyLh.js.br +0 -0
- package/assets/devtools/chunk.BlqFPyLh.js.gz +0 -0
- package/assets/devtools/chunk.BymZ9jU5.js +0 -1
- package/assets/devtools/chunk.BymZ9jU5.js.br +0 -0
- package/assets/devtools/chunk.BymZ9jU5.js.gz +0 -0
- package/assets/devtools/chunk.C0BD3Ujz.js +0 -1
- package/assets/devtools/chunk.C0BD3Ujz.js.br +0 -0
- package/assets/devtools/chunk.C0BD3Ujz.js.gz +0 -0
- package/assets/devtools/chunk.C63rzhbT.js +0 -1
- package/assets/devtools/chunk.C63rzhbT.js.br +0 -0
- package/assets/devtools/chunk.C63rzhbT.js.gz +0 -0
- package/assets/devtools/chunk.CJrYVzjN.js +0 -9
- package/assets/devtools/chunk.CJrYVzjN.js.br +0 -0
- package/assets/devtools/chunk.CJrYVzjN.js.gz +0 -0
- package/assets/devtools/chunk.CPGX3Xpx.js +0 -1
- package/assets/devtools/chunk.CPGX3Xpx.js.br +0 -1
- package/assets/devtools/chunk.CPGX3Xpx.js.gz +0 -0
- package/assets/devtools/chunk.Cf-3skUw.js +0 -1
- package/assets/devtools/chunk.Cf-3skUw.js.br +0 -0
- package/assets/devtools/chunk.Cf-3skUw.js.gz +0 -0
- package/assets/devtools/chunk.D7JLxcoJ.js +0 -7
- package/assets/devtools/chunk.D7JLxcoJ.js.br +0 -0
- package/assets/devtools/chunk.D7JLxcoJ.js.gz +0 -0
- package/assets/devtools/chunk.D7e5mBY4.js +0 -1
- package/assets/devtools/chunk.D7e5mBY4.js.br +0 -0
- package/assets/devtools/chunk.D7e5mBY4.js.gz +0 -0
- package/assets/devtools/chunk.DClU9Z1_.js +0 -1
- package/assets/devtools/chunk.DClU9Z1_.js.br +0 -0
- package/assets/devtools/chunk.DClU9Z1_.js.gz +0 -0
- package/assets/devtools/chunk.DE_M8b3Z.js +0 -1
- package/assets/devtools/chunk.DE_M8b3Z.js.br +0 -0
- package/assets/devtools/chunk.DE_M8b3Z.js.gz +0 -0
- package/assets/devtools/chunk.DWASJDBE.js +0 -1
- package/assets/devtools/chunk.DWASJDBE.js.br +0 -0
- package/assets/devtools/chunk.DWASJDBE.js.gz +0 -0
- package/assets/devtools/chunk.DfzRLqwW.js +0 -1
- package/assets/devtools/chunk.DfzRLqwW.js.br +0 -0
- package/assets/devtools/chunk.DfzRLqwW.js.gz +0 -0
- package/assets/devtools/chunk.Dww1YQtc.js +0 -1
- package/assets/devtools/chunk.Dww1YQtc.js.br +0 -0
- package/assets/devtools/chunk.Dww1YQtc.js.gz +0 -0
- package/assets/devtools/chunk.HFLdduaf.js +0 -1
- package/assets/devtools/chunk.HFLdduaf.js.br +0 -0
- package/assets/devtools/chunk.HFLdduaf.js.gz +0 -0
- package/assets/devtools/chunk.J-htqECs.js +0 -1
- package/assets/devtools/chunk.J-htqECs.js.br +0 -2
- package/assets/devtools/chunk.J-htqECs.js.gz +0 -0
- package/assets/devtools/chunk.JjTGVewZ.js +0 -2
- package/assets/devtools/chunk.JjTGVewZ.js.br +0 -0
- package/assets/devtools/chunk.JjTGVewZ.js.gz +0 -0
- package/assets/devtools/chunk.OV_89czZ.js +0 -1
- package/assets/devtools/chunk.OV_89czZ.js.br +0 -0
- package/assets/devtools/chunk.OV_89czZ.js.gz +0 -0
- package/assets/devtools/chunk.YFkMUqFM.js +0 -1
- package/assets/devtools/chunk.YFkMUqFM.js.br +0 -0
- package/assets/devtools/chunk.YFkMUqFM.js.gz +0 -0
- package/assets/devtools/chunk._KdUFIrt.js +0 -1
- package/assets/devtools/chunk._KdUFIrt.js.br +0 -0
- package/assets/devtools/chunk._KdUFIrt.js.gz +0 -0
- package/assets/devtools/chunk.pjP6xqG8.js +0 -1
- package/assets/devtools/chunk.pjP6xqG8.js.br +0 -0
- package/assets/devtools/chunk.pjP6xqG8.js.gz +0 -0
- package/assets/devtools/chunk.uTFtY0ae.js +0 -2
- package/assets/devtools/chunk.uTFtY0ae.js.br +0 -0
- package/assets/devtools/chunk.uTFtY0ae.js.gz +0 -0
- package/assets/devtools/chunk.uyVen0u2.js +0 -1
- package/assets/devtools/chunk.uyVen0u2.js.br +0 -0
- package/assets/devtools/chunk.uyVen0u2.js.gz +0 -0
- package/assets/devtools/chunk.vHjNjQS8.js +0 -1
- package/assets/devtools/chunk.vHjNjQS8.js.br +0 -0
- package/assets/devtools/chunk.vHjNjQS8.js.gz +0 -0
- package/assets/devtools/db.html +0 -21
- package/assets/devtools/db.html.br +0 -0
- package/assets/devtools/db.html.gz +0 -0
- package/assets/devtools/entry.DhzNl8q_.js +0 -79
- package/assets/devtools/entry.DhzNl8q_.js.br +0 -0
- package/assets/devtools/entry.DhzNl8q_.js.gz +0 -0
- package/assets/devtools/env.html +0 -21
- package/assets/devtools/env.html.br +0 -0
- package/assets/devtools/env.html.gz +0 -0
- package/assets/devtools/graph.html +0 -22
- package/assets/devtools/graph.html.br +0 -0
- package/assets/devtools/graph.html.gz +0 -0
- package/assets/devtools/index.html +0 -21
- package/assets/devtools/index.html.br +0 -0
- package/assets/devtools/index.html.gz +0 -0
- package/assets/devtools/logs.html +0 -21
- package/assets/devtools/logs.html.br +0 -0
- package/assets/devtools/logs.html.gz +0 -0
- package/assets/devtools/queues.html +0 -21
- package/assets/devtools/queues.html.br +0 -0
- package/assets/devtools/queues.html.gz +0 -0
- package/assets/devtools/topics.html +0 -21
- package/assets/devtools/topics.html.br +0 -0
- package/assets/devtools/topics.html.gz +0 -0
- package/src/api/DevToolsProvider.ts +0 -157
- package/src/api/providers/DevToolsDatabaseProvider.ts +0 -27
- package/src/api/repositories/LogRepository.ts +0 -8
- package/src/api/schemas/DevCommandMetadata.ts +0 -9
- package/src/ui/components/DevAtomsViewer.tsx +0 -637
- package/src/ui/components/DevCacheInspector.tsx +0 -423
- package/src/ui/components/DevDashboard.tsx +0 -38
- package/src/ui/components/DevEnvExplorer.tsx +0 -462
- package/src/ui/components/DevLogViewer.tsx +0 -252
- package/src/ui/components/DevQueueMonitor.tsx +0 -51
- package/src/ui/components/DevTopicsViewer.tsx +0 -686
- package/src/ui/components/actions/ActionGroup.tsx +0 -37
- package/src/ui/components/actions/ActionItem.tsx +0 -138
- package/src/ui/components/actions/DevActionsExplorer.tsx +0 -132
- package/src/ui/components/actions/MethodBadge.tsx +0 -18
- package/src/ui/components/actions/SchemaViewer.tsx +0 -21
- package/src/ui/components/actions/TryItPanel.tsx +0 -140
- package/src/ui/components/actions/constants.ts +0 -7
- package/src/ui/components/actions/helpers.ts +0 -18
- package/src/ui/components/actions/index.ts +0 -8
- package/src/ui/components/db/ColumnBadge.tsx +0 -55
- package/src/ui/components/db/DevDbStudio.tsx +0 -485
- package/src/ui/components/db/constants.ts +0 -11
- package/src/ui/components/db/index.ts +0 -4
- package/src/ui/components/db/types.ts +0 -7
- package/src/ui/styles.css +0 -1
- /package/src/{api/schemas → schemas}/DevAtomMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevBucketMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevCacheMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevEnvMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevModuleMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevProviderMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevQueueMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevRealmMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevRouteMetadata.ts +0 -0
- /package/src/{api/schemas → schemas}/DevSchedulerMetadata.ts +0 -0
package/src/ui/AppRouter.tsx
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { $ui, midnightTheme } from "@alepha/ui";
|
|
2
2
|
import {
|
|
3
|
-
IconApi,
|
|
4
|
-
IconArchive,
|
|
5
|
-
IconAtom,
|
|
6
3
|
IconDashboard,
|
|
7
4
|
IconDatabase,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
IconList,
|
|
6
|
+
IconSettings,
|
|
7
|
+
IconSitemap,
|
|
11
8
|
IconTopologyRing,
|
|
12
|
-
IconVariable,
|
|
13
9
|
} from "@tabler/icons-react";
|
|
14
10
|
import { $page } from "alepha/react/router";
|
|
15
11
|
|
|
@@ -27,79 +23,80 @@ export class AppRouter {
|
|
|
27
23
|
path: "/",
|
|
28
24
|
label: "Dashboard",
|
|
29
25
|
icon: <IconDashboard />,
|
|
30
|
-
static: true,
|
|
31
26
|
parent: this.layout,
|
|
32
|
-
lazy: () => import("./components/DevDashboard.tsx"),
|
|
27
|
+
lazy: () => import("./components/dashboard/DevDashboard.tsx"),
|
|
33
28
|
});
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
path: "/
|
|
37
|
-
label: "
|
|
38
|
-
icon: <
|
|
39
|
-
static: true,
|
|
30
|
+
explorer = $page({
|
|
31
|
+
path: "/explorer",
|
|
32
|
+
label: "Explorer",
|
|
33
|
+
icon: <IconSitemap />,
|
|
40
34
|
parent: this.layout,
|
|
41
|
-
lazy: () => import("./components/
|
|
35
|
+
lazy: () => import("./components/explorer/DevExplorer.tsx"),
|
|
42
36
|
});
|
|
43
37
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
icon: <IconStack2 />,
|
|
48
|
-
static: true,
|
|
38
|
+
// Database parent (tabs + NestedView)
|
|
39
|
+
db = $page({
|
|
40
|
+
path: "/db",
|
|
49
41
|
parent: this.layout,
|
|
50
|
-
lazy: () => import("./components/
|
|
42
|
+
lazy: () => import("./components/database/DevDatabase.tsx"),
|
|
51
43
|
});
|
|
52
44
|
|
|
53
|
-
|
|
54
|
-
path: "/
|
|
55
|
-
label: "
|
|
56
|
-
icon: <
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
lazy: () => import("./components/DevTopicsViewer.tsx"),
|
|
45
|
+
dbErd = $page({
|
|
46
|
+
path: "/erd",
|
|
47
|
+
label: "Database",
|
|
48
|
+
icon: <IconDatabase />,
|
|
49
|
+
parent: this.db,
|
|
50
|
+
lazy: () => import("./components/database/DatabaseErd.page.tsx"),
|
|
60
51
|
});
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
path: "/
|
|
64
|
-
label: "
|
|
65
|
-
icon: <
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
lazy: () => import("./components/DevCacheInspector.tsx"),
|
|
53
|
+
dbEditor = $page({
|
|
54
|
+
path: "/editor",
|
|
55
|
+
label: "Database",
|
|
56
|
+
icon: <IconDatabase />,
|
|
57
|
+
parent: this.db,
|
|
58
|
+
lazy: () => import("./components/database/DatabaseEditor.page.tsx"),
|
|
69
59
|
});
|
|
70
60
|
|
|
71
|
-
|
|
72
|
-
path: "/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
static: true,
|
|
76
|
-
parent: this.layout,
|
|
77
|
-
lazy: () => import("./components/DevEnvExplorer.tsx"),
|
|
61
|
+
dbEditorTable = $page({
|
|
62
|
+
path: "/editor/:table",
|
|
63
|
+
parent: this.db,
|
|
64
|
+
lazy: () => import("./components/database/DatabaseEditor.page.tsx"),
|
|
78
65
|
});
|
|
79
66
|
|
|
80
|
-
|
|
81
|
-
path: "/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
static: true,
|
|
85
|
-
parent: this.layout,
|
|
86
|
-
lazy: () => import("./components/DevAtomsViewer.tsx"),
|
|
67
|
+
dbEditorRecord = $page({
|
|
68
|
+
path: "/editor/:table/:id",
|
|
69
|
+
parent: this.db,
|
|
70
|
+
lazy: () => import("./components/database/DatabaseEditor.page.tsx"),
|
|
87
71
|
});
|
|
88
72
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
icon: <IconDatabase />,
|
|
93
|
-
static: true,
|
|
73
|
+
// Configuration parent (tabs + NestedView)
|
|
74
|
+
conf = $page({
|
|
75
|
+
path: "/conf",
|
|
94
76
|
parent: this.layout,
|
|
95
|
-
lazy: () => import("./components/
|
|
77
|
+
lazy: () => import("./components/configuration/DevConfiguration.tsx"),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
confEnv = $page({
|
|
81
|
+
path: "/env",
|
|
82
|
+
label: "Configuration",
|
|
83
|
+
icon: <IconSettings />,
|
|
84
|
+
parent: this.conf,
|
|
85
|
+
lazy: () => import("./components/configuration/ConfigEnv.page.tsx"),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
confAtoms = $page({
|
|
89
|
+
path: "/atoms",
|
|
90
|
+
label: "Configuration",
|
|
91
|
+
icon: <IconSettings />,
|
|
92
|
+
parent: this.conf,
|
|
93
|
+
lazy: () => import("./components/configuration/ConfigAtoms.page.tsx"),
|
|
96
94
|
});
|
|
97
95
|
|
|
98
96
|
graph = $page({
|
|
99
97
|
path: "/graph",
|
|
100
98
|
label: "Graph",
|
|
101
99
|
icon: <IconTopologyRing />,
|
|
102
|
-
static: true,
|
|
103
100
|
parent: this.layout,
|
|
104
101
|
lazy: () => import("./components/graph/DevDependencyGraph.tsx"),
|
|
105
102
|
});
|
|
@@ -107,9 +104,8 @@ export class AppRouter {
|
|
|
107
104
|
logs = $page({
|
|
108
105
|
path: "/logs",
|
|
109
106
|
label: "Logs",
|
|
110
|
-
icon: <
|
|
111
|
-
static: true,
|
|
107
|
+
icon: <IconList />,
|
|
112
108
|
parent: this.layout,
|
|
113
|
-
lazy: () => import("./components/
|
|
109
|
+
lazy: () => import("./components/logs/DevLogs.tsx"),
|
|
114
110
|
});
|
|
115
111
|
}
|
|
@@ -1,101 +1,121 @@
|
|
|
1
|
-
import { AdminShell, DarkModeButton, OmnibarButton, ui } from "@alepha/ui";
|
|
2
|
-
import { Flex } from "@mantine/core";
|
|
3
1
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
ActionButton,
|
|
3
|
+
DarkModeButton,
|
|
4
|
+
DashboardShell,
|
|
5
|
+
Flex,
|
|
6
|
+
OmnibarButton,
|
|
7
|
+
} from "@alepha/ui";
|
|
8
|
+
import {
|
|
9
|
+
IconArrowLeft,
|
|
7
10
|
IconDashboard,
|
|
8
11
|
IconDatabase,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
IconList,
|
|
13
|
+
IconSettings,
|
|
14
|
+
IconSitemap,
|
|
12
15
|
IconTopologyRing,
|
|
13
|
-
IconVariable,
|
|
14
16
|
} from "@tabler/icons-react";
|
|
17
|
+
import { useInject } from "alepha/react";
|
|
18
|
+
import { HttpClient } from "alepha/server";
|
|
19
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
20
|
+
import { devMetadataSchema } from "../../schemas/DevMetadata.ts";
|
|
15
21
|
|
|
16
22
|
export const DevLayout = () => {
|
|
23
|
+
const http = useInject(HttpClient);
|
|
24
|
+
const [entityCount, setEntityCount] = useState<number | null>(null);
|
|
25
|
+
|
|
26
|
+
const fetchMetadata = useCallback(async () => {
|
|
27
|
+
try {
|
|
28
|
+
const res = await http.fetch("/__devtools/api/metadata", {
|
|
29
|
+
schema: { response: devMetadataSchema },
|
|
30
|
+
});
|
|
31
|
+
setEntityCount(res.data.entities?.length ?? 0);
|
|
32
|
+
} catch {
|
|
33
|
+
// silently fail
|
|
34
|
+
}
|
|
35
|
+
}, [http]);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
fetchMetadata();
|
|
39
|
+
}, [fetchMetadata]);
|
|
40
|
+
|
|
41
|
+
const sidebarItems = useMemo(() => {
|
|
42
|
+
const items: any[] = [
|
|
43
|
+
{
|
|
44
|
+
label: "Dashboard",
|
|
45
|
+
icon: <IconDashboard />,
|
|
46
|
+
href: "/",
|
|
47
|
+
},
|
|
48
|
+
{ type: "divider" },
|
|
49
|
+
{
|
|
50
|
+
label: "Explorer",
|
|
51
|
+
icon: <IconSitemap />,
|
|
52
|
+
href: "/explorer",
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
if (entityCount === null || entityCount > 0) {
|
|
57
|
+
items.push({
|
|
58
|
+
label: "Database",
|
|
59
|
+
icon: <IconDatabase />,
|
|
60
|
+
href: "/db/erd",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
items.push(
|
|
65
|
+
{
|
|
66
|
+
label: "Configuration",
|
|
67
|
+
icon: <IconSettings />,
|
|
68
|
+
href: "/conf/env",
|
|
69
|
+
},
|
|
70
|
+
{ type: "divider" },
|
|
71
|
+
{
|
|
72
|
+
label: "Graph",
|
|
73
|
+
icon: <IconTopologyRing />,
|
|
74
|
+
href: "/graph",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "Logs",
|
|
78
|
+
icon: <IconList />,
|
|
79
|
+
href: "/logs",
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return items;
|
|
84
|
+
}, [entityCount]);
|
|
85
|
+
|
|
17
86
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
87
|
+
<DashboardShell
|
|
88
|
+
layout={"alt"}
|
|
89
|
+
appShellMainProps={{
|
|
90
|
+
style: {
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
},
|
|
21
94
|
}}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
95
|
+
footer={<Flex />}
|
|
96
|
+
navbarFooter={<Flex />}
|
|
97
|
+
footerHeight={24}
|
|
98
|
+
headerHeight={60}
|
|
99
|
+
navbarHeader={() => (
|
|
100
|
+
<Flex align="center" justify="center" h="100%" w="100%">
|
|
101
|
+
<ActionButton
|
|
102
|
+
href="/"
|
|
103
|
+
target="_self"
|
|
104
|
+
variant="subtle"
|
|
105
|
+
color="gray"
|
|
106
|
+
size="sm"
|
|
107
|
+
>
|
|
108
|
+
<IconArrowLeft size={18} />
|
|
109
|
+
</ActionButton>
|
|
110
|
+
</Flex>
|
|
111
|
+
)}
|
|
26
112
|
sidebarProps={{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
label: "Dashboard",
|
|
30
|
-
icon: <IconDashboard />,
|
|
31
|
-
href: "/",
|
|
32
|
-
},
|
|
33
|
-
{ type: "divider" },
|
|
34
|
-
{
|
|
35
|
-
label: "Actions",
|
|
36
|
-
icon: <IconApi />,
|
|
37
|
-
href: "/actions",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "Queues",
|
|
41
|
-
icon: <IconStack2 />,
|
|
42
|
-
href: "/queues",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
label: "Topics",
|
|
46
|
-
icon: <IconMessageCircle />,
|
|
47
|
-
href: "/topics",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: "Caches",
|
|
51
|
-
icon: <IconArchive />,
|
|
52
|
-
href: "/caches",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: "DB Studio",
|
|
56
|
-
icon: <IconDatabase />,
|
|
57
|
-
href: "/db",
|
|
58
|
-
},
|
|
59
|
-
{ type: "divider" },
|
|
60
|
-
{
|
|
61
|
-
label: "Environment",
|
|
62
|
-
icon: <IconVariable />,
|
|
63
|
-
href: "/env",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: "Atoms",
|
|
67
|
-
icon: <IconAtom />,
|
|
68
|
-
href: "/atoms",
|
|
69
|
-
},
|
|
70
|
-
{ type: "divider" },
|
|
71
|
-
{
|
|
72
|
-
label: "Graph",
|
|
73
|
-
icon: <IconTopologyRing />,
|
|
74
|
-
href: "/graph",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: "Logs",
|
|
78
|
-
icon: <IconLogs />,
|
|
79
|
-
href: "/logs",
|
|
80
|
-
},
|
|
81
|
-
],
|
|
113
|
+
collapsed: true,
|
|
114
|
+
items: sidebarItems,
|
|
82
115
|
}}
|
|
83
116
|
appBarProps={{
|
|
84
117
|
items: [
|
|
85
118
|
{ position: "left", type: "burger" },
|
|
86
|
-
{
|
|
87
|
-
position: "left",
|
|
88
|
-
element: (
|
|
89
|
-
<Flex
|
|
90
|
-
h={"60px"}
|
|
91
|
-
w={"78px"}
|
|
92
|
-
style={{
|
|
93
|
-
marginLeft: "-32px",
|
|
94
|
-
borderRight: "1px solid var(--mantine-color-default-border)",
|
|
95
|
-
}}
|
|
96
|
-
/>
|
|
97
|
-
),
|
|
98
|
-
},
|
|
99
119
|
{
|
|
100
120
|
position: "left",
|
|
101
121
|
element: (
|