From bf6e36de375efa1e2a491f9186fdf72f8a6d4b1d Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 13 Aug 2024 14:51:31 +0800 Subject: [PATCH] feat(admin): add server runtime config settings (#7618) --- packages/frontend/admin/src/app.tsx | 4 + .../accounts/components/ceate-user-panel.tsx | 2 +- .../accounts/components/data-table.tsx | 2 +- .../accounts/components/edit-panel.tsx | 2 +- .../admin/src/modules/accounts/index.tsx | 4 +- .../frontend/admin/src/modules/layout.tsx | 102 ++++----- .../src/modules/nav/collapsible-item.tsx | 67 ++++++ .../frontend/admin/src/modules/nav/context.ts | 21 ++ .../frontend/admin/src/modules/nav/index.tsx | 113 ---------- .../frontend/admin/src/modules/nav/nav.tsx | 182 +++++++++++++---- .../admin/src/modules/nav/user-dropdown.tsx | 2 +- .../src/modules/settings/confirm-changes.tsx | 81 ++++++++ .../admin/src/modules/settings/index.tsx | 193 ++++++++++++++++++ .../modules/settings/runtime-setting-row.tsx | 39 ++++ .../settings/use-get-server-runtime-config.ts | 57 ++++++ .../use-update-server-runtime-config.ts | 41 ++++ .../admin/src/modules/settings/utils.tsx | 73 +++++++ 17 files changed, 762 insertions(+), 223 deletions(-) create mode 100644 packages/frontend/admin/src/modules/nav/collapsible-item.tsx create mode 100644 packages/frontend/admin/src/modules/nav/context.ts delete mode 100644 packages/frontend/admin/src/modules/nav/index.tsx create mode 100644 packages/frontend/admin/src/modules/settings/confirm-changes.tsx create mode 100644 packages/frontend/admin/src/modules/settings/index.tsx create mode 100644 packages/frontend/admin/src/modules/settings/runtime-setting-row.tsx create mode 100644 packages/frontend/admin/src/modules/settings/use-get-server-runtime-config.ts create mode 100644 packages/frontend/admin/src/modules/settings/use-update-server-runtime-config.ts create mode 100644 packages/frontend/admin/src/modules/settings/utils.tsx diff --git a/packages/frontend/admin/src/app.tsx b/packages/frontend/admin/src/app.tsx index 331fe982a5..be20ba24f2 100644 --- a/packages/frontend/admin/src/app.tsx +++ b/packages/frontend/admin/src/app.tsx @@ -59,6 +59,10 @@ export const router = _createBrowserRouter( path: '/admin/config', lazy: () => import('./modules/config'), }, + { + path: '/admin/settings', + lazy: () => import('./modules/settings'), + }, ], }, ], diff --git a/packages/frontend/admin/src/modules/accounts/components/ceate-user-panel.tsx b/packages/frontend/admin/src/modules/accounts/components/ceate-user-panel.tsx index 64f9953f8d..b47c362b80 100644 --- a/packages/frontend/admin/src/modules/accounts/components/ceate-user-panel.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/ceate-user-panel.tsx @@ -55,7 +55,7 @@ export function CreateUserPanel() { return (
-
+