This commit is contained in:
Benjamin Toby 2026-03-11 05:51:42 +00:00
parent dd2e32007d
commit 9bd99ccab3
5 changed files with 58 additions and 15 deletions

View File

@ -16,21 +16,23 @@ export default function UsersList() {
const is_super_admin = Boolean(dep_usr.is_super_admin); const is_super_admin = Boolean(dep_usr.is_super_admin);
return ( return (
<Row key={index} className="w-full justify-between"> <a href={`/admin/users/${dep_usr.id}`} key={index}>
<Row> <Row className="w-full justify-between">
<Avatar <Row>
image_url={dep_usr.image} <Avatar
title={`${dep_usr.first_name} Image`} image_url={dep_usr.image}
image_size={40} title={`${dep_usr.first_name} Image`}
/> image_size={40}
<Span> />
{dep_usr.first_name} {dep_usr.last_name} <Span>
</Span> {dep_usr.first_name} {dep_usr.last_name}
</Span>
</Row>
<Row>
{is_super_admin ? <Tag>Super Admin</Tag> : null}
</Row>
</Row> </Row>
<Row> </a>
{is_super_admin ? <Tag>Super Admin</Tag> : null}
</Row>
</Row>
); );
})} })}
</Stack> </Stack>

View File

@ -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 (
<Layout>
<Main />
</Layout>
);
}
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<NSQLITE_TURBOCI_ADMIN_USERS>(
{
table: "users",
},
);
return {
deployment_users: users_res.payload,
};
},
});
};

View File

@ -5,7 +5,7 @@ import Layout from "@/src/layouts/admin";
import NSQLite from "@moduletrace/nsqlite"; import NSQLite from "@moduletrace/nsqlite";
import { GetServerSideProps } from "next"; import { GetServerSideProps } from "next";
export default function AdminDashboard() { export default function AdminDeploymentUsers() {
return ( return (
<Layout> <Layout>
<Main /> <Main />

View File

@ -80,6 +80,11 @@
@apply text-primary-text font-semibold; @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-h1,
.twui-h2, .twui-h2,
.twui-h3 { .twui-h3 {

View File

@ -185,6 +185,7 @@ export type ServiceScriptObject = {
export type URLQueryType = { export type URLQueryType = {
service_name?: string | null; service_name?: string | null;
deployment_user_id?: string | null;
}; };
export type PagePropsType = { export type PagePropsType = {