fix(ocp): made corrections to the ocp page in dayton
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
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 { getlots } from "../../-utils/querys/ocp/lots";
|
||||
import { LstCard } from "../extendedUi/LstCard";
|
||||
@@ -67,9 +67,9 @@ export default function Lots() {
|
||||
const { data, isError, isLoading } = useQuery(getlots());
|
||||
|
||||
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 accessRoles = userAccess("ocp", [
|
||||
@@ -229,7 +229,8 @@ export default function Lots() {
|
||||
</TableCell>
|
||||
{session?.user && accessRoles && (
|
||||
<>
|
||||
{server === "usday1vms006" || server === "localhost" ? (
|
||||
{location.hostname.includes("usday1") ||
|
||||
location.hostname.includes("localhost") ? (
|
||||
<>
|
||||
<TableCell className="flex justify-center">
|
||||
<ManualPrintForm />
|
||||
|
||||
@@ -37,11 +37,10 @@ const printReason = [
|
||||
];
|
||||
|
||||
export default function ManualPrintForm() {
|
||||
const token = localStorage.getItem("auth_token");
|
||||
const { settings } = useSettingStore();
|
||||
const [open, setOpen] = 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 serverUrl = `http://${server}:${serverPort}`;
|
||||
|
||||
@@ -61,9 +60,7 @@ export default function ManualPrintForm() {
|
||||
const logdataUrl = `/lst/old/api/ocp/manuallabellog`;
|
||||
setIsSubmitting(true);
|
||||
axios
|
||||
.post(logdataUrl, logData, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
.post(logdataUrl, logData, {})
|
||||
.then((d) => {
|
||||
console.log(d);
|
||||
if (d.data.success) {
|
||||
@@ -135,7 +132,7 @@ export default function ManualPrintForm() {
|
||||
If you clicked this in error just click close
|
||||
</p>
|
||||
<hr className="mt-2 mb-2" />
|
||||
{server == "usday1vms006" ? (
|
||||
{location.hostname.includes("usday1") ? (
|
||||
<Controller
|
||||
control={control}
|
||||
name="printReason"
|
||||
@@ -206,7 +203,7 @@ export default function ManualPrintForm() {
|
||||
/>
|
||||
</div>
|
||||
<hr />
|
||||
{dyco[0].value === "0" && (
|
||||
{dyco[0]?.value === "0" && (
|
||||
<div>
|
||||
<p>Enter the missing tag number.</p>
|
||||
<hr />
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
} from "@/components/ui/resizable";
|
||||
import { useSettingStore } from "../../-lib/store/useSettings";
|
||||
import WrapperManualTrigger from "../ocme/WrapperCard";
|
||||
//import WrapperManualTrigger from "../ocme/WrapperCard";
|
||||
import LabelLog from "./LabelLog";
|
||||
import LabelRatio from "./LabelRatio";
|
||||
import Lots from "./Lots";
|
||||
@@ -15,8 +16,6 @@ export default function OCPPage() {
|
||||
const { settings } = useSettingStore();
|
||||
|
||||
if (settings.length === 0) return;
|
||||
let token = settings.filter((n) => n.name === "plantToken");
|
||||
|
||||
return (
|
||||
<div className="ml-5 w-11/12 h-9/10">
|
||||
<ResizablePanelGroup
|
||||
@@ -62,8 +61,8 @@ export default function OCPPage() {
|
||||
<ResizableHandle />
|
||||
<ResizablePanel className="min-h-[200px] min-w-[200px] max-w-[450px]">
|
||||
<ResizablePanelGroup direction="vertical" autoSaveId="ocpPage_vert">
|
||||
{token[0].value === "usday1vms006" ||
|
||||
(location.pathname === "localhost" && (
|
||||
{location.hostname.includes("usday1") ||
|
||||
(location.hostname === "localhost" && (
|
||||
<ResizablePanel
|
||||
style={{
|
||||
overflow: "auto",
|
||||
|
||||
Reference in New Issue
Block a user