diff --git a/.env b/.env index 4ea0dc8..c3407fb 100644 --- a/.env +++ b/.env @@ -1,3 +1,6 @@ VITE_BASEURL=http://192.168.75.11/ +VITE_FOLKESTONE_BASE=http://100.116.253.81 VITE_TESTURL=http://100.82.205.44/SightingListRear/sightingSummary?mostRecentRef=-1 -VITE_OUTSIDE_BASEURL=http://100.82.205.44/api \ No newline at end of file +VITE_OUTSIDE_BASEURL=http://100.82.205.44/api +VITE_FOLKESTONE_URL=http://100.116.253.81/mergedHistory/sightingSummary?mostRecentRef= +VITE_MAV_URL=http://192.168.75.11/SightingListFront/sightingSummary?mostRecentRef= \ No newline at end of file diff --git a/package.json b/package.json index 438c54f..ddd9194 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", - "preview": "vite preview" + "preview": "vite preview", + "type-check": "tsc --noEmit" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^7.0.0", diff --git a/src/components/SettingForms/NPED/NPEDFields.tsx b/src/components/SettingForms/NPED/NPEDFields.tsx index f086df6..f246eee 100644 --- a/src/components/SettingForms/NPED/NPEDFields.tsx +++ b/src/components/SettingForms/NPED/NPEDFields.tsx @@ -13,9 +13,9 @@ const NPEDFields = () => { const initialValues = user ? { - username: user.propUsername.value, - password: user.propPassword.value, - clientId: user.propClientID.value, + username: user?.propUsername?.value, + password: user?.propPassword?.value, + clientId: user?.propClientID?.value, frontId: "NPED", rearId: "NPED", } diff --git a/src/components/SettingForms/NPED/NPEDHotlist.tsx b/src/components/SettingForms/NPED/NPEDHotlist.tsx index 0296eae..d7adad2 100644 --- a/src/components/SettingForms/NPED/NPEDHotlist.tsx +++ b/src/components/SettingForms/NPED/NPEDHotlist.tsx @@ -1,13 +1,26 @@ import { Form, Formik } from "formik"; import type { HotlistUploadType } from "../../../types/types"; +import { useSystemConfig } from "../../../hooks/useSystemConfig"; const NPEDHotlist = () => { + const { uploadSettings } = useSystemConfig(); const initialValue = { file: null, }; - const handleSubmit = (values: HotlistUploadType) => console.log(values.file); - // upload/hotlist-upload/2 + const handleSubmit = (values: HotlistUploadType) => { + const settings = { + file: values.file, + opts: { + timeoutMs: 30000, + fieldName: "upload", + uploadUrl: "http://192.168.75.11/upload/hotlist-upload/2", + }, + }; + + uploadSettings(settings); + }; + return ( {({ setFieldValue, setErrors, errors }) => { @@ -24,21 +37,21 @@ const NPEDHotlist = () => { setErrors({ file: "This file is not a CSV, please select a different one", }); - - return; } setFieldValue("file", e.target.files[0]); + } else { + setErrors({ file: "no file" }); } }} /> -

{errors && errors.file}

+

{errors.file && errors.file}

); }} diff --git a/src/components/SettingForms/System/SystemConfigFields.tsx b/src/components/SettingForms/System/SystemConfigFields.tsx index d0b3591..687eb83 100644 --- a/src/components/SettingForms/System/SystemConfigFields.tsx +++ b/src/components/SettingForms/System/SystemConfigFields.tsx @@ -139,6 +139,10 @@ const SystemConfigFields = () => { name={"softwareUpdate"} selectedFile={values.softwareUpdate} /> +
+

Reboot

+
+