CEC-3242 - New form for Fleet/AddVehicle (#243)
* CEC-3242 - New form for Fleet/AddVehicle * fixes, improvements * update snapshot * CEC-3242 and CEC-3262 * update snapshot * un-require removed fields from vehicle add
This commit is contained in:
@@ -6392,146 +6392,6 @@ exports[`App Route /vehicle-add authenticated 1`] = `
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
|
||||||
data-shrink="true"
|
|
||||||
for="model"
|
|
||||||
id="model-label"
|
|
||||||
>
|
|
||||||
Model
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
|
||||||
>
|
|
||||||
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
aria-invalid="false"
|
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
|
||||||
id="model"
|
|
||||||
maxlength="255"
|
|
||||||
name="model"
|
|
||||||
required=""
|
|
||||||
type="text"
|
|
||||||
value="Ocean"
|
|
||||||
/>
|
|
||||||
<fieldset
|
|
||||||
aria-hidden="true"
|
|
||||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
|
||||||
>
|
|
||||||
<legend
|
|
||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
Model
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</legend>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
|
||||||
data-shrink="true"
|
|
||||||
for="year"
|
|
||||||
id="year-label"
|
|
||||||
>
|
|
||||||
Year
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
|
||||||
>
|
|
||||||
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
aria-invalid="false"
|
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
|
||||||
id="year"
|
|
||||||
maxlength="4"
|
|
||||||
minlength="4"
|
|
||||||
name="year"
|
|
||||||
required=""
|
|
||||||
type="number"
|
|
||||||
value="2022"
|
|
||||||
/>
|
|
||||||
<fieldset
|
|
||||||
aria-hidden="true"
|
|
||||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
|
||||||
>
|
|
||||||
<legend
|
|
||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
Year
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</legend>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
|
||||||
data-shrink="true"
|
|
||||||
for="trim"
|
|
||||||
id="trim-label"
|
|
||||||
>
|
|
||||||
Trim
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
|
||||||
>
|
|
||||||
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
aria-invalid="false"
|
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
|
||||||
id="trim"
|
|
||||||
maxlength="4"
|
|
||||||
minlength="4"
|
|
||||||
name="trim"
|
|
||||||
required=""
|
|
||||||
type="text"
|
|
||||||
value="Base"
|
|
||||||
/>
|
|
||||||
<fieldset
|
|
||||||
aria-hidden="true"
|
|
||||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
|
||||||
>
|
|
||||||
<legend
|
|
||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
Trim
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</legend>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<label
|
<label
|
||||||
class="MuiFormLabel-root"
|
class="MuiFormLabel-root"
|
||||||
id="demo-row-radio-buttons-group-label"
|
id="demo-row-radio-buttons-group-label"
|
||||||
|
|||||||
@@ -68,146 +68,6 @@ exports[`VehicleAddForm Render 1`] = `
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
|
||||||
data-shrink="true"
|
|
||||||
for="model"
|
|
||||||
id="model-label"
|
|
||||||
>
|
|
||||||
Model
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
|
||||||
>
|
|
||||||
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
aria-invalid="false"
|
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
|
||||||
id="model"
|
|
||||||
maxlength="255"
|
|
||||||
name="model"
|
|
||||||
required=""
|
|
||||||
type="text"
|
|
||||||
value="Ocean"
|
|
||||||
/>
|
|
||||||
<fieldset
|
|
||||||
aria-hidden="true"
|
|
||||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
|
||||||
>
|
|
||||||
<legend
|
|
||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
Model
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</legend>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
|
||||||
data-shrink="true"
|
|
||||||
for="year"
|
|
||||||
id="year-label"
|
|
||||||
>
|
|
||||||
Year
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
|
||||||
>
|
|
||||||
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
aria-invalid="false"
|
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
|
||||||
id="year"
|
|
||||||
maxlength="4"
|
|
||||||
minlength="4"
|
|
||||||
name="year"
|
|
||||||
required=""
|
|
||||||
type="number"
|
|
||||||
value="2022"
|
|
||||||
/>
|
|
||||||
<fieldset
|
|
||||||
aria-hidden="true"
|
|
||||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
|
||||||
>
|
|
||||||
<legend
|
|
||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
Year
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</legend>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
|
||||||
data-shrink="true"
|
|
||||||
for="trim"
|
|
||||||
id="trim-label"
|
|
||||||
>
|
|
||||||
Trim
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
|
||||||
>
|
|
||||||
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
aria-invalid="false"
|
|
||||||
class="MuiInputBase-input MuiOutlinedInput-input"
|
|
||||||
id="trim"
|
|
||||||
maxlength="4"
|
|
||||||
minlength="4"
|
|
||||||
name="trim"
|
|
||||||
required=""
|
|
||||||
type="text"
|
|
||||||
value="Base"
|
|
||||||
/>
|
|
||||||
<fieldset
|
|
||||||
aria-hidden="true"
|
|
||||||
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
|
||||||
>
|
|
||||||
<legend
|
|
||||||
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
Trim
|
|
||||||
*
|
|
||||||
</span>
|
|
||||||
</legend>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<label
|
<label
|
||||||
class="MuiFormLabel-root"
|
class="MuiFormLabel-root"
|
||||||
id="demo-row-radio-buttons-group-label"
|
id="demo-row-radio-buttons-group-label"
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ const MainForm = () => {
|
|||||||
const [redirect, setRedirect] = useState(null);
|
const [redirect, setRedirect] = useState(null);
|
||||||
|
|
||||||
const vinEl = useRef(null);
|
const vinEl = useRef(null);
|
||||||
const modelEl = useRef(null);
|
|
||||||
const yearEl = useRef(null);
|
|
||||||
const trimEl = useRef(null);
|
|
||||||
const [selectedLogLevel, setSelectedLogLevel] = useState("info");
|
const [selectedLogLevel, setSelectedLogLevel] = useState("info");
|
||||||
const [canbusEnabled, setCANBusEnabled] = useState(true);
|
const [canbusEnabled, setCANBusEnabled] = useState(true);
|
||||||
const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false);
|
const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false);
|
||||||
@@ -81,9 +78,6 @@ const MainForm = () => {
|
|||||||
|
|
||||||
const formData = {
|
const formData = {
|
||||||
vin: vinEl.current.value,
|
vin: vinEl.current.value,
|
||||||
model: modelEl.current.value,
|
|
||||||
year: parseInt(yearEl.current.value),
|
|
||||||
trim: trimEl.current.value,
|
|
||||||
log_level: selectedLogLevel,
|
log_level: selectedLogLevel,
|
||||||
canbus: {
|
canbus: {
|
||||||
enabled: canbusEnabled,
|
enabled: canbusEnabled,
|
||||||
@@ -123,51 +117,6 @@ const MainForm = () => {
|
|||||||
fullWidth
|
fullWidth
|
||||||
inputRef={vinEl}
|
inputRef={vinEl}
|
||||||
/>
|
/>
|
||||||
<TextField
|
|
||||||
id="model"
|
|
||||||
name="model"
|
|
||||||
label="Model"
|
|
||||||
defaultValue="Ocean"
|
|
||||||
variant="outlined"
|
|
||||||
margin="normal"
|
|
||||||
inputProps={{
|
|
||||||
maxLength: "255",
|
|
||||||
}}
|
|
||||||
required
|
|
||||||
fullWidth
|
|
||||||
inputRef={modelEl}
|
|
||||||
/>
|
|
||||||
<TextField
|
|
||||||
id="year"
|
|
||||||
name="year"
|
|
||||||
label="Year"
|
|
||||||
type="number"
|
|
||||||
defaultValue="2022"
|
|
||||||
variant="outlined"
|
|
||||||
margin="normal"
|
|
||||||
inputProps={{
|
|
||||||
maxLength: "4",
|
|
||||||
minLength: "4",
|
|
||||||
}}
|
|
||||||
required
|
|
||||||
fullWidth
|
|
||||||
inputRef={yearEl}
|
|
||||||
/>
|
|
||||||
<TextField
|
|
||||||
id="trim"
|
|
||||||
name="trim"
|
|
||||||
label="Trim"
|
|
||||||
defaultValue="Base"
|
|
||||||
variant="outlined"
|
|
||||||
margin="normal"
|
|
||||||
inputProps={{
|
|
||||||
maxLength: "4",
|
|
||||||
minLength: "4",
|
|
||||||
}}
|
|
||||||
required
|
|
||||||
fullWidth
|
|
||||||
inputRef={trimEl}
|
|
||||||
/>
|
|
||||||
<FormLabel id="demo-row-radio-buttons-group-label">Log Level</FormLabel>
|
<FormLabel id="demo-row-radio-buttons-group-label">Log Level</FormLabel>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
row
|
row
|
||||||
|
|||||||
@@ -16,14 +16,6 @@ const validateAdd = (vehicle) => {
|
|||||||
if (vehicle.vin.length > 17) {
|
if (vehicle.vin.length > 17) {
|
||||||
throw new Error("VIN cannot be larger than 17 characters");
|
throw new Error("VIN cannot be larger than 17 characters");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vehicle.model || vehicle.model.length === 0) {
|
|
||||||
throw new Error("model required");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!vehicle.year || vehicle.year < 2000 || vehicle.year > 9999) {
|
|
||||||
throw new Error("year required");
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const VehicleProvider = ({ children }) => {
|
export const VehicleProvider = ({ children }) => {
|
||||||
|
|||||||
@@ -68,6 +68,504 @@ exports[`FleetVehicleAdd Render 1`] = `
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<label
|
||||||
|
class="MuiFormLabel-root"
|
||||||
|
id="demo-row-radio-buttons-group-label"
|
||||||
|
>
|
||||||
|
Log Level
|
||||||
|
</label>
|
||||||
|
<div
|
||||||
|
aria-labelledby="demo-row-radio-buttons-group-label"
|
||||||
|
class="MuiFormGroup-root MuiFormGroup-row"
|
||||||
|
margin="normal"
|
||||||
|
role="radiogroup"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
name="log-level-group"
|
||||||
|
type="radio"
|
||||||
|
value="trace"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="PrivateRadioButtonIcon-root-0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-0"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Trace
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
name="log-level-group"
|
||||||
|
type="radio"
|
||||||
|
value="debug"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="PrivateRadioButtonIcon-root-0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-0"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Debug
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-0 Mui-checked MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
name="log-level-group"
|
||||||
|
type="radio"
|
||||||
|
value="info"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="PrivateRadioButtonIcon-root-0 PrivateRadioButtonIcon-checked-0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-0"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Info
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
name="log-level-group"
|
||||||
|
type="radio"
|
||||||
|
value="warning"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="PrivateRadioButtonIcon-root-0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-0"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Warning
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
name="log-level-group"
|
||||||
|
type="radio"
|
||||||
|
value="error"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="PrivateRadioButtonIcon-root-0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-0"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Error
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
name="log-level-group"
|
||||||
|
type="radio"
|
||||||
|
value="critical"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="PrivateRadioButtonIcon-root-0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-0"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Critical
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<label
|
||||||
|
class="MuiFormLabel-root"
|
||||||
|
id="demo-row-radio-buttons-group-label"
|
||||||
|
>
|
||||||
|
CAN Bus
|
||||||
|
</label>
|
||||||
|
<div
|
||||||
|
class="MuiFormGroup-root"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-0 Mui-checked MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
checked=""
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
data-indeterminate="false"
|
||||||
|
type="checkbox"
|
||||||
|
value=""
|
||||||
|
/>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
CAN Bus Enabled
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<div
|
||||||
|
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-filled Mui-required Mui-required"
|
||||||
|
data-shrink="true"
|
||||||
|
for="max_mem_buffer_size"
|
||||||
|
id="max_mem_buffer_size-label"
|
||||||
|
>
|
||||||
|
Max Memory Buffer Size (0 uses default size)
|
||||||
|
<span
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
||||||
|
>
|
||||||
|
|
||||||
|
*
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<div
|
||||||
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
aria-invalid="false"
|
||||||
|
class="MuiInputBase-input MuiOutlinedInput-input"
|
||||||
|
id="max_mem_buffer_size"
|
||||||
|
maxlength="12"
|
||||||
|
name="max_mem_buffer_size"
|
||||||
|
required=""
|
||||||
|
type="number"
|
||||||
|
value="0"
|
||||||
|
/>
|
||||||
|
<fieldset
|
||||||
|
aria-hidden="true"
|
||||||
|
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
||||||
|
>
|
||||||
|
<legend
|
||||||
|
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Max Memory Buffer Size (0 uses default size)
|
||||||
|
*
|
||||||
|
</span>
|
||||||
|
</legend>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
data-indeterminate="false"
|
||||||
|
type="checkbox"
|
||||||
|
value=""
|
||||||
|
/>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Data Logger Enabled
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginNormal MuiFormControl-fullWidth"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined Mui-disabled Mui-disabled MuiFormLabel-filled Mui-required Mui-required"
|
||||||
|
data-shrink="true"
|
||||||
|
for="max_disk_buffer_size"
|
||||||
|
id="max_disk_buffer_size-label"
|
||||||
|
>
|
||||||
|
Max Disk Buffer Size (0 uses default size)
|
||||||
|
<span
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiFormLabel-asterisk MuiInputLabel-asterisk"
|
||||||
|
>
|
||||||
|
|
||||||
|
*
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<div
|
||||||
|
class="MuiInputBase-root MuiOutlinedInput-root Mui-disabled Mui-disabled MuiInputBase-fullWidth MuiInputBase-formControl"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
aria-invalid="false"
|
||||||
|
class="MuiInputBase-input MuiOutlinedInput-input Mui-disabled Mui-disabled"
|
||||||
|
disabled=""
|
||||||
|
id="max_disk_buffer_size"
|
||||||
|
maxlength="12"
|
||||||
|
name="max_disk_buffer_size"
|
||||||
|
required=""
|
||||||
|
type="number"
|
||||||
|
value="0"
|
||||||
|
/>
|
||||||
|
<fieldset
|
||||||
|
aria-hidden="true"
|
||||||
|
class="PrivateNotchedOutline-root-0 MuiOutlinedInput-notchedOutline"
|
||||||
|
>
|
||||||
|
<legend
|
||||||
|
class="PrivateNotchedOutline-legendLabelled-0 PrivateNotchedOutline-legendNotched-0"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
Max Disk Buffer Size (0 uses default size)
|
||||||
|
*
|
||||||
|
</span>
|
||||||
|
</legend>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { Redirect, useParams } from "react-router";
|
import { Redirect, useParams } from "react-router";
|
||||||
import { Button, TextField } from "@material-ui/core";
|
import {
|
||||||
|
Button,
|
||||||
|
Checkbox,
|
||||||
|
FormControlLabel,
|
||||||
|
FormGroup,
|
||||||
|
FormLabel,
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
|
TextField
|
||||||
|
} from "@material-ui/core";
|
||||||
|
|
||||||
import useStyles from "../../../../useStyles";
|
import useStyles from "../../../../useStyles";
|
||||||
import {
|
import {
|
||||||
@@ -21,9 +30,15 @@ const MainForm = () => {
|
|||||||
},
|
},
|
||||||
} = useUserContext();
|
} = useUserContext();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const vinEl = useRef(null);
|
|
||||||
const [redirect, setRedirect] = useState(null);
|
const [redirect, setRedirect] = useState(null);
|
||||||
|
|
||||||
|
const vinEl = useRef(null);
|
||||||
|
const [selectedLogLevel, setSelectedLogLevel] = useState("info");
|
||||||
|
const [canbusEnabled, setCANBusEnabled] = useState(true);
|
||||||
|
const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false);
|
||||||
|
const [maxMemBufferSize, setMaxMemBufferSize] = useState(0);
|
||||||
|
const [maxDiskBufferSize, setMaxDiskBufferSize] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const title = "Add Vehicle";
|
const title = "Add Vehicle";
|
||||||
setTitle(title);
|
setTitle(title);
|
||||||
@@ -43,11 +58,41 @@ const MainForm = () => {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const onLogLevelChange = (event) => {
|
||||||
|
setSelectedLogLevel(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
const onCANBusChange = (event) => {
|
||||||
|
setCANBusEnabled(event.target.checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDataLoggerChange = (event) => {
|
||||||
|
setDataLoggerEnabled(event.target.checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
const onMaxMemBufferSizeChange = (event) => {
|
||||||
|
setMaxMemBufferSize(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
const onMaxDiskBufferSizeChange = (event) => {
|
||||||
|
setMaxDiskBufferSize(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
const onSubmit = async (event) => {
|
const onSubmit = async (event) => {
|
||||||
try {
|
try {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const formData = { vin: vinEl.current.value };
|
const formData = {
|
||||||
|
vin: vinEl.current.value,
|
||||||
|
log_level: selectedLogLevel,
|
||||||
|
canbus: {
|
||||||
|
enabled: canbusEnabled,
|
||||||
|
data_logger_enabled: canbusEnabled ? dataLoggerEnabled : false,
|
||||||
|
max_mem_buffer_size: canbusEnabled ? parseInt(maxMemBufferSize) : 0,
|
||||||
|
max_disk_buffer_size: canbusEnabled && dataLoggerEnabled ? parseInt(maxDiskBufferSize) : 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const result = await addFleetVehicle(name, formData, token);
|
const result = await addFleetVehicle(name, formData, token);
|
||||||
|
|
||||||
setMessage(`Added ${result.vin}`);
|
setMessage(`Added ${result.vin}`);
|
||||||
@@ -78,6 +123,70 @@ const MainForm = () => {
|
|||||||
fullWidth
|
fullWidth
|
||||||
inputRef={vinEl}
|
inputRef={vinEl}
|
||||||
/>
|
/>
|
||||||
|
<FormLabel id="demo-row-radio-buttons-group-label">Log Level</FormLabel>
|
||||||
|
<RadioGroup
|
||||||
|
row
|
||||||
|
aria-labelledby="demo-row-radio-buttons-group-label"
|
||||||
|
name="log-level-group"
|
||||||
|
value={selectedLogLevel}
|
||||||
|
onChange={onLogLevelChange}
|
||||||
|
margin="normal"
|
||||||
|
>
|
||||||
|
<FormControlLabel value="trace" control={<Radio />} label="Trace" />
|
||||||
|
<FormControlLabel value="debug" control={<Radio />} label="Debug" />
|
||||||
|
<FormControlLabel value="info" control={<Radio />} label="Info" />
|
||||||
|
<FormControlLabel value="warning" control={<Radio />} label="Warning" />
|
||||||
|
<FormControlLabel value="error" control={<Radio />} label="Error" />
|
||||||
|
<FormControlLabel value="critical" control={<Radio />} label="Critical" />
|
||||||
|
</RadioGroup>
|
||||||
|
<FormLabel id="demo-row-radio-buttons-group-label">CAN Bus</FormLabel>
|
||||||
|
<FormGroup>
|
||||||
|
<FormControlLabel control={
|
||||||
|
<Checkbox
|
||||||
|
checked={canbusEnabled}
|
||||||
|
onChange={onCANBusChange}
|
||||||
|
/>
|
||||||
|
} label="CAN Bus Enabled" />
|
||||||
|
<TextField
|
||||||
|
id="max_mem_buffer_size"
|
||||||
|
name="max_mem_buffer_size"
|
||||||
|
label='Max Memory Buffer Size (0 uses default size)'
|
||||||
|
value={maxMemBufferSize}
|
||||||
|
onChange={onMaxMemBufferSizeChange}
|
||||||
|
variant="outlined"
|
||||||
|
margin="normal"
|
||||||
|
inputProps={{
|
||||||
|
maxLength: "12",
|
||||||
|
}}
|
||||||
|
type="number"
|
||||||
|
disabled={!canbusEnabled}
|
||||||
|
required
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
<FormControlLabel control={
|
||||||
|
<Checkbox
|
||||||
|
checked={dataLoggerEnabled}
|
||||||
|
onChange={onDataLoggerChange}
|
||||||
|
disabled={!canbusEnabled}
|
||||||
|
/>
|
||||||
|
} label="Data Logger Enabled" />
|
||||||
|
</FormGroup>
|
||||||
|
<TextField
|
||||||
|
id="max_disk_buffer_size"
|
||||||
|
name="max_disk_buffer_size"
|
||||||
|
label='Max Disk Buffer Size (0 uses default size)'
|
||||||
|
value={maxDiskBufferSize}
|
||||||
|
onChange={onMaxDiskBufferSizeChange}
|
||||||
|
variant="outlined"
|
||||||
|
margin="normal"
|
||||||
|
inputProps={{
|
||||||
|
maxLength: "12",
|
||||||
|
}}
|
||||||
|
type="number"
|
||||||
|
disabled={!dataLoggerEnabled}
|
||||||
|
required
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
|
|||||||
Reference in New Issue
Block a user