@alepha/devtools 0.16.1 → 0.19.2

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 (238) hide show
  1. package/README.md +1 -5
  2. package/dist/index.browser.js +224 -0
  3. package/dist/index.browser.js.map +1 -0
  4. package/dist/index.d.ts +351 -323
  5. package/dist/index.js +350 -186
  6. package/dist/index.js.map +1 -1
  7. package/package.json +33 -25
  8. package/src/assets.ts +6 -0
  9. package/src/{api/entities → entities}/logs.ts +2 -2
  10. package/src/index.browser.ts +11 -0
  11. package/src/index.shared.ts +15 -0
  12. package/src/index.ts +11 -37
  13. package/src/{api/providers → providers}/DevToolsMetadataProvider.ts +84 -47
  14. package/src/providers/DevToolsProvider.ts +394 -0
  15. package/src/{api/schemas → schemas}/DevActionMetadata.ts +8 -0
  16. package/src/{api/schemas → schemas}/DevEntityMetadata.ts +3 -0
  17. package/src/{api/schemas → schemas}/DevMetadata.ts +13 -2
  18. package/src/{api/schemas → schemas}/DevPageMetadata.ts +3 -0
  19. package/src/{api/schemas → schemas}/DevTopicMetadata.ts +1 -0
  20. package/src/ui/AppRouter.tsx +73 -59
  21. package/src/ui/components/DevLayout.tsx +103 -84
  22. package/src/ui/components/configuration/ConfigAtoms.page.tsx +5 -0
  23. package/src/ui/components/configuration/ConfigAtoms.tsx +511 -0
  24. package/src/ui/components/configuration/ConfigEnv.page.tsx +5 -0
  25. package/src/ui/components/configuration/ConfigEnv.tsx +230 -0
  26. package/src/ui/components/configuration/DevConfiguration.tsx +36 -0
  27. package/src/ui/components/configuration/index.ts +3 -0
  28. package/src/ui/components/dashboard/DevDashboard.tsx +501 -0
  29. package/src/ui/components/database/DatabaseEditor.page.tsx +23 -0
  30. package/src/ui/components/database/DatabaseEditor.tsx +402 -0
  31. package/src/ui/components/database/DatabaseErd.page.tsx +28 -0
  32. package/src/ui/components/database/DatabaseErd.tsx +107 -0
  33. package/src/ui/components/database/DevDatabase.tsx +36 -0
  34. package/src/ui/components/database/EntityNode.tsx +83 -0
  35. package/src/ui/components/emails/DevEmails.tsx +250 -0
  36. package/src/ui/components/explorer/DevExplorer.tsx +351 -0
  37. package/src/ui/components/explorer/ExplorerTree.tsx +178 -0
  38. package/src/ui/components/explorer/panels/DevPanelAction.tsx +499 -0
  39. package/src/ui/components/explorer/panels/DevPanelCache.tsx +73 -0
  40. package/src/ui/components/explorer/panels/DevPanelPage.tsx +96 -0
  41. package/src/ui/components/explorer/panels/DevPanelQueue.tsx +51 -0
  42. package/src/ui/components/explorer/panels/DevPanelTopic.tsx +56 -0
  43. package/src/ui/components/explorer/panels/index.ts +5 -0
  44. package/src/ui/components/graph/DevDependencyGraph.tsx +35 -60
  45. package/src/ui/components/graph/GraphControls.tsx +10 -11
  46. package/src/ui/components/graph/NodeDetails.tsx +22 -29
  47. package/src/ui/components/graph/ProviderNode.tsx +4 -4
  48. package/src/ui/components/graph/helpers.ts +1 -1
  49. package/src/ui/components/logs/DevLogs.tsx +661 -0
  50. package/src/ui/components/logs/index.ts +1 -0
  51. package/src/ui/components/shared/TreeView.tsx +189 -0
  52. package/src/ui/components/sms/DevSms.tsx +225 -0
  53. package/src/ui/main.css +17 -0
  54. package/src/ui/main.ts +2 -6
  55. package/LICENSE +0 -21
  56. package/assets/devtools/actions.html +0 -21
  57. package/assets/devtools/actions.html.br +0 -0
  58. package/assets/devtools/actions.html.gz +0 -0
  59. package/assets/devtools/asset.BZV40eAE.css +0 -1
  60. package/assets/devtools/asset.BZV40eAE.css.br +0 -0
  61. package/assets/devtools/asset.BZV40eAE.css.gz +0 -0
  62. package/assets/devtools/asset.CBnMq2vO.css +0 -1
  63. package/assets/devtools/asset.CBnMq2vO.css.br +0 -0
  64. package/assets/devtools/asset.CBnMq2vO.css.gz +0 -0
  65. package/assets/devtools/atoms.html +0 -21
  66. package/assets/devtools/atoms.html.br +0 -0
  67. package/assets/devtools/atoms.html.gz +0 -0
  68. package/assets/devtools/caches.html +0 -21
  69. package/assets/devtools/caches.html.br +0 -0
  70. package/assets/devtools/caches.html.gz +0 -0
  71. package/assets/devtools/chunk.6INqNjF0.js +0 -1
  72. package/assets/devtools/chunk.6INqNjF0.js.br +0 -0
  73. package/assets/devtools/chunk.6INqNjF0.js.gz +0 -0
  74. package/assets/devtools/chunk.9vpWpXSF.js +0 -1
  75. package/assets/devtools/chunk.9vpWpXSF.js.br +0 -0
  76. package/assets/devtools/chunk.9vpWpXSF.js.gz +0 -0
  77. package/assets/devtools/chunk.B4peH6PS.js +0 -1
  78. package/assets/devtools/chunk.B4peH6PS.js.br +0 -0
  79. package/assets/devtools/chunk.B4peH6PS.js.gz +0 -0
  80. package/assets/devtools/chunk.B8CNjZzU.js +0 -1
  81. package/assets/devtools/chunk.B8CNjZzU.js.br +0 -0
  82. package/assets/devtools/chunk.B8CNjZzU.js.gz +0 -0
  83. package/assets/devtools/chunk.Bgd10SVI.js +0 -1
  84. package/assets/devtools/chunk.Bgd10SVI.js.br +0 -0
  85. package/assets/devtools/chunk.Bgd10SVI.js.gz +0 -0
  86. package/assets/devtools/chunk.BjFrJKj1.js +0 -1
  87. package/assets/devtools/chunk.BjFrJKj1.js.br +0 -2
  88. package/assets/devtools/chunk.BjFrJKj1.js.gz +0 -0
  89. package/assets/devtools/chunk.BlqFPyLh.js +0 -1
  90. package/assets/devtools/chunk.BlqFPyLh.js.br +0 -0
  91. package/assets/devtools/chunk.BlqFPyLh.js.gz +0 -0
  92. package/assets/devtools/chunk.BqBNmfN9.js +0 -1
  93. package/assets/devtools/chunk.BqBNmfN9.js.br +0 -0
  94. package/assets/devtools/chunk.BqBNmfN9.js.gz +0 -0
  95. package/assets/devtools/chunk.Bt0_vkJm.js +0 -2
  96. package/assets/devtools/chunk.Bt0_vkJm.js.br +0 -0
  97. package/assets/devtools/chunk.Bt0_vkJm.js.gz +0 -0
  98. package/assets/devtools/chunk.C3GuU4pz.js +0 -2
  99. package/assets/devtools/chunk.C3GuU4pz.js.br +0 -0
  100. package/assets/devtools/chunk.C3GuU4pz.js.gz +0 -0
  101. package/assets/devtools/chunk.CGwoN_Mo.js +0 -1
  102. package/assets/devtools/chunk.CGwoN_Mo.js.br +0 -0
  103. package/assets/devtools/chunk.CGwoN_Mo.js.gz +0 -0
  104. package/assets/devtools/chunk.CJCvhHA7.js +0 -1
  105. package/assets/devtools/chunk.CJCvhHA7.js.br +0 -2
  106. package/assets/devtools/chunk.CJCvhHA7.js.gz +0 -0
  107. package/assets/devtools/chunk.CKr2VE6v.js +0 -1
  108. package/assets/devtools/chunk.CKr2VE6v.js.br +0 -0
  109. package/assets/devtools/chunk.CKr2VE6v.js.gz +0 -0
  110. package/assets/devtools/chunk.CLvTwbkw.js +0 -1
  111. package/assets/devtools/chunk.CLvTwbkw.js.br +0 -0
  112. package/assets/devtools/chunk.CLvTwbkw.js.gz +0 -0
  113. package/assets/devtools/chunk.CR13dZhE.js +0 -7
  114. package/assets/devtools/chunk.CR13dZhE.js.br +0 -0
  115. package/assets/devtools/chunk.CR13dZhE.js.gz +0 -0
  116. package/assets/devtools/chunk.C_C-cVqs.js +0 -1
  117. package/assets/devtools/chunk.C_C-cVqs.js.br +0 -1
  118. package/assets/devtools/chunk.C_C-cVqs.js.gz +0 -0
  119. package/assets/devtools/chunk.CjevPbPy.js +0 -1
  120. package/assets/devtools/chunk.CjevPbPy.js.br +0 -0
  121. package/assets/devtools/chunk.CjevPbPy.js.gz +0 -0
  122. package/assets/devtools/chunk.CkNMZqAe.js +0 -1
  123. package/assets/devtools/chunk.CkNMZqAe.js.br +0 -0
  124. package/assets/devtools/chunk.CkNMZqAe.js.gz +0 -0
  125. package/assets/devtools/chunk.Cl1Mlnqx.js +0 -1
  126. package/assets/devtools/chunk.Cl1Mlnqx.js.br +0 -0
  127. package/assets/devtools/chunk.Cl1Mlnqx.js.gz +0 -0
  128. package/assets/devtools/chunk.CyY8OGdZ.js +0 -1
  129. package/assets/devtools/chunk.CyY8OGdZ.js.br +0 -0
  130. package/assets/devtools/chunk.CyY8OGdZ.js.gz +0 -0
  131. package/assets/devtools/chunk.Cyx9kLqD.js +0 -1
  132. package/assets/devtools/chunk.Cyx9kLqD.js.br +0 -0
  133. package/assets/devtools/chunk.Cyx9kLqD.js.gz +0 -0
  134. package/assets/devtools/chunk.D1MGgxUI.js +0 -1
  135. package/assets/devtools/chunk.D1MGgxUI.js.br +0 -0
  136. package/assets/devtools/chunk.D1MGgxUI.js.gz +0 -0
  137. package/assets/devtools/chunk.D5Ci-dwk.js +0 -1
  138. package/assets/devtools/chunk.D5Ci-dwk.js.br +0 -0
  139. package/assets/devtools/chunk.D5Ci-dwk.js.gz +0 -0
  140. package/assets/devtools/chunk.DFrWQW5x.js +0 -9
  141. package/assets/devtools/chunk.DFrWQW5x.js.br +0 -0
  142. package/assets/devtools/chunk.DFrWQW5x.js.gz +0 -0
  143. package/assets/devtools/chunk.DaVlli3f.js +0 -1
  144. package/assets/devtools/chunk.DaVlli3f.js.br +0 -0
  145. package/assets/devtools/chunk.DaVlli3f.js.gz +0 -0
  146. package/assets/devtools/chunk.DdyBCs50.js +0 -1
  147. package/assets/devtools/chunk.DdyBCs50.js.br +0 -0
  148. package/assets/devtools/chunk.DdyBCs50.js.gz +0 -0
  149. package/assets/devtools/chunk.Dl0THvrP.js +0 -1
  150. package/assets/devtools/chunk.Dl0THvrP.js.br +0 -0
  151. package/assets/devtools/chunk.Dl0THvrP.js.gz +0 -0
  152. package/assets/devtools/chunk.DwUNDm68.js +0 -1
  153. package/assets/devtools/chunk.DwUNDm68.js.br +0 -0
  154. package/assets/devtools/chunk.DwUNDm68.js.gz +0 -0
  155. package/assets/devtools/chunk.DzDkh4C6.js +0 -1
  156. package/assets/devtools/chunk.DzDkh4C6.js.br +0 -0
  157. package/assets/devtools/chunk.DzDkh4C6.js.gz +0 -0
  158. package/assets/devtools/chunk.QTExp4CY.js +0 -1
  159. package/assets/devtools/chunk.QTExp4CY.js.br +0 -0
  160. package/assets/devtools/chunk.QTExp4CY.js.gz +0 -0
  161. package/assets/devtools/chunk.ReCPcJln.js +0 -1
  162. package/assets/devtools/chunk.ReCPcJln.js.br +0 -0
  163. package/assets/devtools/chunk.ReCPcJln.js.gz +0 -0
  164. package/assets/devtools/chunk.UEhIKOMY.js +0 -1
  165. package/assets/devtools/chunk.UEhIKOMY.js.br +0 -0
  166. package/assets/devtools/chunk.UEhIKOMY.js.gz +0 -0
  167. package/assets/devtools/chunk.mWQqK3dU.js +0 -1
  168. package/assets/devtools/chunk.mWQqK3dU.js.br +0 -0
  169. package/assets/devtools/chunk.mWQqK3dU.js.gz +0 -0
  170. package/assets/devtools/chunk.uyVen0u2.js +0 -1
  171. package/assets/devtools/chunk.uyVen0u2.js.br +0 -0
  172. package/assets/devtools/chunk.uyVen0u2.js.gz +0 -0
  173. package/assets/devtools/chunk.yLRX_cUF.js +0 -1
  174. package/assets/devtools/chunk.yLRX_cUF.js.br +0 -0
  175. package/assets/devtools/chunk.yLRX_cUF.js.gz +0 -0
  176. package/assets/devtools/chunk.zuZxBYZg.js +0 -1
  177. package/assets/devtools/chunk.zuZxBYZg.js.br +0 -0
  178. package/assets/devtools/chunk.zuZxBYZg.js.gz +0 -0
  179. package/assets/devtools/db.html +0 -21
  180. package/assets/devtools/db.html.br +0 -0
  181. package/assets/devtools/db.html.gz +0 -0
  182. package/assets/devtools/entry.Cry3rxEI.js +0 -79
  183. package/assets/devtools/entry.Cry3rxEI.js.br +0 -0
  184. package/assets/devtools/entry.Cry3rxEI.js.gz +0 -0
  185. package/assets/devtools/env.html +0 -21
  186. package/assets/devtools/env.html.br +0 -0
  187. package/assets/devtools/env.html.gz +0 -0
  188. package/assets/devtools/graph.html +0 -22
  189. package/assets/devtools/graph.html.br +0 -0
  190. package/assets/devtools/graph.html.gz +0 -0
  191. package/assets/devtools/index.html +0 -21
  192. package/assets/devtools/index.html.br +0 -0
  193. package/assets/devtools/index.html.gz +0 -0
  194. package/assets/devtools/logs.html +0 -21
  195. package/assets/devtools/logs.html.br +0 -0
  196. package/assets/devtools/logs.html.gz +0 -0
  197. package/assets/devtools/queues.html +0 -21
  198. package/assets/devtools/queues.html.br +0 -0
  199. package/assets/devtools/queues.html.gz +0 -0
  200. package/assets/devtools/topics.html +0 -21
  201. package/assets/devtools/topics.html.br +0 -0
  202. package/assets/devtools/topics.html.gz +0 -0
  203. package/src/api/DevToolsProvider.ts +0 -157
  204. package/src/api/providers/DevToolsDatabaseProvider.ts +0 -27
  205. package/src/api/repositories/LogRepository.ts +0 -8
  206. package/src/api/schemas/DevCommandMetadata.ts +0 -9
  207. package/src/ui/components/DevAtomsViewer.tsx +0 -637
  208. package/src/ui/components/DevCacheInspector.tsx +0 -423
  209. package/src/ui/components/DevDashboard.tsx +0 -38
  210. package/src/ui/components/DevEnvExplorer.tsx +0 -462
  211. package/src/ui/components/DevLogViewer.tsx +0 -252
  212. package/src/ui/components/DevQueueMonitor.tsx +0 -51
  213. package/src/ui/components/DevTopicsViewer.tsx +0 -686
  214. package/src/ui/components/actions/ActionGroup.tsx +0 -37
  215. package/src/ui/components/actions/ActionItem.tsx +0 -138
  216. package/src/ui/components/actions/DevActionsExplorer.tsx +0 -132
  217. package/src/ui/components/actions/MethodBadge.tsx +0 -18
  218. package/src/ui/components/actions/SchemaViewer.tsx +0 -21
  219. package/src/ui/components/actions/TryItPanel.tsx +0 -140
  220. package/src/ui/components/actions/constants.ts +0 -7
  221. package/src/ui/components/actions/helpers.ts +0 -18
  222. package/src/ui/components/actions/index.ts +0 -8
  223. package/src/ui/components/db/ColumnBadge.tsx +0 -55
  224. package/src/ui/components/db/DevDbStudio.tsx +0 -485
  225. package/src/ui/components/db/constants.ts +0 -11
  226. package/src/ui/components/db/index.ts +0 -4
  227. package/src/ui/components/db/types.ts +0 -7
  228. package/src/ui/styles.css +0 -1
  229. /package/src/{api/schemas → schemas}/DevAtomMetadata.ts +0 -0
  230. /package/src/{api/schemas → schemas}/DevBucketMetadata.ts +0 -0
  231. /package/src/{api/schemas → schemas}/DevCacheMetadata.ts +0 -0
  232. /package/src/{api/schemas → schemas}/DevEnvMetadata.ts +0 -0
  233. /package/src/{api/schemas → schemas}/DevModuleMetadata.ts +0 -0
  234. /package/src/{api/schemas → schemas}/DevProviderMetadata.ts +0 -0
  235. /package/src/{api/schemas → schemas}/DevQueueMetadata.ts +0 -0
  236. /package/src/{api/schemas → schemas}/DevRealmMetadata.ts +0 -0
  237. /package/src/{api/schemas → schemas}/DevRouteMetadata.ts +0 -0
  238. /package/src/{api/schemas → schemas}/DevSchedulerMetadata.ts +0 -0
