feat(settings): final migration of settings and edits added
This commit is contained in:
20
LogisticsSupportTool_API_DOCS/app/system/Update Setting.bru
Normal file
20
LogisticsSupportTool_API_DOCS/app/system/Update Setting.bru
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
meta {
|
||||||
|
name: Update Setting
|
||||||
|
type: http
|
||||||
|
seq: 4
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: {{url}}/lst/api/system/settings/:token
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
params:path {
|
||||||
|
token:
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
@@ -219,9 +219,9 @@ const main = async () => {
|
|||||||
addListeners();
|
addListeners();
|
||||||
//userMigrate();
|
//userMigrate();
|
||||||
// some temp fixes
|
// some temp fixes
|
||||||
// above 230 remove these
|
// above 235 remove these
|
||||||
manualFixes();
|
manualFixes();
|
||||||
settingsMigrate();
|
//settingsMigrate();
|
||||||
}, 5 * 1000);
|
}, 5 * 1000);
|
||||||
|
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
|
|||||||
@@ -5,66 +5,31 @@ import { Router } from "express";
|
|||||||
import https from "https";
|
import https from "https";
|
||||||
import { db } from "../../../../pkg/db/db.js";
|
import { db } from "../../../../pkg/db/db.js";
|
||||||
import { serverData } from "../../../../pkg/db/schema/servers.js";
|
import { serverData } from "../../../../pkg/db/schema/servers.js";
|
||||||
|
import { settings } from "../../../../pkg/db/schema/settings.js";
|
||||||
import { createLogger } from "../../../../pkg/logger/logger.js";
|
import { createLogger } from "../../../../pkg/logger/logger.js";
|
||||||
import { tryCatch } from "../../../../pkg/utils/tryCatch.js";
|
import { tryCatch } from "../../../../pkg/utils/tryCatch.js";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.patch("/:token", async (req: Request, res: Response) => {
|
router.patch("/:id", async (req: Request, res: Response) => {
|
||||||
const log = createLogger({ module: "admin", subModule: "update server" });
|
const log = createLogger({ module: "admin", subModule: "update setting" });
|
||||||
|
|
||||||
// when a server is updated and is posted from localhost or 127.0.0.1 we also want to post it to the test server so we can see it from there, we want to insert with update on conflict.
|
// when a server is updated and is posted from localhost or 127.0.0.1 we also want to post it to the test server so we can see it from there, we want to insert with update on conflict.
|
||||||
const token = req.params.token;
|
const id = req.params.id;
|
||||||
const updates: Record<string, any> = {};
|
const updates: Record<string, any> = {};
|
||||||
|
|
||||||
if (req.body?.name !== undefined) {
|
if (req.body?.name !== undefined) {
|
||||||
updates.name = req.body.name;
|
updates.name = req.body.name;
|
||||||
}
|
}
|
||||||
if (req.body?.serverDNS !== undefined) {
|
if (req.body?.value !== undefined) {
|
||||||
updates.serverDNS = req.body.serverDNS;
|
updates.value = req.body.value;
|
||||||
}
|
}
|
||||||
if (req.body?.ipAddress !== undefined) {
|
if (req.body?.description !== undefined) {
|
||||||
updates.ipAddress = req.body.ipAddress;
|
updates.description = req.body.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.body?.greatPlainsPlantCode !== undefined) {
|
if (req.body?.moduleName !== undefined) {
|
||||||
updates.greatPlainsPlantCode = req.body.greatPlainsPlantCode;
|
updates.moduleName = req.body.moduleName;
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.lstServerPort !== undefined) {
|
|
||||||
updates.lstServerPort = req.body.lstServerPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.serverLoc !== undefined) {
|
|
||||||
updates.serverLoc = req.body.serverLoc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.streetAddress !== undefined) {
|
|
||||||
updates.streetAddress = req.body.streetAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.cityState !== undefined) {
|
|
||||||
updates.cityState = req.body.cityState;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.zipcode !== undefined) {
|
|
||||||
updates.zipcode = req.body.zipcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.contactEmail !== undefined) {
|
|
||||||
updates.contactEmail = req.body.contactEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.contactPhone !== undefined) {
|
|
||||||
updates.contactPhone = req.body.contactPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.customerTiAcc !== undefined) {
|
|
||||||
updates.customerTiAcc = req.body.customerTiAcc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.body?.active !== undefined) {
|
|
||||||
updates.active = req.body.active;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updates.upd_user = req.user!.username || "lst_user";
|
updates.upd_user = req.user!.username || "lst_user";
|
||||||
@@ -73,65 +38,12 @@ router.patch("/:token", async (req: Request, res: Response) => {
|
|||||||
try {
|
try {
|
||||||
if (Object.keys(updates).length > 0) {
|
if (Object.keys(updates).length > 0) {
|
||||||
await db
|
await db
|
||||||
.update(serverData)
|
.update(settings)
|
||||||
.set(updates)
|
.set(updates)
|
||||||
.where(eq(serverData.plantToken, token));
|
.where(eq(settings.settings_id, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.hostname === "localhost" && process.env.MAIN_SERVER) {
|
res.status(200).json({ message: `Setting was just updated` });
|
||||||
log.info({}, "Running in dev server about to add in a new server");
|
|
||||||
const axiosInstance = axios.create({
|
|
||||||
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
|
||||||
baseURL: process.env.MAIN_SERVER,
|
|
||||||
withCredentials: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const loginRes = (await axiosInstance.post(
|
|
||||||
`${process.env.MAIN_SERVER}/lst/api/auth/sign-in/username`,
|
|
||||||
{
|
|
||||||
username: process.env.MAIN_SERVER_USERNAME,
|
|
||||||
password: process.env.MAIN_SERVER_PASSWORD,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
},
|
|
||||||
)) as any;
|
|
||||||
|
|
||||||
const setCookie = loginRes?.headers["set-cookie"][0];
|
|
||||||
|
|
||||||
//console.log(setCookie.split(";")[0].replace("__Secure-", ""));
|
|
||||||
|
|
||||||
if (!setCookie) {
|
|
||||||
throw new Error("Did not receive a Set-Cookie header from login");
|
|
||||||
}
|
|
||||||
|
|
||||||
const { data, error } = await tryCatch(
|
|
||||||
axios.patch(
|
|
||||||
`${process.env.MAIN_SERVER}/lst/api/admin/server/${token}`,
|
|
||||||
updates,
|
|
||||||
{
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
Cookie: setCookie.split(";")[0],
|
|
||||||
},
|
|
||||||
withCredentials: true,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
console.log(error);
|
|
||||||
log.error(
|
|
||||||
{ stack: error },
|
|
||||||
"There was an error adding the server to Main Server",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
log.info(
|
|
||||||
{ stack: data?.data },
|
|
||||||
"A new Server was just added to the server.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
res.status(200).json({ message: `${token} Server was just updated` });
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
res.status(400).json({ message: "Error Server updated", error });
|
res.status(400).json({ message: "Error Server updated", error });
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ export const addListeners = async () => {
|
|||||||
|
|
||||||
// all the migration stuff that will need to be moved later build 230 and above will need to remove
|
// all the migration stuff that will need to be moved later build 230 and above will need to remove
|
||||||
export const manualFixes = async () => {
|
export const manualFixes = async () => {
|
||||||
const fixQuery = `ALTER TABLE "serverData" ADD CONSTRAINT "serverData_name_unique" UNIQUE("name");`;
|
|
||||||
|
|
||||||
const log = createLogger({ module: "utils", subModule: "manual fixes" });
|
const log = createLogger({ module: "utils", subModule: "manual fixes" });
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
connectionString: `postgresql://${process.env.DATABASE_USER}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}:${process.env.DATABASE_PORT}/${process.env.DATABASE_DB}`,
|
connectionString: `postgresql://${process.env.DATABASE_USER}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}:${process.env.DATABASE_PORT}/${process.env.DATABASE_DB}`,
|
||||||
@@ -74,12 +72,16 @@ export const manualFixes = async () => {
|
|||||||
|
|
||||||
await client.connect();
|
await client.connect();
|
||||||
|
|
||||||
try {
|
/**
|
||||||
log.info({}, "Running the manual fix");
|
* The fix to correct the constraint on the server data
|
||||||
await client.query(fixQuery);
|
*/
|
||||||
} catch (e) {
|
// const fixQuery = `ALTER TABLE "serverData" ADD CONSTRAINT "serverData_name_unique" UNIQUE("name");`;
|
||||||
log.info({ error: e }, "Fix was not completed");
|
// try {
|
||||||
}
|
// log.info({}, "Running the manual fix");
|
||||||
|
// await client.query(fixQuery);
|
||||||
|
// } catch (e) {
|
||||||
|
// log.info({ error: e }, "Fix was not completed");
|
||||||
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
export const settingsMigrate = async () => {
|
export const settingsMigrate = async () => {
|
||||||
|
|||||||
18
frontend/src/lib/querys/admin/getSettings.ts
Normal file
18
frontend/src/lib/querys/admin/getSettings.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { keepPreviousData, queryOptions } from "@tanstack/react-query";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export function getSettings() {
|
||||||
|
return queryOptions({
|
||||||
|
queryKey: ["getSettings"],
|
||||||
|
queryFn: () => fetchSession(),
|
||||||
|
staleTime: 5000,
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
|
placeholderData: keepPreviousData,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const fetchSession = async () => {
|
||||||
|
const { data } = await axios.get("/lst/api/system/settings");
|
||||||
|
|
||||||
|
return data.data;
|
||||||
|
};
|
||||||
26
frontend/src/lib/tableStuff/GenericColumn.tsx
Normal file
26
frontend/src/lib/tableStuff/GenericColumn.tsx
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { createColumnHelper } from "@tanstack/react-table";
|
||||||
|
import { ArrowDown, ArrowUp } from "lucide-react";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
export const GenericColumn = ({ columnName }: { columnName: string }) => {
|
||||||
|
const columnHelper = createColumnHelper();
|
||||||
|
|
||||||
|
return columnHelper.accessor(`${columnName}`, {
|
||||||
|
header: ({ column }) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
|
||||||
|
>
|
||||||
|
<span className="flex flex-row gap-2">{`${columnName.toUpperCase()}`}</span>
|
||||||
|
{column.getIsSorted() === "asc" ? (
|
||||||
|
<ArrowUp className="ml-2 h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown className="ml-2 h-4 w-4" />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
cell: (i) => i.getValue(),
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
flexRender,
|
flexRender,
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
getPaginationRowModel,
|
getPaginationRowModel,
|
||||||
getSortedRowModel,
|
getSortedRowModel,
|
||||||
type SortingState,
|
type SortingState,
|
||||||
@@ -26,6 +27,9 @@ export default function TableNoExpand({
|
|||||||
columns: any;
|
columns: any;
|
||||||
}) {
|
}) {
|
||||||
const [sorting, setSorting] = useState<SortingState>([]);
|
const [sorting, setSorting] = useState<SortingState>([]);
|
||||||
|
// const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
// []
|
||||||
|
// )
|
||||||
const table = useReactTable({
|
const table = useReactTable({
|
||||||
data,
|
data,
|
||||||
columns,
|
columns,
|
||||||
@@ -33,11 +37,14 @@ export default function TableNoExpand({
|
|||||||
getPaginationRowModel: getPaginationRowModel(),
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
onSortingChange: setSorting,
|
onSortingChange: setSorting,
|
||||||
getSortedRowModel: getSortedRowModel(),
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
|
||||||
//renderSubComponent: ({ row }: { row: any }) => <ExpandedRow row={row} />,
|
//renderSubComponent: ({ row }: { row: any }) => <ExpandedRow row={row} />,
|
||||||
//getRowCanExpand: () => true,
|
//getRowCanExpand: () => true,
|
||||||
|
filterFns: {},
|
||||||
state: {
|
state: {
|
||||||
sorting,
|
sorting,
|
||||||
|
//columnFilters
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,31 @@
|
|||||||
import { createFileRoute, Link, Outlet } from "@tanstack/react-router";
|
import {
|
||||||
|
createFileRoute,
|
||||||
|
Link,
|
||||||
|
Outlet,
|
||||||
|
redirect,
|
||||||
|
} from "@tanstack/react-router";
|
||||||
|
import { checkUserAccess } from "@/lib/authClient";
|
||||||
|
|
||||||
export const Route = createFileRoute("/_app/_adminLayout/admin/_system")({
|
export const Route = createFileRoute("/_app/_adminLayout/admin/_system")({
|
||||||
component: RouteComponent,
|
component: RouteComponent,
|
||||||
|
beforeLoad: async () => {
|
||||||
|
const auth = await checkUserAccess({
|
||||||
|
allowedRoles: ["systemAdmin", "admin"],
|
||||||
|
moduleName: "system", // optional
|
||||||
|
});
|
||||||
|
|
||||||
|
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() {
|
function RouteComponent() {
|
||||||
|
|||||||
@@ -1,11 +1,230 @@
|
|||||||
import { createFileRoute } from '@tanstack/react-router'
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { createColumnHelper } from "@tanstack/react-table";
|
||||||
|
import axios from "axios";
|
||||||
|
import { ArrowDown, ArrowUp } from "lucide-react";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import { toast } from "sonner";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { getSettings } from "@/lib/querys/admin/getSettings";
|
||||||
|
import TableNoExpand from "@/lib/tableStuff/TableNoExpand";
|
||||||
|
|
||||||
|
type Settings = {
|
||||||
|
settings_id: string;
|
||||||
|
name: string;
|
||||||
|
active: boolean;
|
||||||
|
value: string;
|
||||||
|
description: string;
|
||||||
|
moduleName: string;
|
||||||
|
roles: string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateSettings = async (
|
||||||
|
id: string,
|
||||||
|
data: Record<string, string | number | boolean | null>,
|
||||||
|
) => {
|
||||||
|
console.log(id, data);
|
||||||
|
try {
|
||||||
|
const res = await axios.patch(`/lst/api/system/settings/${id}`, data, {
|
||||||
|
withCredentials: true,
|
||||||
|
});
|
||||||
|
toast.success(`Setting just updated`);
|
||||||
|
return res;
|
||||||
|
} catch (err) {
|
||||||
|
toast.error("Error in updating the settings");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const Route = createFileRoute(
|
export const Route = createFileRoute(
|
||||||
'/_app/_adminLayout/admin/_system/settings',
|
"/_app/_adminLayout/admin/_system/settings",
|
||||||
)({
|
)({
|
||||||
component: RouteComponent,
|
component: RouteComponent,
|
||||||
})
|
});
|
||||||
|
|
||||||
function RouteComponent() {
|
function RouteComponent() {
|
||||||
return <div>Hello "/_app/_adminLayout/admin/_system/settings"!</div>
|
const { data, isLoading, refetch } = useQuery(getSettings());
|
||||||
|
const columnHelper = createColumnHelper<Settings>();
|
||||||
|
const submitting = useRef(false);
|
||||||
|
|
||||||
|
const updateSetting = useMutation({
|
||||||
|
mutationFn: ({
|
||||||
|
id,
|
||||||
|
field,
|
||||||
|
value,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
field: string;
|
||||||
|
value: string | number | boolean | null;
|
||||||
|
}) => updateSettings(id, { [field]: value }),
|
||||||
|
|
||||||
|
onSuccess: () => {
|
||||||
|
// refetch or update cache
|
||||||
|
refetch();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
columnHelper.accessor("name", {
|
||||||
|
header: ({ column }) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
|
||||||
|
>
|
||||||
|
<span className="flex flex-row gap-2">Name</span>
|
||||||
|
{column.getIsSorted() === "asc" ? (
|
||||||
|
<ArrowUp className="ml-2 h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown className="ml-2 h-4 w-4" />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
cell: (i) => i.getValue(),
|
||||||
|
}),
|
||||||
|
columnHelper.accessor("description", {
|
||||||
|
header: ({ column }) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
|
||||||
|
>
|
||||||
|
<span className="flex flex-row gap-2">Description</span>
|
||||||
|
{column.getIsSorted() === "asc" ? (
|
||||||
|
<ArrowUp className="ml-2 h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown className="ml-2 h-4 w-4" />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
cell: (i) => i.getValue(),
|
||||||
|
}),
|
||||||
|
columnHelper.accessor("value", {
|
||||||
|
header: ({ column }) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
|
||||||
|
>
|
||||||
|
<span className="flex flex-row gap-2">Value</span>
|
||||||
|
{column.getIsSorted() === "asc" ? (
|
||||||
|
<ArrowUp className="ml-2 h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown className="ml-2 h-4 w-4" />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
cell: ({ row, getValue }) => {
|
||||||
|
const initialValue = String(getValue() ?? "");
|
||||||
|
const [localValue, setLocalValue] = useState(initialValue);
|
||||||
|
|
||||||
|
const id = row.original.settings_id;
|
||||||
|
const field = "value";
|
||||||
|
|
||||||
|
useEffect(() => setLocalValue(initialValue), [initialValue]);
|
||||||
|
|
||||||
|
const handleSubmit = (newValue: string) => {
|
||||||
|
if (newValue !== initialValue) {
|
||||||
|
setLocalValue(newValue);
|
||||||
|
updateSetting.mutate({ id, field, value: newValue });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Input
|
||||||
|
value={localValue}
|
||||||
|
onChange={(e) => setLocalValue(e.currentTarget.value)}
|
||||||
|
onBlur={(e) => {
|
||||||
|
if (!submitting.current) {
|
||||||
|
submitting.current = true;
|
||||||
|
handleSubmit(e.currentTarget.value.trim());
|
||||||
|
setTimeout(() => (submitting.current = false), 100); // reset after slight delay
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
e.preventDefault();
|
||||||
|
submitting.current = true;
|
||||||
|
handleSubmit(e.currentTarget.value.trim());
|
||||||
|
e.currentTarget.blur(); // will trigger blur, but we ignore it
|
||||||
|
setTimeout(() => (submitting.current = false), 100);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
columnHelper.accessor("moduleName", {
|
||||||
|
header: ({ column }) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
|
||||||
|
>
|
||||||
|
<span className="flex flex-row gap-2">Module Name</span>
|
||||||
|
{column.getIsSorted() === "asc" ? (
|
||||||
|
<ArrowUp className="ml-2 h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ArrowDown className="ml-2 h-4 w-4" />
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
cell: ({ row, getValue }) => {
|
||||||
|
const initialValue = String(getValue() ?? "");
|
||||||
|
const [localValue, setLocalValue] = useState(initialValue);
|
||||||
|
|
||||||
|
const id = row.original.settings_id;
|
||||||
|
const field = "moduleName";
|
||||||
|
|
||||||
|
useEffect(() => setLocalValue(initialValue), [initialValue]);
|
||||||
|
|
||||||
|
const handleSubmit = (newValue: string) => {
|
||||||
|
if (newValue !== initialValue) {
|
||||||
|
setLocalValue(newValue);
|
||||||
|
updateSetting.mutate({ id, field, value: newValue });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Input
|
||||||
|
value={localValue}
|
||||||
|
onChange={(e) => setLocalValue(e.currentTarget.value)}
|
||||||
|
onBlur={(e) => {
|
||||||
|
if (!submitting.current) {
|
||||||
|
submitting.current = true;
|
||||||
|
handleSubmit(e.currentTarget.value.trim());
|
||||||
|
setTimeout(() => (submitting.current = false), 100); // reset after slight delay
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
e.preventDefault();
|
||||||
|
submitting.current = true;
|
||||||
|
handleSubmit(e.currentTarget.value.trim());
|
||||||
|
e.currentTarget.blur(); // will trigger blur, but we ignore it
|
||||||
|
setTimeout(() => (submitting.current = false), 100);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isLoading)
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<span>Loading settings data</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<div className="m-2">
|
||||||
|
<TableNoExpand data={data} columns={columns} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Client } from "pg";
|
import { Client } from "pg";
|
||||||
|
import { db } from "../../../../../database/dbclient.js";
|
||||||
|
import { settings } from "../../../../../database/schema/settings.js";
|
||||||
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
||||||
import type { Settings } from "../../../../types/settings.js";
|
import type { Settings } from "../../../../types/settings.js";
|
||||||
import { createLog } from "../../../logger/logger.js";
|
import { createLog } from "../../../logger/logger.js";
|
||||||
|
|
||||||
export let serverSettings: Settings[];
|
export let serverSettings: Settings[] = [];
|
||||||
export const getSettings = async () => {
|
export const getSettings = async () => {
|
||||||
const settingsType = process.env.LST_USE_GO;
|
const settingsType = process.env.LST_USE_GO;
|
||||||
createLog(
|
createLog(
|
||||||
@@ -22,7 +24,7 @@ export const getSettings = async () => {
|
|||||||
|
|
||||||
//if (settingsType !== "true") {
|
//if (settingsType !== "true") {
|
||||||
try {
|
try {
|
||||||
// serverSettings = (await db.select().from(settings)) as any;
|
//serverSettings = (await db.select().from(settings)) as any;
|
||||||
const dbUrl = String(process.env.DATABASE_URL).replace("lst_db", "lst");
|
const dbUrl = String(process.env.DATABASE_URL).replace("lst_db", "lst");
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
connectionString: dbUrl,
|
connectionString: dbUrl,
|
||||||
@@ -30,33 +32,37 @@ export const getSettings = async () => {
|
|||||||
|
|
||||||
await client.connect();
|
await client.connect();
|
||||||
|
|
||||||
try {
|
if (serverSettings.length === 0) {
|
||||||
const s = await client.query("SELECT * FROM settings");
|
try {
|
||||||
|
const s = await client.query("SELECT * FROM settings");
|
||||||
|
|
||||||
serverSettings = s.rows;
|
serverSettings = s.rows;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// const { data, error } = (await tryCatch(
|
||||||
|
// axios.get(
|
||||||
|
// `http://localhost:${process.env.VITE_SERVER_PORT}/lst/api/system/settings`,
|
||||||
|
// ),
|
||||||
|
// )) as any;
|
||||||
|
|
||||||
|
// if (error) {
|
||||||
|
// createLog(
|
||||||
|
// "error",
|
||||||
|
// "lst",
|
||||||
|
// "server",
|
||||||
|
// "There was an error getting the settings",
|
||||||
|
// );
|
||||||
|
// throw new Error("There was an error getting the settings");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//serverSettings = data.data.data;
|
||||||
|
} else {
|
||||||
|
return serverSettings;
|
||||||
}
|
}
|
||||||
//.where(sql`${userRole} = ANY(roles)`);
|
|
||||||
|
|
||||||
// const { data, error } = (await tryCatch(
|
|
||||||
// axios.get(
|
|
||||||
// `http://localhost:${process.env.VITE_SERVER_PORT}/lst/api/system/settings`,
|
|
||||||
// ),
|
|
||||||
// )) as any;
|
|
||||||
|
|
||||||
// if (error) {
|
|
||||||
// createLog(
|
|
||||||
// "error",
|
|
||||||
// "lst",
|
|
||||||
// "server",
|
|
||||||
// "There was an error getting the settings",
|
|
||||||
// );
|
|
||||||
// throw new Error("There was an error getting the settings");
|
|
||||||
// }
|
|
||||||
|
|
||||||
//serverSettings = data.data.data;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
createLog(
|
createLog(
|
||||||
"error",
|
"error",
|
||||||
"lst",
|
"lst",
|
||||||
|
|||||||
@@ -1,381 +1,385 @@
|
|||||||
{
|
{
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
"sName": "Test",
|
"sName": "Test",
|
||||||
"serverDNS": "usmcd1vms036",
|
"serverDNS": "usmcd1vms036",
|
||||||
"plantToken": "test3",
|
"plantToken": "test3",
|
||||||
"idAdress": "10.193.0.56",
|
"idAdress": "10.193.0.56",
|
||||||
"greatPlainsPlantCode": "1",
|
"greatPlainsPlantCode": "1",
|
||||||
"streetAddress": "289 GA-155 S",
|
"streetAddress": "289 GA-155 S",
|
||||||
"cityState": "McDonough, GA",
|
"cityState": "McDonough, GA",
|
||||||
"zipcode": "30253",
|
"zipcode": "30253",
|
||||||
"contactEmail": "noreply@alpla.com",
|
"contactEmail": "noreply@alpla.com",
|
||||||
"contactPhone": "770-914-1407",
|
"contactPhone": "770-914-1407",
|
||||||
"customerTiAcc": "ALPLA01INTGROUP",
|
"customerTiAcc": "ALPLA01INTGROUP",
|
||||||
"lstServerPort": "3000",
|
"lstServerPort": "3000",
|
||||||
"active": true,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sName": "Bethlehem",
|
"sName": "Bethlehem",
|
||||||
"serverDNS": "usbet1vms006",
|
"serverDNS": "usbet1vms006",
|
||||||
"plantToken": "usbet1",
|
"plantToken": "usbet1",
|
||||||
"idAddress": "10.204.0.26",
|
"idAddress": "10.204.0.26",
|
||||||
"greatPlainsPlantCode": "75",
|
"greatPlainsPlantCode": "75",
|
||||||
"streetAddress": "2120 Spillman Dr",
|
"streetAddress": "2120 Spillman Dr",
|
||||||
"cityState": "Bethlehem, PA",
|
"cityState": "Bethlehem, PA",
|
||||||
"zipcode": "18015",
|
"zipcode": "18015",
|
||||||
"contactEmail": "ShippingReceivingBethlehem@groups.alpla.com",
|
"contactEmail": "ShippingReceivingBethlehem@groups.alpla.com",
|
||||||
"contactPhone": "6103902380",
|
"contactPhone": "6103902380",
|
||||||
"customerTiAcc": "ALPL01BETHINT",
|
"customerTiAcc": "ALPL01BETHINT",
|
||||||
"lstServerPort": "3000",
|
"lstServerPort": "3000",
|
||||||
"active": true,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"otherSettings": [
|
"otherSettings": [
|
||||||
{
|
{
|
||||||
"specialInstructions": "PLEASE CONTACT ShippingReceivingBethlehem@groups.alpla.com WITH ANY QUESTIONS"
|
"specialInstructions": "PLEASE CONTACT ShippingReceivingBethlehem@groups.alpla.com WITH ANY QUESTIONS"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sName": "Huston",
|
"sName": "Huston",
|
||||||
"serverDNS": "ushou1vms006",
|
"serverDNS": "ushou1vms006",
|
||||||
"plantToken": "ushou1",
|
"plantToken": "ushou1",
|
||||||
"idAddress": "10.195.0.26",
|
"idAddress": "10.195.0.26",
|
||||||
"greatPlainsPlantCode": "20",
|
"greatPlainsPlantCode": "20",
|
||||||
"streetAddress": "5800 Armour Dr",
|
"streetAddress": "5800 Armour Dr",
|
||||||
"cityState": "Houston, TX",
|
"cityState": "Houston, TX",
|
||||||
"zipcode": "77020",
|
"zipcode": "77020",
|
||||||
"contactEmail": "blake.matthes@alpla.com",
|
"contactEmail": "blake.matthes@alpla.com",
|
||||||
"contactPhone": "6366970253",
|
"contactPhone": "6366970253",
|
||||||
"customerTiAcc": "ALPL01HOUSINT",
|
"customerTiAcc": "ALPL01HOUSINT",
|
||||||
"lstServerPort": "3000",
|
"lstServerPort": "3000",
|
||||||
"active": true,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sName": "Bowling Green 1",
|
"sName": "Bowling Green 1",
|
||||||
"serverDNS": "usbow1vms006",
|
"serverDNS": "usbow1vms006",
|
||||||
"plantToken": "usbow1",
|
"plantToken": "usbow1",
|
||||||
"idAddress": "10.25.0.26",
|
"idAddress": "10.25.0.26",
|
||||||
"greatPlainsPlantCode": "55",
|
"greatPlainsPlantCode": "55",
|
||||||
"streetAddress": "215 Technology Way",
|
"streetAddress": "215 Technology Way",
|
||||||
"cityState": "Bowling Green, KY",
|
"cityState": "Bowling Green, KY",
|
||||||
"zipcode": "42101",
|
"zipcode": "42101",
|
||||||
"contactEmail": "ShippingReceivingBowlingGreen1@groups.alpla.com",
|
"contactEmail": "ShippingReceivingBowlingGreen1@groups.alpla.com",
|
||||||
"contactPhone": "(270) 495-6647",
|
"contactPhone": "(270) 495-6647",
|
||||||
"customerTiAcc": "ALPL01BG1INT",
|
"customerTiAcc": "ALPL01BG1INT",
|
||||||
"lstServerPort": "3000",
|
"lstServerPort": "3000",
|
||||||
"active": true,
|
"active": true,
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:00\"}]",
|
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:00\"}]",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"otherSettings": [
|
"otherSettings": [
|
||||||
{
|
{
|
||||||
"specialInstructions": "Please be sure to schedule a pick up appointment and bring 2 load bars to secure the load."
|
"specialInstructions": "Please contact ShippingReceivingBowlingGreen1@groups.alpla.com to schedule a pick up appointment and bring 2 load bars to secure the load."
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
},
|
"destinationInstructions": [
|
||||||
{
|
{
|
||||||
"sName": "Iowa ISBM",
|
"customerID": 96,
|
||||||
"serverDNS": "usiow1vms006",
|
"instructions": "Delivery appointments must be scheduled at least 48 hours in advance—no same day appointments. Delivery appointments can be scheduled via RMlmwdockscheduling@LyonsMagnus.com Phone #- 559-268-5966 ext 1158."
|
||||||
"plantToken": "usiow2",
|
}
|
||||||
"idAddress": "10.75.0.26",
|
]
|
||||||
"greatPlainsPlantCode": "31",
|
}
|
||||||
"streetAddress": "2670 INDEPENDENCE RD",
|
]
|
||||||
"cityState": "Iowa CIty, IA",
|
},
|
||||||
"zipcode": "52240",
|
{
|
||||||
"contactEmail": "Dalina.Lacy@alpla.com",
|
"sName": "Iowa ISBM",
|
||||||
"contactPhone": "",
|
"serverDNS": "usiow1vms006",
|
||||||
"customerTiAcc": "ALPL01IA2INT",
|
"plantToken": "usiow2",
|
||||||
"lstServerPort": "3001",
|
"idAddress": "10.75.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "31",
|
||||||
"serverLoc": "D:\\LST\\lstv2_2",
|
"streetAddress": "2670 INDEPENDENCE RD",
|
||||||
"oldVersion": "D:\\LST\\lst_backend_2",
|
"cityState": "Iowa CIty, IA",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "52240",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "Dalina.Lacy@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "[header]" }]
|
"contactPhone": "",
|
||||||
},
|
"customerTiAcc": "ALPL01IA2INT",
|
||||||
{
|
"lstServerPort": "3001",
|
||||||
"sName": "Kansas City",
|
"active": true,
|
||||||
"serverDNS": "usksc1vms006",
|
"serverLoc": "D:\\LST\\lstv2_2",
|
||||||
"plantToken": "usksc1",
|
"oldVersion": "D:\\LST\\lst_backend_2",
|
||||||
"idAddress": "10.42.9.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "85",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "1800 E 94th St Suite 300",
|
"otherSettings": [{ "specialInstructions": "[header]" }]
|
||||||
"cityState": "Kansas City, MO",
|
},
|
||||||
"zipcode": "64131",
|
{
|
||||||
"contactEmail": "blake.matthes@alpla.com",
|
"sName": "Kansas City",
|
||||||
"contactPhone": "6366970253",
|
"serverDNS": "usksc1vms006",
|
||||||
"customerTiAcc": "ALPL01KCINT",
|
"plantToken": "usksc1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.42.9.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "85",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "1800 E 94th St Suite 300",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Kansas City, MO",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "64131",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "blake.matthes@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "6366970253",
|
||||||
},
|
"customerTiAcc": "ALPL01KCINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Bowling Green 2",
|
"active": true,
|
||||||
"serverDNS": "usbow2vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usbow2",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.106.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "56",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "377 Southwood Ct",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Bowling Green, KY",
|
},
|
||||||
"zipcode": "42101",
|
{
|
||||||
"contactEmail": "blake.matthes@alpla.com",
|
"sName": "Bowling Green 2",
|
||||||
"contactPhone": "6366970253",
|
"serverDNS": "usbow2vms006",
|
||||||
"customerTiAcc": "ALPL01BG2INT",
|
"plantToken": "usbow2",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.106.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "56",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "377 Southwood Ct",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Bowling Green, KY",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "42101",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "blake.matthes@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "6366970253",
|
||||||
},
|
"customerTiAcc": "ALPL01BG2INT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "MCDonough",
|
"active": true,
|
||||||
"serverDNS": "usmcd1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usmcd1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.193.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "10",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "289 GA-155 S",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "McDonough, GA",
|
},
|
||||||
"zipcode": "30253",
|
{
|
||||||
"contactEmail": "shippingreceivingmcdonough@groups.alpla.com",
|
"sName": "MCDonough",
|
||||||
"contactPhone": "4049663122",
|
"serverDNS": "usmcd1vms006",
|
||||||
"customerTiAcc": "ALPL01MCDINT",
|
"plantToken": "usmcd1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.193.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "10",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "289 GA-155 S",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "McDonough, GA",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "30253",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "shippingreceivingmcdonough@groups.alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "4049663122",
|
||||||
},
|
"customerTiAcc": "ALPL01MCDINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Dayton",
|
"active": true,
|
||||||
"serverDNS": "usday1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usday1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.44.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "80",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "2700 Concorde Dr Suite 200",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Vandalia, OH",
|
},
|
||||||
"zipcode": "45377",
|
{
|
||||||
"contactEmail": "Daniel.Deshields@alpla.com",
|
"sName": "Dayton",
|
||||||
"contactPhone": "4846667452",
|
"serverDNS": "usday1vms006",
|
||||||
"customerTiAcc": "ALPL01DAYTONINT",
|
"plantToken": "usday1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.44.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "80",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "2700 Concorde Dr Suite 200",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Vandalia, OH",
|
||||||
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:59\"}]",
|
"zipcode": "45377",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "Daniel.Deshields@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "4846667452",
|
||||||
},
|
"customerTiAcc": "ALPL01DAYTONINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Salt Lake City",
|
"active": true,
|
||||||
"serverDNS": "usslc1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usslc1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.202.0.26",
|
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:59\"}]",
|
||||||
"greatPlainsPlantCode": "70",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "4324 Commercial Way Suite A",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Salt Lake City, UT",
|
},
|
||||||
"zipcode": "84104",
|
{
|
||||||
"contactEmail": "ShippingReceivingSaltLake@groups.alpla.com",
|
"sName": "Salt Lake City",
|
||||||
"contactPhone": "801-673-2143",
|
"serverDNS": "usslc1vms006",
|
||||||
"customerTiAcc": "ALPL01SLCINT",
|
"plantToken": "usslc1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.202.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "70",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "4324 Commercial Way Suite A",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Salt Lake City, UT",
|
||||||
"shippingHours": "[{\"early\": \"07:00\", \"late\": \"17:00\"}]",
|
"zipcode": "84104",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "ShippingReceivingSaltLake@groups.alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "Copy of bol" }]
|
"contactPhone": "801-673-2143",
|
||||||
},
|
"customerTiAcc": "ALPL01SLCINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Lima",
|
"active": true,
|
||||||
"serverDNS": "uslim1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "uslim1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.53.0.26",
|
"shippingHours": "[{\"early\": \"07:00\", \"late\": \"17:00\"}]",
|
||||||
"greatPlainsPlantCode": "50",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "3320 Fort Shawnee Industrial Dr",
|
"otherSettings": [{ "specialInstructions": "Copy of bol" }]
|
||||||
"cityState": "Lima, OH",
|
},
|
||||||
"zipcode": "45806",
|
{
|
||||||
"contactEmail": "shippingreceivinglima@groups.alpla.com",
|
"sName": "Lima",
|
||||||
"contactPhone": "",
|
"serverDNS": "uslim1vms006",
|
||||||
"customerTiAcc": "ALPL01LIMAINT",
|
"plantToken": "uslim1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.53.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "50",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "3320 Fort Shawnee Industrial Dr",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Lima, OH",
|
||||||
"shippingHours": "[{\"early\": \"13:00\", \"late\": \"15:00\"}]",
|
"zipcode": "45806",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "shippingreceivinglima@groups.alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "",
|
||||||
},
|
"customerTiAcc": "ALPL01LIMAINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Florence",
|
"active": true,
|
||||||
"serverDNS": "usflo1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usflo1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.203.0.26",
|
"shippingHours": "[{\"early\": \"13:00\", \"late\": \"15:00\"}]",
|
||||||
"greatPlainsPlantCode": "22",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "7080 New Buffington Rd",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Florence, KY",
|
},
|
||||||
"zipcode": "41042",
|
{
|
||||||
"contactEmail": "blake.matthes@alpla.com",
|
"sName": "Florence",
|
||||||
"contactPhone": "6366970253",
|
"serverDNS": "usflo1vms006",
|
||||||
"customerTiAcc": "ALPL01FLORINT",
|
"plantToken": "usflo1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.203.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "22",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "7080 New Buffington Rd",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Florence, KY",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "41042",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "blake.matthes@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "6366970253",
|
||||||
},
|
"customerTiAcc": "ALPL01FLORINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Iowa EBM",
|
"active": true,
|
||||||
"serverDNS": "usiow1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usiow1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.75.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "30",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "2258 Heinz Rd",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Iowa CIty, IA",
|
},
|
||||||
"zipcode": "52240",
|
{
|
||||||
"contactEmail": "shippingreceivingiowa1@groups.alpla.com",
|
"sName": "Iowa EBM",
|
||||||
"contactPhone": "3193378057",
|
"serverDNS": "usiow1vms006",
|
||||||
"customerTiAcc": "ALPL01IA1INT",
|
"plantToken": "usiow1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.75.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "30",
|
||||||
"serverLoc": "D:\\LST\\lstv2",
|
"streetAddress": "2258 Heinz Rd",
|
||||||
"oldVersion": "D:\\LST\\lst_backend",
|
"cityState": "Iowa CIty, IA",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "52240",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "shippingreceivingiowa1@groups.alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "3193378057",
|
||||||
},
|
"customerTiAcc": "ALPL01IA1INT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Jefferson city",
|
"active": true,
|
||||||
"serverDNS": "usjci1vms006",
|
"serverLoc": "D:\\LST\\lstv2",
|
||||||
"plantToken": "usjci1",
|
"oldVersion": "D:\\LST\\lst_backend",
|
||||||
"idAddress": "10.167.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "40",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "2662 Militia Dr",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Jefferson City, MO",
|
},
|
||||||
"zipcode": "65101",
|
{
|
||||||
"contactEmail": "blake.matthes@alpla.com",
|
"sName": "Jefferson city",
|
||||||
"contactPhone": "6366970253",
|
"serverDNS": "usjci1vms006",
|
||||||
"customerTiAcc": "ALPL01JCINT",
|
"plantToken": "usjci1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.167.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "40",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "2662 Militia Dr",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Jefferson City, MO",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "65101",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "blake.matthes@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "6366970253",
|
||||||
},
|
"customerTiAcc": "ALPL01JCINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "Sherman",
|
"active": true,
|
||||||
"serverDNS": "usshe1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usshe1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.205.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "21",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "3000 Howe Dr",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "Sherman, TX",
|
},
|
||||||
"zipcode": "75092",
|
{
|
||||||
"contactEmail": "blake.matthes@alpla.com",
|
"sName": "Sherman",
|
||||||
"contactPhone": "6366970253",
|
"serverDNS": "usshe1vms006",
|
||||||
"customerTiAcc": "ALPL01SHERMANINT",
|
"plantToken": "usshe1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.205.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "21",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "3000 Howe Dr",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "Sherman, TX",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "75092",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "blake.matthes@alpla.com",
|
||||||
"otherSettings": [{ "specialInstructions": "" }]
|
"contactPhone": "6366970253",
|
||||||
},
|
"customerTiAcc": "ALPL01SHERMANINT",
|
||||||
{
|
"lstServerPort": "3000",
|
||||||
"sName": "West Bend",
|
"active": true,
|
||||||
"serverDNS": "usweb1vms006",
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
"plantToken": "usweb1",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"idAddress": "10.80.0.26",
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
"greatPlainsPlantCode": "65",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"streetAddress": "825 Rail Way",
|
"otherSettings": [{ "specialInstructions": "" }]
|
||||||
"cityState": "West Bend, WI",
|
},
|
||||||
"zipcode": "53095",
|
{
|
||||||
"contactEmail": "shippingreceivingwestbend@groups.alpla.com",
|
"sName": "West Bend",
|
||||||
"contactPhone": "262-808-4211",
|
"serverDNS": "usweb1vms006",
|
||||||
"customerTiAcc": "ALPL01WBINT",
|
"plantToken": "usweb1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.80.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "65",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"streetAddress": "825 Rail Way",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "West Bend, WI",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"zipcode": "53095",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "shippingreceivingwestbend@groups.alpla.com",
|
||||||
"otherSettings": [
|
"contactPhone": "262-808-4211",
|
||||||
{
|
"customerTiAcc": "ALPL01WBINT",
|
||||||
"specialInstructions": "This is a FTL load. The driver will need 2 adjustable load locks to secure the load. The driver will not be loaded without them. Please reference ALPLA pickup [header]",
|
"lstServerPort": "3000",
|
||||||
"active": false
|
"active": true,
|
||||||
}
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
]
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
},
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
{
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"sName": "St Peters",
|
"otherSettings": [
|
||||||
"serverDNS": "usstp1vms006",
|
{
|
||||||
"plantToken": "usstp1",
|
"specialInstructions": "This is a FTL load. The driver will need 2 adjustable load locks to secure the load. The driver will not be loaded without them. Please reference ALPLA pickup [header]",
|
||||||
"idAddress": "10.37.0.26",
|
"active": false
|
||||||
"greatPlainsPlantCode": "45",
|
}
|
||||||
"streetAddress": "9 Cermak Blvd",
|
]
|
||||||
"cityState": "St. Peters, MO",
|
},
|
||||||
"zipcode": "63376",
|
{
|
||||||
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
|
"sName": "St Peters",
|
||||||
"contactPhone": "6365771018",
|
"serverDNS": "usstp1vms006",
|
||||||
"customerTiAcc": "ALPL01STPINT",
|
"plantToken": "usstp1",
|
||||||
"lstServerPort": "3000",
|
"idAddress": "10.37.0.26",
|
||||||
"active": true,
|
"greatPlainsPlantCode": "45",
|
||||||
"serverLoc": "D:\\LST\\lstv2",
|
"streetAddress": "9 Cermak Blvd",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"cityState": "St. Peters, MO",
|
||||||
"shippingHours": "[{\"early\": \"00:01\", \"late\": \"23:59\"}]",
|
"zipcode": "63376",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
|
||||||
"otherSettings": [
|
"contactPhone": "6365771018",
|
||||||
{ "specialInstructions": "Loadbars/Straps required." }
|
"customerTiAcc": "ALPL01STPINT",
|
||||||
]
|
"lstServerPort": "3000",
|
||||||
},
|
"active": true,
|
||||||
{
|
"serverLoc": "D:\\LST\\lstv2",
|
||||||
"sName": "Marked Tree",
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
"serverDNS": "usmar1vms006",
|
"shippingHours": "[{\"early\": \"00:01\", \"late\": \"23:59\"}]",
|
||||||
"plantToken": "usmar1",
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
"idAddress": "10.206.9.26",
|
"otherSettings": [{ "specialInstructions": "Loadbars/Straps required." }]
|
||||||
"greatPlainsPlantCode": "90",
|
},
|
||||||
"streetAddress": "301 Industrial St",
|
{
|
||||||
"cityState": "Marked Tree, AR",
|
"sName": "Marked Tree",
|
||||||
"zipcode": "72365",
|
"serverDNS": "usmar1vms006",
|
||||||
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
|
"plantToken": "usmar1",
|
||||||
"contactPhone": "6365771018",
|
"idAddress": "10.206.9.26",
|
||||||
"customerTiAcc": "ALPL01MARINT",
|
"greatPlainsPlantCode": "90",
|
||||||
"lstServerPort": "3000",
|
"streetAddress": "301 Industrial St",
|
||||||
"active": true,
|
"cityState": "Marked Tree, AR",
|
||||||
"serverLoc": "E:\\LST\\lstv2",
|
"zipcode": "72365",
|
||||||
"oldVersion": "E:\\LST\\lst_backend",
|
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
|
||||||
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
"contactPhone": "6365771018",
|
||||||
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
"customerTiAcc": "ALPL01MARINT",
|
||||||
"otherSettings": [
|
"lstServerPort": "3000",
|
||||||
{ "specialInstructions": "Loadbars/Straps required." }
|
"active": true,
|
||||||
]
|
"serverLoc": "E:\\LST\\lstv2",
|
||||||
}
|
"oldVersion": "E:\\LST\\lst_backend",
|
||||||
]
|
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
|
||||||
|
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
|
||||||
|
"otherSettings": [{ "specialInstructions": "Loadbars/Straps required." }]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user