Merge branch 'release/0.9.0'
This commit is contained in:
@@ -23,14 +23,20 @@ export const CANSignalsExportProvider = ({ children }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getDynamicColumnCANSignals = async (vin, timestart, timeend, cansingals, token) => {
|
||||
const getDynamicColumnCANSignals = async (vin, timestart, timeend, cansignals, selectall, token) => {
|
||||
try {
|
||||
setBusy(true)
|
||||
if (!vin) return;
|
||||
|
||||
validateVIN(vin);
|
||||
if (timestart > timeend) throw new Error("Start time cannot be after end time");
|
||||
const result = await api.getCanSignalsVin(vin, timestart, timeend, cansingals, token);
|
||||
|
||||
let result
|
||||
if (selectall === true) {
|
||||
result = await api.getCanSignalsVin(vin, timestart, timeend, [], selectall, token);
|
||||
} else {
|
||||
result = await api.getCanSignalsVin(vin, timestart, timeend, cansignals, false, token);
|
||||
}
|
||||
if (result.error || !result.ok)
|
||||
throw new Error(`Get CAN signals error. ${result.message}`);
|
||||
|
||||
|
||||
@@ -200,6 +200,20 @@ export const VehicleProvider = ({ children }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const uploadConfig = async (vin, token) => {
|
||||
try {
|
||||
setBusy(true);
|
||||
validateVIN(vin);
|
||||
|
||||
const result = await api.updateConfig(vin, token);
|
||||
if (result.error)
|
||||
throw new Error(`Update vehicle error. ${result.message}`);
|
||||
return result;
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
const deleteVehicle = async (vin, token) => {
|
||||
try {
|
||||
setBusy(true);
|
||||
@@ -285,6 +299,7 @@ export const VehicleProvider = ({ children }) => {
|
||||
updateVehicle,
|
||||
getFleets,
|
||||
getVersionLog,
|
||||
uploadConfig
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user