@@ -5,6 +5,7 @@ export const devTopicMetadataSchema = t.object({
5
5
  description: t.optional(t.text()),
6
6
  schema: t.optional(t.any()),
7
7
  provider: t.text(),
8
+ subscribers: t.integer(),
8
9
  });
9
10
 
10
11
  export type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;
@@ -1,15 +1,13 @@
1
1
  import { $ui, midnightTheme } from "@alepha/ui";
2
2
  import {
3
- IconApi,
4
- IconArchive,
5
- IconAtom,
6
3
  IconDashboard,
7
4
  IconDatabase,
8
- IconLogs,
9
- IconMessageCircle,
10
- IconStack2,
5
+ IconList,
6
+ IconMail,
7
+ IconMessage,
8
+ IconSettings,
9
+ IconSitemap,
11
10
  IconTopologyRing,
12
- IconVariable,
13
11
  } from "@tabler/icons-react";
14
12
  import { $page } from "alepha/react/router";
15
13
 
@@ -27,89 +25,105 @@ export class AppRouter {
27
25
  path: "/",
28
26
  label: "Dashboard",
29
27
  icon: <IconDashboard />,
30
- static: true,
31
28
  parent: this.layout,
32
- lazy: () => import("./components/DevDashboard.tsx"),
29
+ lazy: () => import("./components/dashboard/DevDashboard.tsx"),
33
30
  });
