feat(migration): dashboard migrated over

This commit is contained in:
2025-10-26 09:47:47 -05:00
parent 70a2ff5e84
commit 2206a4d4ba
6 changed files with 70 additions and 51 deletions

View File

@@ -17,7 +17,7 @@ export default function Cards(card: any) {
active: existing[0]?.active ?? false, active: existing[0]?.active ?? false,
}, },
onSubmit: async ({ value }) => { onSubmit: async ({ value }) => {
console.log(value); //console.log(value);
const testCard: any = cards.filter((i: any) => i.name === value.name); const testCard: any = cards.filter((i: any) => i.name === value.name);
if (value.active) { if (value.active) {

View File

@@ -14,7 +14,7 @@ export function getinventoryCheck(data: any) {
const fetchStockSilo = async (info: any) => { const fetchStockSilo = async (info: any) => {
//console.log("What tpye of info:", info); //console.log("What tpye of info:", info);
const { data } = await axios.post(`/api/logistics/cyclecountcheck`, { const { data } = await axios.post(`/lst/old/api/logistics/cyclecountcheck`, {
age: info.age ? parseInt(info.age) : null, age: info.age ? parseInt(info.age) : null,
type: "", type: "",
}); });

View File

@@ -14,7 +14,7 @@ export function getOpenOrders() {
const fetchStockSilo = async () => { const fetchStockSilo = async () => {
const { data } = await axios.get( const { data } = await axios.get(
`/api/datamart/getopenorders?sDay=15&eDay=45` `/lst/old/api/datamart/getopenorders?sDay=15&eDay=45`,
); );
// if we are not localhost ignore the devDir setting. // if we are not localhost ignore the devDir setting.
//const url: string = window.location.host.split(":")[0]; //const url: string = window.location.host.split(":")[0];

View File

@@ -13,7 +13,7 @@ export function getLanes() {
} }
const fetch = async () => { const fetch = async () => {
const { data } = await axios.get(`/api/logistics/getactivelanes`); const { data } = await axios.get(`/lst/old/api/logistics/getactivelanes`);
// // if we are not localhost ignore the devDir setting. // // if we are not localhost ignore the devDir setting.
// //const url: string = window.location.host.split(":")[0]; // //const url: string = window.location.host.split(":")[0];
return data.data ?? []; return data.data ?? [];

View File

@@ -1,9 +1,26 @@
import { createFileRoute } from "@tanstack/react-router"; import { createFileRoute } from "@tanstack/react-router";
import { AddCards } from "./-components/dashboard/AddCards";
import DashBoard from "./-components/dashboard/Dashboard";
import { useCardStore } from "./-lib/store/useCardStore";
export const Route = createFileRoute("/_old/old/")({ export const Route = createFileRoute("/_old/old/")({
component: RouteComponent, component: RouteComponent,
}); });
function RouteComponent() { function RouteComponent() {
return <div>Missing DashBoard</div>; const { cards } = useCardStore();
return (
<div>
{cards.length > 0 ? (
<DashBoard />
) : (
<div className="m-3">
<span>
Looks like you have no cards added try clicking adding some
</span>{" "}
<AddCards />
</div>
)}
</div>
);
} }

View File

@@ -28,19 +28,21 @@ function RouteComponent() {
const { session } = useAuth(); const { session } = useAuth();
const logout = useLogout(); const logout = useLogout();
//const { settings } = useSettingStore(); //const { settings } = useSettingStore();
console.log(location.pathname);
return ( return (
<div> <div>
<nav className="flex justify-end w-full shadow "> <nav className="flex justify-end w-full shadow ">
<div className="m-2 flex flex-row"> <div className="m-2 flex flex-row">
{/* Inventory section */} {/* Inventory section */}
{location.pathname === "/" && ( {location.pathname === "/lst/app/old" ||
(location.pathname === "/lst/app/old/" && (
<div className="m-auto pr-2 flex flex-row gap-2"> <div className="m-auto pr-2 flex flex-row gap-2">
{/* <ExportInventoryData /> */} {/* <ExportInventoryData /> */}
<AddCards /> <AddCards />
</div> </div>
)} ))}
{/* Demand mgt section this should also include plant token stuff */} {/* Demand mgt section this should also include plant token stuff */}
{location.pathname === "/dm" && ( {location.pathname === "/lst/app/old/dm" && (
<div className="m-auto pr-2 flex flex-row gap-2"> <div className="m-auto pr-2 flex flex-row gap-2">
{/* <DMButtons /> */} {/* <DMButtons /> */}
</div> </div>