test(reporting): more reporting tables for different reports
This commit is contained in:
@@ -7,12 +7,12 @@ import { ModeToggle } from "../components/layout/mode-toggle";
|
||||
import { AppSidebar } from "../components/layout/lst-sidebar";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "../components/ui/avatar";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "../components/ui/dropdown-menu";
|
||||
import { SessionProvider } from "../components/providers/Providers";
|
||||
import { Toaster } from "sonner";
|
||||
@@ -21,74 +21,83 @@ import { Toaster } from "sonner";
|
||||
import { useSessionStore } from "../lib/store/sessionStore";
|
||||
import { useSession } from "@/hooks/useSession";
|
||||
import { useLogout } from "@/hooks/useLogout";
|
||||
import { AddCards } from "@/components/dashboard/AddCards";
|
||||
|
||||
// same as the layout
|
||||
export const Route = createRootRoute({
|
||||
component: () => {
|
||||
const sidebarState = Cookies.get("sidebar_state") === "true";
|
||||
const { session } = useSession();
|
||||
const { user } = useSessionStore();
|
||||
const logout = useLogout();
|
||||
component: () => {
|
||||
const sidebarState = Cookies.get("sidebar_state") === "true";
|
||||
const { session } = useSession();
|
||||
const { user } = useSessionStore();
|
||||
const logout = useLogout();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SessionProvider>
|
||||
<ThemeProvider>
|
||||
<nav className="flex justify-end">
|
||||
<div className="m-2 flex flex-row">
|
||||
<div className="m-auto pr-2">
|
||||
<p>Add Card</p>
|
||||
</div>
|
||||
<div className="m-1">
|
||||
<ModeToggle />
|
||||
</div>
|
||||
{session ? (
|
||||
<div className="m-1">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger>
|
||||
<Avatar>
|
||||
<AvatarImage
|
||||
src="https://github.com/shadcn.png"
|
||||
alt="@shadcn"
|
||||
/>
|
||||
<AvatarFallback>CN</AvatarFallback>
|
||||
</Avatar>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuLabel>
|
||||
Hello {user?.username}
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
{/* <DropdownMenuItem>Profile</DropdownMenuItem>
|
||||
return (
|
||||
<>
|
||||
<SessionProvider>
|
||||
<ThemeProvider>
|
||||
<nav className="flex justify-end">
|
||||
<div className="m-2 flex flex-row">
|
||||
<div className="m-auto pr-2">
|
||||
<AddCards />
|
||||
</div>
|
||||
<div className="m-1">
|
||||
<ModeToggle />
|
||||
</div>
|
||||
{session ? (
|
||||
<div className="m-1">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger>
|
||||
<Avatar>
|
||||
<AvatarImage
|
||||
src="https://github.com/shadcn.png"
|
||||
alt="@shadcn"
|
||||
/>
|
||||
<AvatarFallback>
|
||||
CN
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuLabel>
|
||||
Hello {user?.username}
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
{/* <DropdownMenuItem>Profile</DropdownMenuItem>
|
||||
<DropdownMenuItem>Billing</DropdownMenuItem>
|
||||
<DropdownMenuItem>Team</DropdownMenuItem>
|
||||
<DropdownMenuItem>Subscription</DropdownMenuItem> */}
|
||||
<hr className="solid"></hr>
|
||||
<DropdownMenuItem>
|
||||
<div className="m-auto">
|
||||
<button onClick={() => logout()}>Logout</button>
|
||||
</div>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<Link to="/login">Login</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</nav>
|
||||
<SidebarProvider defaultOpen={sidebarState}>
|
||||
<AppSidebar />
|
||||
<Toaster expand={true} richColors closeButton />
|
||||
<Outlet />
|
||||
</SidebarProvider>
|
||||
</ThemeProvider>
|
||||
</SessionProvider>
|
||||
<hr className="solid"></hr>
|
||||
<DropdownMenuItem>
|
||||
<div className="m-auto">
|
||||
<button
|
||||
onClick={() =>
|
||||
logout()
|
||||
}
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<Link to="/login">Login</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</nav>
|
||||
<SidebarProvider defaultOpen={sidebarState}>
|
||||
<AppSidebar />
|
||||
<Toaster expand={true} richColors closeButton />
|
||||
<Outlet />
|
||||
</SidebarProvider>
|
||||
</ThemeProvider>
|
||||
</SessionProvider>
|
||||
|
||||
{/* <TanStackRouterDevtools position="bottom-right" /> */}
|
||||
</>
|
||||
);
|
||||
},
|
||||
{/* <TanStackRouterDevtools position="bottom-right" /> */}
|
||||
</>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,51 +1,17 @@
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
//import GridLayout from "react-grid-layout";
|
||||
import "../../node_modules/react-grid-layout/css/styles.css";
|
||||
import "../../node_modules/react-resizable/css/styles.css";
|
||||
import DashBoard from "@/components/dashboard/DashBoard";
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
component: Index,
|
||||
});
|
||||
|
||||
function Index() {
|
||||
// const [layout, setLayout] = useState([
|
||||
// {
|
||||
// i: "PPOO",
|
||||
// x: 0,
|
||||
// y: 0,
|
||||
// w: 5,
|
||||
// h: 3,
|
||||
// minW: 2,
|
||||
// maxW: 6,
|
||||
// minH: 2,
|
||||
// maxH: 4,
|
||||
// isResizable: true,
|
||||
// isDraggable: true,
|
||||
// },
|
||||
// {i: "OCPLogs", x: 2, y: 0, w: 5, h: 3, isResizable: true, isDraggable: true},
|
||||
// ]);
|
||||
|
||||
// const [cardData, setCardData] = useState([
|
||||
// {i: "card1", name: "PPOO"},
|
||||
// {i: "card2", name: "OCPLogs"},
|
||||
// ]);
|
||||
return (
|
||||
<>
|
||||
{/* <AddCards addCard={addCard} cards={cards} /> */}
|
||||
{/* <GridLayout className="layout" cols={12} rowHeight={30} width={window.innerWidth}>
|
||||
<div className="bg-blue-400" key="a" data-grid={{x: 0, y: 0, w: 1, h: 2, static: true}}>
|
||||
a
|
||||
</div>
|
||||
<div className="bg-blue-400" key="b" data-grid={{x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4}}>
|
||||
b
|
||||
</div>
|
||||
<div className="bg-blue-400" key="c" data-grid={{x: 4, y: 0, w: 1, h: 2}}>
|
||||
c
|
||||
</div>
|
||||
</GridLayout> */}
|
||||
<div className="m-auto">
|
||||
<span>Empty Space why dont you add some cards?</span>
|
||||
</div>
|
||||
</>
|
||||
<div className="h-dvh w-dvw">
|
||||
<DashBoard />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import OCPPage from "@/components/production/ocp/OcpPage";
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/ocp/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <OCPPage />;
|
||||
return (
|
||||
<div className="h-dvh w-dvw">
|
||||
<OCPPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user