Push to prod (#201)

* CEC-2056 safari map (#186)

* CEC-2056 Fix Safari map popup

* Snapshot serializer for Private styles

* Combine serializers

* CEC-2207  Add is-online filter for vehicles list (#187)

* Add OptionsDropdown component

* Add is-online filter

* CEC-2237 Track sign in and keys (#188)

* Update stage (#189)

* CEC-2056 safari map (#186)

* CEC-2056 Fix Safari map popup

* Snapshot serializer for Private styles

* Combine serializers

* CEC-2207  Add is-online filter for vehicles list (#187)

* Add OptionsDropdown component

* Add is-online filter

* CEC-2237 Track sign in and keys (#188)

Co-authored-by: arpanetus <arpanetus@protonmail.com>

* CEC-2281 Update certificate form (#190)

* CEC-2281 Fix cert name

* CEC-2360 Fix filename display and add manifest type (#191)

* CEC-2360 Fix filename display and add manifest type

* const

* Push to Stage (#200)

* CEC-2144, CEC-2338  Add deploy by fleets and fix fleets table  (#192)

* Add fix for fleets search

* Decompose fleets table

* Add deploy by fleets

* Add snapshots

* CEC-2385 Only show software updates (#193)

* CEC-2385 Only show software updates

* Update browser list

* update threshold

* Clean up

* CEC-2291 Remote Commands (#194)

* CEC-2378 Add fix for fleet vehicles' search

* CEC-1235 Fix fleet name update (#196)

Co-authored-by: arpanetus <arpanetus@protonmail.com>

Co-authored-by: arpanetus <arpanetus@protonmail.com>
This commit is contained in:
John Wu
2022-09-19 15:55:55 -07:00
committed by GitHub
parent d995361b9f
commit 56043dc375
70 changed files with 3059 additions and 3416 deletions

View File

@@ -24,7 +24,6 @@ import { logger } from "../../../services/monitoring";
const MainForm = () => {
const queries = new URLSearchParams(useLocation().search);
const name = queries.get("name") ?? "";
const { fleet, getFleet, updateFleet, busy } = useFleetContext();
const { token: { idToken: { jwtToken: token } } } = useUserContext();
@@ -32,6 +31,8 @@ const MainForm = () => {
const [redirect, setRedirect] = useState(null);
const classes = useStyles();
const [name, setName] = useState(queries.get("name") ?? "");
const [oldName, ] = useState(name);
const [selectedLogLevel, setSelectedLogLevel] = useState("info");
const [canbusEnabled, setCANBusEnabled] = useState(true);
const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false);
@@ -56,7 +57,7 @@ const MainForm = () => {
(async () => {
try {
if (!name || !token) return;
await getFleet(name, token);
await getFleet(oldName, token);
} catch (e) {
setMessage(e.message);
logger.warn(e.stack);
@@ -77,6 +78,10 @@ const MainForm = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fleet]);
const onNameChange = (event) => {
setName(event.target.value);
}
const onLogLevelChange = (event) => {
setSelectedLogLevel(event.target.value);
}
@@ -110,7 +115,10 @@ const MainForm = () => {
max_disk_buffer_size: canbusEnabled && dataLoggerEnabled ? parseInt(maxDiskBufferSize) : 0
}
};
const result = await updateFleet(name, formData, token);
console.log(oldName);
const result = await updateFleet(oldName, formData, token);
if (!result || result.error) return;
setMessage(`Updated ${result.name}`);
@@ -136,12 +144,11 @@ const MainForm = () => {
margin="normal"
inputProps={{
maxLength: "255",
readOnly: true,
}}
disabled
value={name}
required
fullWidth
onChange={onNameChange}
/>
<FormLabel id="demo-row-radio-buttons-group-label">Log Level</FormLabel>
<RadioGroup