34
31
 
35
- actions = $page({
36
- path: "/actions",
37
- label: "Actions",
38
- icon: <IconApi />,
39
- static: true,
32
+ explorer = $page({
33
+ path: "/explorer",
34
+ label: "Explorer",
35
+ icon: <IconSitemap />,
40
36
  parent: this.layout,
41
- lazy: () => import("./components/actions/DevActionsExplorer.tsx"),
37
+ lazy: () => import("./components/explorer/DevExplorer.tsx"),
42
38
  });
43
39
 
44
- queues = $page({
45
- path: "/queues",
46
- label: "Queues",
47
- icon: <IconStack2 />,
48
- static: true,
40
+ // Database parent (tabs + NestedView)
41
+ db = $page({
42
+ path: "/db",
49
43
  parent: this.layout,
50
- lazy: () => import("./components/DevQueueMonitor.tsx"),
44
+ lazy: () => import("./components/database/DevDatabase.tsx"),
51
45
  });
52
46
 
53
- topics = $page({
54
- path: "/topics",
55
- label: "Topics",
56
- icon: <IconMessageCircle />,
57
- static: true,
58
- parent: this.layout,
59
- lazy: () => import("./components/DevTopicsViewer.tsx"),
47
+ dbErd = $page({
48
+ path: "/erd",
49
+ label: "Database",
50
+ icon: <IconDatabase />,
51
+ parent: this.db,
52
+ lazy: () => import("./components/database/DatabaseErd.page.tsx"),
60
53
  });
61
54
 
62
- caches = $page({
63
- path: "/caches",
64
- label: "Caches",
65
- icon: <IconArchive />,
66
- static: true,
67
- parent: this.layout,
68
- lazy: () => import("./components/DevCacheInspector.tsx"),
55
+ dbEditor = $page({
56
+ path: "/editor",
57
+ label: "Database",
58
+ icon: <IconDatabase />,
59
+ parent: this.db,
60
+ lazy: () => import("./components/database/DatabaseEditor.page.tsx"),
69
61
  });
70
62
 
71
- env = $page({
72
- path: "/env",
73
- label: "Environment",
74
- icon: <IconVariable />,
75
- static: true,
76
- parent: this.layout,
77
- lazy: () => import("./components/DevEnvExplorer.tsx"),
63
+ dbEditorTable = $page({
64
+ path: "/editor/:table",
65
+ parent: this.db,
66
+ lazy: () => import("./components/database/DatabaseEditor.page.tsx"),
78
67
  });
79
68
 
80
- atoms = $page({
81
- path: "/atoms",
82
- label: "Atoms",
83
- icon: <IconAtom />,
84
- static: true,
85
- parent: this.layout,
86
- lazy: () => import("./components/DevAtomsViewer.tsx"),
69
+ dbEditorRecord = $page({
70
+ path: "/editor/:table/:id",
71
+ parent: this.db,
72
+ lazy: () => import("./components/database/DatabaseEditor.page.tsx"),
87
73
  });
88
74
 
89
- db = $page({
90
- path: "/db",
91
- label: "DB Studio",
92
- icon: <IconDatabase />,
93
- static: true,
75
+ // Configuration parent (tabs + NestedView)
76
+ conf = $page({
77
+ path: "/conf",
94
78
  parent: this.layout,
95
- lazy: () => import("./components/db/DevDbStudio.tsx"),
79
+ lazy: () => import("./components/configuration/DevConfiguration.tsx"),
80
+ });
81
+
82
+ confEnv = $page({
83
+ path: "/env",
84
+ label: "Configuration",
85
+ icon: <IconSettings />,
86
+ parent: this.conf,
87
+ lazy: () => import("./components/configuration/ConfigEnv.page.tsx"),
88
+ });
89
+
90
+ confAtoms = $page({
91
+ path: "/atoms",
92
+ label: "Configuration",
93
+ icon: <IconSettings />,
94
+ parent: this.conf,
95
+ lazy: () => import("./components/configuration/ConfigAtoms.page.tsx"),
96
96
  });
97
97
 
98
98
  graph = $page({
99
99
  path: "/graph",
100
100
  label: "Graph",
101
101
  icon: <IconTopologyRing />,
102
- static: true,
103
102
  parent: this.layout,
104
103
  lazy: () => import("./components/graph/DevDependencyGraph.tsx"),
105
104
  });
106
105
 
106
+ emails = $page({
107
+ path: "/emails",
108
+ label: "Emails",
109
+ icon: <IconMail />,
110
+ parent: this.layout,
111
+ lazy: () => import("./components/emails/DevEmails.tsx"),
112
+ });
113
+
114
+ sms = $page({
115
+ path: "/sms",
116
+ label: "SMS",
117
+ icon: <IconMessage />,
118
+ parent: this.layout,
119
+ lazy: () => import("./components/sms/DevSms.tsx"),
120
+ });
121
+
107
122
  logs = $page({
108
123
  path: "/logs",
109
124
  label: "Logs",
110
- icon: <IconLogs />,
111
- static: true,
125
+ icon: <IconList />,
112
126
  parent: this.layout,
113
- lazy: () => import("./components/DevLogViewer.tsx"),
127
+ lazy: () => import("./components/logs/DevLogs.tsx"),
114
128
  });
115
129
  }
@@ -1,101 +1,120 @@
1
- import { AdminShell, DarkModeButton, OmnibarButton, ui } from "@alepha/ui";
2
- import { Flex } from "@mantine/core";
3
1
  import {
4
- IconApi,
5
- IconArchive,
6
- IconAtom,
2
+ DarkModeButton,
3
+ DashboardShell,
4
+ Flex,
5
+ OmnibarButton,
6
+ } from "@alepha/ui";
7
+ import {
7
8
  IconDashboard,
8
9
  IconDatabase,
9
- IconLogs,
10
- IconMessageCircle,
11
- IconStack2,
10
+ IconList,
11
+ IconMail,
12
+ IconMessage,
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: "Emails",
73
+ icon: <IconMail />,
74
+ href: "/emails",
75
+ },
76
+ {
77
+ label: "SMS",
78
+ icon: <IconMessage />,
79
+ href: "/sms",
80
+ },
81
+ { type: "divider" },
82
+ {
83
+ label: "Graph",
84
+ icon: <IconTopologyRing />,
85
+ href: "/graph",
86
+ },
87
+ {
88
+ label: "Logs",
89
+ icon: <IconList />,
90
+ href: "/logs",
91
+ },
92
+ );
93
+
94
+ return items;
95
+ }, [entityCount]);
96
+
17
97
  return (
18
- <AdminShell
19
- appShellHeaderProps={{
20
- bg: ui.colors.background,
98
+ <DashboardShell
99
+ layout={"alt"}
100
+ appShellMainProps={{
101
+ style: {
102
+ display: "flex",
103
+ flexDirection: "column",
104
+ },
21
105
  }}
22
- appShellNavbarProps={{
23
- bg: ui.colors.background,
24
- }}
25
- sidebarResizable
106
+ footer={<Flex />}
107
+ navbarFooter={<Flex />}
108
+ footerHeight={24}
109
+ headerHeight={60}
110
+ navbarHeader={() => <Flex />}
26
111
  sidebarProps={{
27
- items: [
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
- ],
112
+ collapsed: true,
113
+ items: sidebarItems,
82
114
  }}
83
115
  appBarProps={{
84
116
  items: [
85
117
  { 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
118
  {
100
119
  position: "left",
101
120
  element: (
@@ -0,0 +1,5 @@
1
+ import { ConfigAtoms } from "./ConfigAtoms.tsx";
2
+
3
+ const ConfigAtomsPage = () => <ConfigAtoms />;
4
+
5
+ export default ConfigAtomsPage;