fix(ocp): made corrections to the ocp page in dayton

This commit is contained in:
2025-10-31 13:42:35 -05:00
parent 2133b94a1d
commit 92af7262f6
3 changed files with 12 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ import {
TableRow, TableRow,
} from "@/components/ui/table"; } from "@/components/ui/table";
import { useAuth, userAccess } from "@/lib/authClient"; import { useAuth, userAccess } from "@/lib/authClient";
import { useSettingStore } from "../../-lib/store/useSettings"; //import { useSettingStore } from "../../-lib/store/useSettings";
import type { LotType } from "../../-types/lots"; import type { LotType } from "../../-types/lots";
import { getlots } from "../../-utils/querys/ocp/lots"; import { getlots } from "../../-utils/querys/ocp/lots";
import { LstCard } from "../extendedUi/LstCard"; import { LstCard } from "../extendedUi/LstCard";
@@ -67,9 +67,9 @@ export default function Lots() {
const { data, isError, isLoading } = useQuery(getlots()); const { data, isError, isLoading } = useQuery(getlots());
const { session } = useAuth(); const { session } = useAuth();
const { settings } = useSettingStore(); //const { settings } = useSettingStore();
const server = settings.filter((n) => n.name === "dbServer")[0]?.value || ""; //const server = settings.filter((n) => n.name === "dbServer")[0]?.value || "";
const lotdata = data ? data : []; const lotdata = data ? data : [];
const accessRoles = userAccess("ocp", [ const accessRoles = userAccess("ocp", [
@@ -229,7 +229,8 @@ export default function Lots() {
</TableCell> </TableCell>
{session?.user && accessRoles && ( {session?.user && accessRoles && (
<> <>
{server === "usday1vms006" || server === "localhost" ? ( {location.hostname.includes("usday1") ||
location.hostname.includes("localhost") ? (
<> <>
<TableCell className="flex justify-center"> <TableCell className="flex justify-center">
<ManualPrintForm /> <ManualPrintForm />

View File

@@ -37,11 +37,10 @@ const printReason = [
]; ];
export default function ManualPrintForm() { export default function ManualPrintForm() {
const token = localStorage.getItem("auth_token");
const { settings } = useSettingStore(); const { settings } = useSettingStore();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false);
const server = settings.filter((n) => n.name === "server")[0]?.value;
// const serverPort = settings.filter((n) => n.name === "serverPort")[0]?.value; // const serverPort = settings.filter((n) => n.name === "serverPort")[0]?.value;
// const serverUrl = `http://${server}:${serverPort}`; // const serverUrl = `http://${server}:${serverPort}`;
@@ -61,9 +60,7 @@ export default function ManualPrintForm() {
const logdataUrl = `/lst/old/api/ocp/manuallabellog`; const logdataUrl = `/lst/old/api/ocp/manuallabellog`;
setIsSubmitting(true); setIsSubmitting(true);
axios axios
.post(logdataUrl, logData, { .post(logdataUrl, logData, {})
headers: { Authorization: `Bearer ${token}` },
})
.then((d) => { .then((d) => {
console.log(d); console.log(d);
if (d.data.success) { if (d.data.success) {
@@ -135,7 +132,7 @@ export default function ManualPrintForm() {
If you clicked this in error just click close If you clicked this in error just click close
</p> </p>
<hr className="mt-2 mb-2" /> <hr className="mt-2 mb-2" />
{server == "usday1vms006" ? ( {location.hostname.includes("usday1") ? (
<Controller <Controller
control={control} control={control}
name="printReason" name="printReason"
@@ -206,7 +203,7 @@ export default function ManualPrintForm() {
/> />
</div> </div>
<hr /> <hr />
{dyco[0].value === "0" && ( {dyco[0]?.value === "0" && (
<div> <div>
<p>Enter the missing tag number.</p> <p>Enter the missing tag number.</p>
<hr /> <hr />

View File

@@ -5,6 +5,7 @@ import {
} from "@/components/ui/resizable"; } from "@/components/ui/resizable";
import { useSettingStore } from "../../-lib/store/useSettings"; import { useSettingStore } from "../../-lib/store/useSettings";
import WrapperManualTrigger from "../ocme/WrapperCard"; import WrapperManualTrigger from "../ocme/WrapperCard";
//import WrapperManualTrigger from "../ocme/WrapperCard";
import LabelLog from "./LabelLog"; import LabelLog from "./LabelLog";
import LabelRatio from "./LabelRatio"; import LabelRatio from "./LabelRatio";
import Lots from "./Lots"; import Lots from "./Lots";
@@ -15,8 +16,6 @@ export default function OCPPage() {
const { settings } = useSettingStore(); const { settings } = useSettingStore();
if (settings.length === 0) return; if (settings.length === 0) return;
let token = settings.filter((n) => n.name === "plantToken");
return ( return (
<div className="ml-5 w-11/12 h-9/10"> <div className="ml-5 w-11/12 h-9/10">
<ResizablePanelGroup <ResizablePanelGroup
@@ -62,8 +61,8 @@ export default function OCPPage() {
<ResizableHandle /> <ResizableHandle />
<ResizablePanel className="min-h-[200px] min-w-[200px] max-w-[450px]"> <ResizablePanel className="min-h-[200px] min-w-[200px] max-w-[450px]">
<ResizablePanelGroup direction="vertical" autoSaveId="ocpPage_vert"> <ResizablePanelGroup direction="vertical" autoSaveId="ocpPage_vert">
{token[0].value === "usday1vms006" || {location.hostname.includes("usday1") ||
(location.pathname === "localhost" && ( (location.hostname === "localhost" && (
<ResizablePanel <ResizablePanel
style={{ style={{
overflow: "auto", overflow: "auto",