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

@@ -5,6 +5,12 @@ const updatesAPI = {
return data;
},
createFleetUpdates: async (data, token) => {
if (!data.id) data.id = 0;
data.id++;
return data;
},
getCarUpdates: async (filter, token) => {
return { data: [] };
},

View File

@@ -94,11 +94,10 @@ const vehiclesAPI = {
data: [2021, 2022],
};
},
sendCommand: async (vin, command, parameters) => {
sendCommand: async (vin, command) => {
return {
vin,
command,
parameters,
};
},
updateVehicle: async (vin, vehicle) => {

View File

@@ -18,6 +18,18 @@ const certificatesAPI = {
})
.then(fetchRespHandler)
.catch(errorHandler),
createAftersales: async (data, token) =>
fetch(`${API_ENDPOINT}/create-aftersales`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
})
.then(fetchRespHandler)
.catch(errorHandler),
};
export default certificatesAPI;

View File

@@ -1,81 +1,26 @@
const Locks = [
const Commands = [
{value: "doors_lock", label: "Lock doors"},
{value: "doors_unlock", label: "Unlock doors"},
{value: "vent_windows", label: "Vent windows"},
{value: "close_windows", label: "Close windows"},
{value: "california_mode", label: "California mode"},
{value: "trunk_open", label: "Open trunk"},
{value: "trunk_close", label: "Close trunk "},
{value: "flash_headlights", label: "Flash headlights"},
{value: "alert", label: "Alert"},
{value: "temp_cabin", label: "Set cabin temperature"},
{
value: "right_front",
label: "Front right door",
},{
value: "left_front",
label: "Front left door",
},{
value: "right_rear",
label: "Rear right door",
},{
value: "left_rear",
label: "Rear left door",
},{
value: "trunk",
label: "Trunk",
value: "temp_cabin",
label: "Set cabin temperature for period",
params: {
data: ""
},
},
];
const Windows = [
{
value: "right_front",
label: "Front right window",
},{
value: "left_front",
label: "Front left window",
},{
value: "right_rear",
label: "Rear right window",
},{
value: "left_rear",
label: "Rear left window",
},
];
const Commands = [{
value: "lock",
label: "Lock door",
parameters: Locks,
},
{
value: "unlock",
label: "Unlock door",
parameters: Locks,
},{
value: "open",
label: "Open window",
parameters: Windows,
},
{
value: "close",
label: "Close window",
parameters: Windows,
},
{
value: "ecu",
label: "ECU Versions",
},
{
value: "log",
label: "Log level",
parameters: [
{
value: "info",
label: "Info",
},
{
value: "debug",
label: "Debug",
},
{
value: "trace",
label: "Trace",
},
],
},{
value: "headlights",
label: "Flash headlights",
}];
{value: "defrost", label: "Defrost"},
{value: "driver_seat_preheat", label: "Driver seat preheat"},
{value: "passenger_seat_preheat", label: "Preheat passenger seat"},
{value: "steering_wheel_preheat", label: "Preheat Steering wheel"},
{value: "precondition", label: "Precondition"},
{value: "charging", label: "Charging"}]
export default Commands;

View File

@@ -7,18 +7,23 @@ import {
const API_ENDPOINT = process.env.REACT_APP_UPLOAD_SERVICE_URL;
const createDeployUpdatesClosure = (suffix) => {
return async (data, token) => fetch(`${API_ENDPOINT}/${suffix}`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
})
.then(fetchRespHandler)
.catch(errorHandler)
}
const updatesAPI = {
createCarUpdates: async (data, token) =>
fetch(`${API_ENDPOINT}/carupdate`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
})
.then(fetchRespHandler)
.catch(errorHandler),
createFleetUpdates: createDeployUpdatesClosure("fleetupdate"),
createCarUpdates: createDeployUpdatesClosure("carupdate"),
getCarUpdateLog: async (query, token) => {
const u = addQueryParams(`${API_ENDPOINT}/carupdateslog`, query);

View File

@@ -125,7 +125,7 @@ const vehiclesAPI = {
.then(fetchRespHandler)
.catch(errorHandler),
sendCommand: async (vins, command, parameters, token) =>
sendCommand: async (vins, command, token) =>
fetch(`${API_ENDPOINT}/vehiclecommand`, {
method: "POST",
headers: Object.assign(
@@ -134,8 +134,7 @@ const vehiclesAPI = {
),
body: JSON.stringify({
vins,
command,
parameters,
...command,
}),
})
.then(fetchRespHandler)