feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain
This commit is contained in:
14
lstV2/frontend/src/routes/(logistics)/barcodegen/index.tsx
Normal file
14
lstV2/frontend/src/routes/(logistics)/barcodegen/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import BGPage from "@/components/logistics/barcodeGenerator/BGPage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/barcodegen/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<BGPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
28
lstV2/frontend/src/routes/(logistics)/dm/index.tsx
Normal file
28
lstV2/frontend/src/routes/(logistics)/dm/index.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import DmPage from "@/components/logistics/dm/dmPage";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/dm/")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<DmPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import HelperPage from "@/components/logistics/helperCommands/helperPage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/helperCommands/")({
|
||||
component: RouteComponent,
|
||||
// beforeLoad: async () => {
|
||||
// const auth = localStorage.getItem("auth_token");
|
||||
// if (!auth) {
|
||||
// throw redirect({
|
||||
// to: "/login",
|
||||
// search: {
|
||||
// // Use the current location to power a redirect after login
|
||||
// // (Do not use `router.state.resolvedLocation` as it can
|
||||
// // potentially lag behind the actual current location)
|
||||
// redirect: location.pathname + location.search,
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<HelperPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import ConsumeMaterial from "@/components/logistics/materialHelper/consumption/ConsumeMaterial";
|
||||
import PreformReturn from "@/components/logistics/materialHelper/consumption/MaterialReturn";
|
||||
import TransferToNextLot from "@/components/logistics/materialHelper/consumption/TransferToNextLot";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/(logistics)/materialHelper/consumption/"
|
||||
)({
|
||||
component: RouteComponent,
|
||||
head: () => ({
|
||||
meta: [
|
||||
{
|
||||
name: "description",
|
||||
content: "My App is a web application",
|
||||
},
|
||||
{
|
||||
title: "LST - Logistics",
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const url: string = window.location.host.split(":")[0];
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
return (
|
||||
<div className="flex flex-wrap">
|
||||
{auth ? (
|
||||
<>
|
||||
<ConsumeMaterial />
|
||||
{url === "localhost" && <PreformReturn />}
|
||||
<TransferToNextLot />
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<ConsumeMaterial />
|
||||
<TransferToNextLot />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import MaterialHelperPage from "@/components/logistics/materialHelper/materialHelperPage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/materialHelper/")({
|
||||
component: RouteComponent,
|
||||
head: () => ({
|
||||
meta: [
|
||||
{
|
||||
name: "description",
|
||||
content: "My App is a web application",
|
||||
},
|
||||
{
|
||||
title: "LST - Logistics",
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<MaterialHelperPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(logistics)/materialHelper/siloLink/')({
|
||||
component: RouteComponent,
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
return <div>Hello "/(logistics)/materialHelper/siloLink/"!</div>
|
||||
}
|
||||
14
lstV2/frontend/src/routes/(logistics)/openOrders/index.tsx
Normal file
14
lstV2/frontend/src/routes/(logistics)/openOrders/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import OpenOrders from "@/components/logistics/warehouse/openOrders";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/openOrders/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="m-5 w-11/12 h-9/10">
|
||||
<OpenOrders />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import HistoricalData from "@/components/logistics/siloAdjustments/HistoricalData";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/siloAdjustments/$hist")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// In a loader
|
||||
loader: ({ params }) => params.hist,
|
||||
// Or in a component
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const { hist } = Route.useParams();
|
||||
return (
|
||||
<div>
|
||||
<HistoricalData laneId={hist} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import Comment from "@/components/logistics/siloAdjustments/Comment";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/(logistics)/siloAdjustments/comment/$comment"
|
||||
)({
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// In a loader
|
||||
loader: ({ params }) => params.comment,
|
||||
// Or in a component
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const { comment } = Route.useParams();
|
||||
return (
|
||||
<div className="ml-20 mt-20">
|
||||
<Comment id={comment} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import SiloPage from "@/components/logistics/siloAdjustments/SiloPage";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/siloAdjustments/")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<SiloPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/(ocme)/cyclecount/index.tsx
Normal file
14
lstV2/frontend/src/routes/(ocme)/cyclecount/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import OcmeCycleCount from "@/components/ocme/ocmeCycleCount";
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(ocme)/cyclecount/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="m-2">
|
||||
<OcmeCycleCount />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
28
lstV2/frontend/src/routes/(user)/passwordChange.tsx
Normal file
28
lstV2/frontend/src/routes/(user)/passwordChange.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import PasswordChange from "@/components/user/PasswordChange";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(user)/passwordChange")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<PasswordChange />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
142
lstV2/frontend/src/routes/__root.tsx
Normal file
142
lstV2/frontend/src/routes/__root.tsx
Normal file
@@ -0,0 +1,142 @@
|
||||
import {
|
||||
createRootRoute,
|
||||
Link,
|
||||
Outlet,
|
||||
useLocation,
|
||||
} from "@tanstack/react-router";
|
||||
//import {TanStackRouterDevtools} from "@tanstack/router-devtools";
|
||||
import Cookies from "js-cookie";
|
||||
import { SidebarProvider } from "../components/ui/sidebar";
|
||||
import { ThemeProvider } from "../components/layout/theme-provider";
|
||||
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,
|
||||
} from "../components/ui/dropdown-menu";
|
||||
import { SessionProvider } from "../components/providers/Providers";
|
||||
import { Toaster } from "sonner";
|
||||
//import { Button } from "../components/ui/button";
|
||||
import { useSessionStore } from "../lib/store/sessionStore";
|
||||
import { useSession } from "@/hooks/useSession";
|
||||
import { useLogout } from "@/hooks/useLogout";
|
||||
import ExportInventoryData from "@/components/logistics/warehouse/ExportInventoryData";
|
||||
import { AddCards } from "@/components/dashboard/AddCards";
|
||||
import DMButtons from "@/components/logistics/dm/DMButtons";
|
||||
import { useSettingStore } from "@/lib/store/useSettings";
|
||||
//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();
|
||||
const location = useLocation();
|
||||
const { settings } = useSettingStore();
|
||||
|
||||
const server = settings.filter((n: any) => n.name === "dbServer");
|
||||
|
||||
return (
|
||||
<div className="overflow-hidden">
|
||||
<SessionProvider>
|
||||
<ThemeProvider>
|
||||
<nav className="flex justify-end w-full shadow ">
|
||||
<div className="m-2 flex flex-row">
|
||||
{/* Inventory section */}
|
||||
{location.pathname === "/" && (
|
||||
<div className="m-auto pr-2 flex flex-row gap-2">
|
||||
<ExportInventoryData />
|
||||
<AddCards />
|
||||
</div>
|
||||
)}
|
||||
{/* Demand mgt section this should also include plant token stuff */}
|
||||
{location.pathname === "/dm" && (
|
||||
<div className="m-auto pr-2 flex flex-row gap-2">
|
||||
<DMButtons />
|
||||
</div>
|
||||
)}
|
||||
<div className="m-1">
|
||||
<ModeToggle />
|
||||
</div>
|
||||
<div className="mr-1 ml-1">
|
||||
{settings.length > 0 && (
|
||||
<a
|
||||
href={`https://${server[0].value}.alpla.net/lst/d`}
|
||||
target="_blank"
|
||||
>
|
||||
LST - Docs
|
||||
</a>
|
||||
)}
|
||||
</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>
|
||||
<Link to="/passwordChange">
|
||||
Password Change
|
||||
</Link>
|
||||
</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>
|
||||
<main>
|
||||
<SidebarProvider defaultOpen={sidebarState}>
|
||||
<AppSidebar />
|
||||
<Toaster expand={true} richColors closeButton />
|
||||
<Outlet />
|
||||
</SidebarProvider>
|
||||
</main>
|
||||
</ThemeProvider>
|
||||
</SessionProvider>
|
||||
|
||||
{/* <TanStackRouterDevtools position="bottom-right" /> */}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
19
lstV2/frontend/src/routes/_admin.tsx
Normal file
19
lstV2/frontend/src/routes/_admin.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
// src/routes/_authenticated.tsx
|
||||
export const Route = createFileRoute("/_admin")({
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
14
lstV2/frontend/src/routes/_admin/modules.tsx
Normal file
14
lstV2/frontend/src/routes/_admin/modules.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import ModulesPage from "@/components/admin/modules/ModulePage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/modules")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<ModulesPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/_admin/notificationMGT.tsx
Normal file
14
lstV2/frontend/src/routes/_admin/notificationMGT.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import NotificationMGT from "@/components/admin/notificationMGT/NotificationMGT";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/notificationMGT")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<NotificationMGT />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/_admin/prodUsers.tsx
Normal file
14
lstV2/frontend/src/routes/_admin/prodUsers.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import ProdUserCard from "@/components/admin/prodUser/ProdUserCard";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/prodUsers")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<ProdUserCard />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/_admin/servers.tsx
Normal file
14
lstV2/frontend/src/routes/_admin/servers.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import ServerPage from "@/components/admin/servers/ServerPage";
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/servers")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<ServerPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/_admin/settings.tsx
Normal file
14
lstV2/frontend/src/routes/_admin/settings.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import SettingsPage from "@/components/admin/settings/SettingsPage";
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/settings")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<SettingsPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/_admin/subModules.tsx
Normal file
14
lstV2/frontend/src/routes/_admin/subModules.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import SubModulePage from "@/components/admin/supModules/SubModulePage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/subModules")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<SubModulePage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
10
lstV2/frontend/src/routes/_admin/users.tsx
Normal file
10
lstV2/frontend/src/routes/_admin/users.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import UserPage from "@/components/admin/user/UserPage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_admin/users")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <UserPage />;
|
||||
}
|
||||
19
lstV2/frontend/src/routes/_auth.tsx
Normal file
19
lstV2/frontend/src/routes/_auth.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
// src/routes/_authenticated.tsx
|
||||
export const Route = createFileRoute("/_auth")({
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.href,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
9
lstV2/frontend/src/routes/_auth/profile.tsx
Normal file
9
lstV2/frontend/src/routes/_auth/profile.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_auth/profile")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <div>Hello "/profile"!</div>;
|
||||
}
|
||||
13
lstV2/frontend/src/routes/_eom.tsx
Normal file
13
lstV2/frontend/src/routes/_eom.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import {createFileRoute, redirect} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_eom")({
|
||||
//component: RouteComponent,
|
||||
beforeLoad: async () => {
|
||||
const auth = localStorage.getItem("auth_token");
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
125
lstV2/frontend/src/routes/_eom/article/$av.tsx
Normal file
125
lstV2/frontend/src/routes/_eom/article/$av.tsx
Normal file
@@ -0,0 +1,125 @@
|
||||
import {LstCard} from "@/components/extendedUI/LstCard";
|
||||
import {CardFooter, CardHeader} from "@/components/ui/card";
|
||||
import {Input} from "@/components/ui/input";
|
||||
import {Label} from "@radix-ui/react-dropdown-menu";
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_eom/article/$av")({
|
||||
component: RouteComponent,
|
||||
loader: () => {
|
||||
return [{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}];
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const {av} = Route.useParams();
|
||||
const loaded = Route.useLoaderData();
|
||||
|
||||
console.log(loaded, av);
|
||||
return (
|
||||
<div className="w-full m-2">
|
||||
<form className="w-1/2">
|
||||
<div>
|
||||
<h1>AV - Description</h1>
|
||||
</div>
|
||||
<hr className="w-48"></hr>
|
||||
<LstCard className="m-2">
|
||||
<CardHeader className="place-content-center">
|
||||
<h3>Inventory Data</h3>
|
||||
</CardHeader>
|
||||
<div className="flex flex-row">
|
||||
<div className="w-96 m-2">
|
||||
<Label>Starting Inv</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>At The Line</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>Inhouse endinging</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>In transit</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>Comments</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
</div>
|
||||
<CardFooter>
|
||||
<div className="flex justify-end">
|
||||
<Label>Total Inv</Label>
|
||||
</div>
|
||||
</CardFooter>
|
||||
</LstCard>
|
||||
<LstCard className="m-2">
|
||||
<CardHeader className="place-content-center">
|
||||
<h3>Purchasing</h3>
|
||||
</CardHeader>
|
||||
<div className="flex flex-row">
|
||||
<div className="w-96 m-2">
|
||||
<Label>Purchased</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>Recived in GP</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>Varation</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>Comments</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
</div>
|
||||
</LstCard>
|
||||
<LstCard className="m-2">
|
||||
<CardHeader className="place-content-center">
|
||||
<h3>Transfers</h3>
|
||||
</CardHeader>
|
||||
<div className="flex flex-row">
|
||||
<div className="w-96 m-2">
|
||||
<Label>Transfered in</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
<div className="w-96 m-2">
|
||||
<Label>Transfered out</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
|
||||
<div className="w-96 m-2">
|
||||
<Label>Comments</Label>
|
||||
<Input></Input>
|
||||
</div>
|
||||
</div>
|
||||
</LstCard>
|
||||
<LstCard className="m-2">
|
||||
<CardHeader className="place-content-center">
|
||||
<h3>Calculations</h3>
|
||||
</CardHeader>
|
||||
<div className="flex flex-row">
|
||||
<div className="w-96 m-2 flex flex-col">
|
||||
<Label>Actual Consumption: 1452541</Label>
|
||||
<Label>Production Consumption: 146854</Label>
|
||||
</div>
|
||||
|
||||
<div className="w-96 m-2 flex flex-col">
|
||||
<Label>Difference: -2541</Label>
|
||||
<Label>Waste: -5%</Label>
|
||||
</div>
|
||||
|
||||
<div className="w-96 m-2 flex flex-col">
|
||||
<Label>Price/Kg: $2.20</Label>
|
||||
<Label>$Loss/$Gain: $35.00</Label>
|
||||
</div>
|
||||
</div>
|
||||
</LstCard>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/_eom/eom.tsx
Normal file
14
lstV2/frontend/src/routes/_eom/eom.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import EomPage from "@/components/eom/EomPage";
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_eom/eom")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<EomPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
13
lstV2/frontend/src/routes/about.tsx
Normal file
13
lstV2/frontend/src/routes/about.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import {createFileRoute} from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/about")({
|
||||
component: About,
|
||||
});
|
||||
|
||||
function About() {
|
||||
return (
|
||||
<div className="m-auto">
|
||||
<h2>About page to come.</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/changelog.tsx
Normal file
14
lstV2/frontend/src/routes/changelog.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import Changelog from "@/components/changelog/ChangeLog";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/changelog")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<Changelog />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
17
lstV2/frontend/src/routes/index.tsx
Normal file
17
lstV2/frontend/src/routes/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
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() {
|
||||
return (
|
||||
<div className="h-dvh w-dvw">
|
||||
<DashBoard />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
27
lstV2/frontend/src/routes/login.tsx
Normal file
27
lstV2/frontend/src/routes/login.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
import LoginForm from "@/components/auth/LoginForm";
|
||||
import { z } from "zod";
|
||||
|
||||
export const Route = createFileRoute("/login")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: () => {
|
||||
const isLoggedIn = localStorage.getItem("auth_token");
|
||||
if (isLoggedIn) {
|
||||
throw redirect({
|
||||
to: "/",
|
||||
});
|
||||
}
|
||||
},
|
||||
validateSearch: z.object({
|
||||
redirect: z.string().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="ml-[25%]">
|
||||
<LoginForm />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/ocp/index.tsx
Normal file
14
lstV2/frontend/src/routes/ocp/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import OCPPage from "@/components/production/ocp/OcpPage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/ocp/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="h-dvh w-dvw">
|
||||
<OCPPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
105
lstV2/frontend/src/routes/register.tsx
Normal file
105
lstV2/frontend/src/routes/register.tsx
Normal file
@@ -0,0 +1,105 @@
|
||||
import RegisterForm from "@/components/auth/Register";
|
||||
import { LstCard } from "@/components/extendedUI/LstCard";
|
||||
import { CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/register")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: () => {
|
||||
const isLoggedIn = localStorage.getItem("auth_token");
|
||||
if (isLoggedIn) {
|
||||
throw redirect({
|
||||
to: "/",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="flex flex-row w-5/6 justify-between gap-2">
|
||||
<RegisterForm />
|
||||
<div>
|
||||
<LstCard>
|
||||
<CardHeader>
|
||||
<h2 className="text-2xl font-bold mb-4">
|
||||
Disclaimer and User Agreement
|
||||
</h2>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="max-w-2xl mx-auto p-6 rounded-2xl shadow-md">
|
||||
<ul className="list-decimal list-inside space-y-3">
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
Authentication Notice:
|
||||
</span>
|
||||
<span>
|
||||
The username, email, and password are
|
||||
only for LST you <em>DO NOT</em>Need to
|
||||
use Windows username if you do not wish
|
||||
to.
|
||||
</span>
|
||||
</li>
|
||||
{/* <li>
|
||||
<span className="font-bold">
|
||||
Password Privacy and Security:
|
||||
</span>
|
||||
This application{" "}
|
||||
<span className="font-semibold">
|
||||
does not store, sync, or transmit
|
||||
</span>{" "}
|
||||
your Windows password in any form.
|
||||
Authentication is handled securely, and your
|
||||
credentials are never logged or accessible
|
||||
to the developers or third parties.
|
||||
</li> */}
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
Data Handling:
|
||||
</span>
|
||||
All data accessed through the Alpla prod
|
||||
remains the property of Alpla. The app
|
||||
functions as a secure interface for
|
||||
accessing and updating this information
|
||||
where permitted by your role.
|
||||
</li>
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
User Responsibility:
|
||||
</span>
|
||||
You are responsible for any actions
|
||||
performed using your account. Please ensure
|
||||
you do not share your credentials with
|
||||
others and always log out of the application
|
||||
when not in use.
|
||||
</li>
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
No Warranty:
|
||||
</span>
|
||||
This application is provided "
|
||||
<span className="italic">as is</span>"
|
||||
without any warranty of any kind, either
|
||||
expressed or implied. While every effort is
|
||||
made to ensure functionality and data
|
||||
accuracy, the app is subject to ongoing
|
||||
development and may contain bugs or require
|
||||
updates.
|
||||
</li>
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
Consent Required:
|
||||
</span>
|
||||
By signing up or continuing to use this
|
||||
application, you agree to the above terms
|
||||
and acknowledge that you understand how your
|
||||
login information is used.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</CardContent>
|
||||
</LstCard>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
14
lstV2/frontend/src/routes/rfid/index.tsx
Normal file
14
lstV2/frontend/src/routes/rfid/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import RfidPage from "@/components/rfid/RfidPage";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/rfid/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<RfidPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user