+ import { page } from '$app/stores';
+ import NavigationBar from '$lib/components/shared-components/navigation-bar.svelte';
+ import SideBarButton from '$lib/components/shared-components/side-bar/side-bar-button.svelte';
+ import AccountMultipleOutline from 'svelte-material-icons/AccountMultipleOutline.svelte';
+ import Sync from 'svelte-material-icons/Sync.svelte';
+ import Cog from 'svelte-material-icons/Cog.svelte';
+ import Server from 'svelte-material-icons/Server.svelte';
+ import StatusBox from '$lib/components/shared-components/status-box.svelte';
+ import { goto } from '$app/navigation';
+ import { AppRoute } from '../../lib/constants';
+
+ const getPageTitle = (routeId: string | null) => {
+ switch (routeId) {
+ case AppRoute.ADMIN_USER_MANAGEMENT:
+ return 'User Management';
+ case AppRoute.ADMIN_SETTINGS:
+ return 'Settings';
+ case AppRoute.ADMIN_JOBS:
+ return 'Jobs';
+ case AppRoute.ADMIN_STATS:
+ return 'Server Stats';
+ default:
+ return '';
+ }
+ };
+
+
+
+ Administration - Immich
+
+
+
+
-
+
+
+
+
+
+
+ {getPageTitle($page.route.id)}
+
+
+
+
+
+
+
diff --git a/web/src/routes/admin/+page.server.ts b/web/src/routes/admin/+page.server.ts
index 01c8609ffc..f8c5996154 100644
--- a/web/src/routes/admin/+page.server.ts
+++ b/web/src/routes/admin/+page.server.ts
@@ -1,5 +1,4 @@
import { redirect } from '@sveltejs/kit';
-import { serverApi } from '@api';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ parent }) => {
@@ -11,7 +10,5 @@ export const load: PageServerLoad = async ({ parent }) => {
throw redirect(302, '/photos');
}
- const { data: allUsers } = await serverApi.userApi.getAllUsers(false);
-
- return { user, allUsers };
+ throw redirect(302, '/admin/user-management');
};
diff --git a/web/src/routes/admin/+page.svelte b/web/src/routes/admin/+page.svelte
index 42388f6868..e69de29bb2 100644
--- a/web/src/routes/admin/+page.svelte
+++ b/web/src/routes/admin/+page.svelte
@@ -1,249 +0,0 @@
-
-
-
- Administration - Immich
-
-
-
-
-{#if shouldShowCreateUserForm}
-
(shouldShowCreateUserForm = false)}>
-
-
-{/if}
-
-{#if shouldShowEditUserForm}
-
(shouldShowEditUserForm = false)}>
-
-
-{/if}
-
-{#if shouldShowDeleteConfirmDialog}
-
(shouldShowDeleteConfirmDialog = false)}>
-
-
-{/if}
-
-{#if shouldShowRestoreDialog}
-
(shouldShowRestoreDialog = false)}>
-
-
-{/if}
-
-{#if shouldShowInfoPanel}
-
(shouldShowInfoPanel = false)}>
-
-
Password reset success
-
-
- The user's password has been reset to the default password
-
- Please inform the user, and they will need to change the password at the next log-on.
-
-
-
-
-
-
-
-{/if}
-
-
-
-
-
-
- {selectedAction}
-
-
-
-
-
-
- {#if selectedAction === AdminSideBarSelection.USER_MANAGEMENT}
- (shouldShowCreateUserForm = true)}
- on:edit-user={editUserHandler}
- on:delete-user={deleteUserHandler}
- on:restore-user={restoreUserHandler}
- />
- {/if}
- {#if selectedAction === AdminSideBarSelection.JOBS}
-
- {/if}
- {#if selectedAction === AdminSideBarSelection.SETTINGS}
-
- {/if}
- {#if selectedAction === AdminSideBarSelection.STATS && serverStat}
-
- {/if}
-
-
-
-
diff --git a/web/src/routes/admin/jobs-status/+page.server.ts b/web/src/routes/admin/jobs-status/+page.server.ts
new file mode 100644
index 0000000000..ccfbb564f1
--- /dev/null
+++ b/web/src/routes/admin/jobs-status/+page.server.ts
@@ -0,0 +1,12 @@
+import { redirect } from '@sveltejs/kit';
+import type { PageServerLoad } from './$types';
+
+export const load: PageServerLoad = async ({ parent }) => {
+ const { user } = await parent();
+
+ if (!user) {
+ throw redirect(302, '/auth/login');
+ } else if (!user.isAdmin) {
+ throw redirect(302, '/photos');
+ }
+};
diff --git a/web/src/routes/admin/jobs-status/+page.svelte b/web/src/routes/admin/jobs-status/+page.svelte
new file mode 100644
index 0000000000..ac4ef81646
--- /dev/null
+++ b/web/src/routes/admin/jobs-status/+page.svelte
@@ -0,0 +1,11 @@
+
+
+
+ Jobs Status - Immich
+
+
+
diff --git a/web/src/routes/admin/server-status/+page.server.ts b/web/src/routes/admin/server-status/+page.server.ts
new file mode 100644
index 0000000000..01c8609ffc
--- /dev/null
+++ b/web/src/routes/admin/server-status/+page.server.ts
@@ -0,0 +1,17 @@
+import { redirect } from '@sveltejs/kit';
+import { serverApi } from '@api';
+import type { PageServerLoad } from './$types';
+
+export const load: PageServerLoad = async ({ parent }) => {
+ const { user } = await parent();
+
+ if (!user) {
+ throw redirect(302, '/auth/login');
+ } else if (!user.isAdmin) {
+ throw redirect(302, '/photos');
+ }
+
+ const { data: allUsers } = await serverApi.userApi.getAllUsers(false);
+
+ return { user, allUsers };
+};
diff --git a/web/src/routes/admin/server-status/+page.svelte b/web/src/routes/admin/server-status/+page.svelte
new file mode 100644
index 0000000000..1ab8940f77
--- /dev/null
+++ b/web/src/routes/admin/server-status/+page.svelte
@@ -0,0 +1,29 @@
+
+
+
+ Jobs Status - Immich
+
+
+{#if $page.data.allUsers && serverStat}
+
+{/if}
diff --git a/web/src/routes/admin/settings/+page.server.ts b/web/src/routes/admin/settings/+page.server.ts
new file mode 100644
index 0000000000..fb2c1cc213
--- /dev/null
+++ b/web/src/routes/admin/settings/+page.server.ts
@@ -0,0 +1,14 @@
+import { redirect } from '@sveltejs/kit';
+import type { PageServerLoad } from './$types';
+
+export const load: PageServerLoad = async ({ parent }) => {
+ const { user } = await parent();
+
+ if (!user) {
+ throw redirect(302, '/auth/login');
+ } else if (!user.isAdmin) {
+ throw redirect(302, '/photos');
+ }
+
+ return { user };
+};
diff --git a/web/src/routes/admin/settings/+page.svelte b/web/src/routes/admin/settings/+page.svelte
new file mode 100644
index 0000000000..aa2fc4c56e
--- /dev/null
+++ b/web/src/routes/admin/settings/+page.svelte
@@ -0,0 +1,33 @@
+
+
+
+ {#await getConfig()}
+
+ {:then configs}
+
+
+
+
+
+
+
+ {/await}
+
diff --git a/web/src/routes/admin/user-management/+page.server.ts b/web/src/routes/admin/user-management/+page.server.ts
new file mode 100644
index 0000000000..01c8609ffc
--- /dev/null
+++ b/web/src/routes/admin/user-management/+page.server.ts
@@ -0,0 +1,17 @@
+import { redirect } from '@sveltejs/kit';
+import { serverApi } from '@api';
+import type { PageServerLoad } from './$types';
+
+export const load: PageServerLoad = async ({ parent }) => {
+ const { user } = await parent();
+
+ if (!user) {
+ throw redirect(302, '/auth/login');
+ } else if (!user.isAdmin) {
+ throw redirect(302, '/photos');
+ }
+
+ const { data: allUsers } = await serverApi.userApi.getAllUsers(false);
+
+ return { user, allUsers };
+};
diff --git a/web/src/routes/admin/user-management/+page.svelte b/web/src/routes/admin/user-management/+page.svelte
new file mode 100644
index 0000000000..a5cb6de6ea
--- /dev/null
+++ b/web/src/routes/admin/user-management/+page.svelte
@@ -0,0 +1,232 @@
+
+
+
+ User Management - Immich
+
+
+
+ {#if shouldShowCreateUserForm}
+ (shouldShowCreateUserForm = false)}>
+
+
+ {/if}
+
+ {#if shouldShowEditUserForm}
+ (shouldShowEditUserForm = false)}>
+
+
+ {/if}
+
+ {#if shouldShowDeleteConfirmDialog}
+ (shouldShowDeleteConfirmDialog = false)}>
+
+
+ {/if}
+
+ {#if shouldShowRestoreDialog}
+ (shouldShowRestoreDialog = false)}>
+
+
+ {/if}
+
+ {#if shouldShowInfoPanel}
+ (shouldShowInfoPanel = false)}>
+
+
Password reset success
+
+
+ The user's password has been reset to the default password
+
+ Please inform the user, and they will need to change the password at the next log-on.
+
+
+
+
+
+
+
+ {/if}
+
+
+
+
+ Email |
+ First name |
+ Last name |
+ Action |
+
+
+
+ {#if allUsers}
+ {#each allUsers as user, i}
+
+ {user.email} |
+ {user.firstName} |
+ {user.lastName} |
+
+ {#if !isDeleted(user)}
+
+
+ {/if}
+ {#if isDeleted(user)}
+
+ {/if}
+ |
+
+ {/each}
+ {/if}
+
+
+
+
+