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);
return (
<Row key={index} className="w-full justify-between">
<Row>
<Avatar
image_url={dep_usr.image}
title={`${dep_usr.first_name} Image`}
image_size={40}
/>
<Span>
{dep_usr.first_name} {dep_usr.last_name}
</Span>
<a href={`/admin/users/${dep_usr.id}`} key={index}>
<Row className="w-full justify-between">
<Row>
<Avatar
image_url={dep_usr.image}
title={`${dep_usr.first_name} Image`}
image_size={40}
/>
<Span>
{dep_usr.first_name} {dep_usr.last_name}
</Span>
</Row>
<Row>
{is_super_admin ? <Tag>Super Admin</Tag> : null}
</Row>
</Row>
<Row>
{is_super_admin ? <Tag>Super Admin</Tag> : null}
</Row>
</Row>
</a>
);
})}
</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 { GetServerSideProps } from "next";
export default function AdminDashboard() {
export default function AdminDeploymentUsers() {
return (
<Layout>
<Main />

View File

@ -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 {

View File

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