From 9bd99ccab390763c1c633e46d22920a9365505e5 Mon Sep 17 00:00:00 2001 From: Archben Date: Wed, 11 Mar 2026 05:51:42 +0000 Subject: [PATCH] Updates --- .../admin/users/(sections)/users-list.tsx | 30 ++++++++-------- .../users/[deployment_user_id]/index.tsx | 35 +++++++++++++++++++ src/pages/admin/users/index.tsx | 2 +- src/styles/globals.css | 5 +++ src/types/index.ts | 1 + 5 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 src/pages/admin/users/[deployment_user_id]/index.tsx diff --git a/src/components/pages/admin/users/(sections)/users-list.tsx b/src/components/pages/admin/users/(sections)/users-list.tsx index 75ee132..e0ae999 100644 --- a/src/components/pages/admin/users/(sections)/users-list.tsx +++ b/src/components/pages/admin/users/(sections)/users-list.tsx @@ -16,21 +16,23 @@ export default function UsersList() { const is_super_admin = Boolean(dep_usr.is_super_admin); return ( - - - - - {dep_usr.first_name} {dep_usr.last_name} - + + + + + + {dep_usr.first_name} {dep_usr.last_name} + + + + {is_super_admin ? Super Admin : null} + - - {is_super_admin ? Super Admin : null} - - + ); })} diff --git a/src/pages/admin/users/[deployment_user_id]/index.tsx b/src/pages/admin/users/[deployment_user_id]/index.tsx new file mode 100644 index 0000000..eca6f3c --- /dev/null +++ b/src/pages/admin/users/[deployment_user_id]/index.tsx @@ -0,0 +1,35 @@ +import Main from "@/src/components/pages/admin/users"; +import { NSQLITE_TURBOCI_ADMIN_USERS } from "@/src/db/types"; +import defaultAdminProps from "@/src/functions/pages/admin/default-admin-props"; +import Layout from "@/src/layouts/admin"; +import NSQLite from "@moduletrace/nsqlite"; +import { GetServerSideProps } from "next"; + +export default function AdminSingleDeploymentUser() { + return ( + +
+ + ); +} + +export const getServerSideProps: GetServerSideProps = async (ctx) => { + return await defaultAdminProps({ + ctx, + async propsFn({ user, props }) { + if (!user.super_admin) { + return `/admin`; + } + + const users_res = await NSQLite.select( + { + table: "users", + }, + ); + + return { + deployment_users: users_res.payload, + }; + }, + }); +}; diff --git a/src/pages/admin/users/index.tsx b/src/pages/admin/users/index.tsx index 3e5dd7f..5eeeef0 100644 --- a/src/pages/admin/users/index.tsx +++ b/src/pages/admin/users/index.tsx @@ -5,7 +5,7 @@ import Layout from "@/src/layouts/admin"; import NSQLite from "@moduletrace/nsqlite"; import { GetServerSideProps } from "next"; -export default function AdminDashboard() { +export default function AdminDeploymentUsers() { return (
diff --git a/src/styles/globals.css b/src/styles/globals.css index e7d72ee..c102c53 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -80,6 +80,11 @@ @apply text-primary-text font-semibold; } +.twui-tag-primary { + @apply bg-foreground-light text-background-light; + @apply dark:bg-foreground-dark dark:text-background-dark; +} + .twui-h1, .twui-h2, .twui-h3 { diff --git a/src/types/index.ts b/src/types/index.ts index 1ddc821..cc1be44 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -185,6 +185,7 @@ export type ServiceScriptObject = { export type URLQueryType = { service_name?: string | null; + deployment_user_id?: string | null; }; export type PagePropsType = {