feat(intial auth): intial auth setup for the scanner
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import { Bell, Logs, Server, Settings } from "lucide-react";
|
||||
import { Bell, Logs, Server, Settings, UsersRound } from "lucide-react";
|
||||
|
||||
import {
|
||||
SidebarGroup,
|
||||
@@ -56,22 +56,22 @@ export default function AdminSidebar({ session }: any) {
|
||||
module: "admin",
|
||||
active: true,
|
||||
},
|
||||
// {
|
||||
// title: "Modules",
|
||||
// url: "/admin/modules",
|
||||
// icon: Settings,
|
||||
// role: ["systemAdmin", "admin"],
|
||||
// module: "admin",
|
||||
// active: true,
|
||||
// },
|
||||
// {
|
||||
// title: "Servers",
|
||||
// url: "/admin/servers",
|
||||
// icon: Server,
|
||||
// role: ["systemAdmin", "admin"],
|
||||
// module: "admin",
|
||||
// active: true,
|
||||
// },
|
||||
{
|
||||
title: "Users",
|
||||
url: "/admin/users",
|
||||
icon: UsersRound,
|
||||
role: ["systemAdmin", "admin"],
|
||||
module: "admin",
|
||||
active: true,
|
||||
},
|
||||
{
|
||||
title: "Scan users",
|
||||
url: "/admin/scanUsers",
|
||||
icon: UsersRound,
|
||||
role: ["systemAdmin", "admin"],
|
||||
module: "admin",
|
||||
active: true,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<SidebarGroup>
|
||||
|
||||
@@ -36,6 +36,17 @@ const docs = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Mobile",
|
||||
url: "/updateInstructions",
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: "Settings",
|
||||
url: "/mobile-settings",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
export default function DocBar() {
|
||||
const { setOpen } = useSidebar();
|
||||
|
||||
49
frontend/src/components/Sidebar/MobileBar.tsx
Normal file
49
frontend/src/components/Sidebar/MobileBar.tsx
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import { ScanText, ScrollText } from "lucide-react";
|
||||
import {
|
||||
SidebarGroup,
|
||||
SidebarGroupContent,
|
||||
SidebarGroupLabel,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
useSidebar,
|
||||
} from "../ui/sidebar";
|
||||
|
||||
export default function MobileBar({ session }: any) {
|
||||
const { setOpen } = useSidebar();
|
||||
const items = [
|
||||
{
|
||||
title: "Update Instructions",
|
||||
url: "/",
|
||||
icon: ScrollText,
|
||||
},
|
||||
{
|
||||
title: "Scan Log",
|
||||
url: "/",
|
||||
icon: ScanText,
|
||||
},
|
||||
];
|
||||
|
||||
console.log(session);
|
||||
|
||||
return (
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel>Mobile</SidebarGroupLabel>
|
||||
<SidebarGroupContent>
|
||||
<SidebarMenu>
|
||||
{items.map((item) => (
|
||||
<SidebarMenuItem key={item.title}>
|
||||
<SidebarMenuButton asChild>
|
||||
<Link to={item.url} onClick={() => setOpen(false)}>
|
||||
<item.icon />
|
||||
<span>{item.title}</span>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
</SidebarGroupContent>
|
||||
</SidebarGroup>
|
||||
);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
import { useSession } from "@/lib/auth-client";
|
||||
import AdminSidebar from "./AdminBar";
|
||||
import DocBar from "./DocBar";
|
||||
import MobileBar from "./MobileBar";
|
||||
|
||||
export function AppSidebar() {
|
||||
const { data: session } = useSession();
|
||||
@@ -22,7 +23,8 @@ export function AppSidebar() {
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
<SidebarContent>
|
||||
<DocBar/>
|
||||
<DocBar />
|
||||
<MobileBar session={session} />
|
||||
{session &&
|
||||
(session.user.role === "admin" ||
|
||||
session.user.role === "systemAdmin") && (
|
||||
|
||||
Reference in New Issue
Block a user