From 785d5a663fcd7b54400d23928ae1af16b43f43e0 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Sun, 6 Apr 2025 13:44:09 -0400 Subject: [PATCH] chore: reorganize settings code layout --- app/routes.ts | 4 +-- app/routes/settings/auth-keys/actions.ts | 0 .../key.tsx => auth-keys/auth-key-row.tsx} | 4 +-- .../dialogs/add-auth-key.tsx} | 4 +-- .../dialogs/expire-auth-key.tsx} | 4 +-- .../{auth-keys.tsx => auth-keys/overview.tsx} | 6 ++--- .../actions.ts} | 0 .../{ => restrictions}/dialogs/add-domain.tsx | 0 .../{ => restrictions}/dialogs/add-group.tsx | 0 .../{ => restrictions}/dialogs/add-user.tsx | 0 .../overview.tsx} | 26 +++++++++++-------- .../table.tsx} | 2 +- 12 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 app/routes/settings/auth-keys/actions.ts rename app/routes/settings/{components/key.tsx => auth-keys/auth-key-row.tsx} (94%) rename app/routes/settings/{dialogs/new.tsx => auth-keys/dialogs/add-auth-key.tsx} (96%) rename app/routes/settings/{dialogs/expire.tsx => auth-keys/dialogs/expire-auth-key.tsx} (85%) rename app/routes/settings/{auth-keys.tsx => auth-keys/overview.tsx} (97%) rename app/routes/settings/{actions/restriction.ts => restrictions/actions.ts} (100%) rename app/routes/settings/{ => restrictions}/dialogs/add-domain.tsx (100%) rename app/routes/settings/{ => restrictions}/dialogs/add-group.tsx (100%) rename app/routes/settings/{ => restrictions}/dialogs/add-user.tsx (100%) rename app/routes/settings/{pages/restrictions.tsx => restrictions/overview.tsx} (87%) rename app/routes/settings/{components/restriction.tsx => restrictions/table.tsx} (97%) diff --git a/app/routes.ts b/app/routes.ts index cd45e65..d5f7666 100644 --- a/app/routes.ts +++ b/app/routes.ts @@ -28,8 +28,8 @@ export default [ ...prefix('/settings', [ index('routes/settings/overview.tsx'), - route('/auth-keys', 'routes/settings/auth-keys.tsx'), - route('/restrictions', 'routes/settings/pages/restrictions.tsx'), + route('/auth-keys', 'routes/settings/auth-keys/overview.tsx'), + route('/restrictions', 'routes/settings/restrictions/overview.tsx'), // route('/local-agent', 'routes/settings/local-agent.tsx'), ]), ]), diff --git a/app/routes/settings/auth-keys/actions.ts b/app/routes/settings/auth-keys/actions.ts new file mode 100644 index 0000000..e69de29 diff --git a/app/routes/settings/components/key.tsx b/app/routes/settings/auth-keys/auth-key-row.tsx similarity index 94% rename from app/routes/settings/components/key.tsx rename to app/routes/settings/auth-keys/auth-key-row.tsx index 73a8ed5..2cf073c 100644 --- a/app/routes/settings/components/key.tsx +++ b/app/routes/settings/auth-keys/auth-key-row.tsx @@ -4,7 +4,7 @@ import Attribute from '~/components/Attribute'; import Button from '~/components/Button'; import Code from '~/components/Code'; import toast from '~/utils/toast'; -import ExpireKey from '../dialogs/expire'; +import ExpireAuthKey from './dialogs/expire-auth-key'; interface Props { authKey: PreAuthKey; @@ -37,7 +37,7 @@ export default function AuthKeyRow({ authKey, server }: Props) {
{(authKey.used && !authKey.reusable) || new Date(authKey.expiration) < new Date() ? undefined : ( - + )}