CEC-3577: fetch T.Rex log from the cloud (#283)
* CEC-3577: fetch T.Rex log from the cloud * tabs? * CSS * smells * fix smells and warnings * suggestions
This commit is contained in:
@@ -58,6 +58,38 @@ const signals = {data:[
|
||||
},
|
||||
]};
|
||||
|
||||
const trexLogs = {
|
||||
RealOffset: 0,
|
||||
blobSize: 62072819,
|
||||
bytesRead: 29874,
|
||||
data: [
|
||||
{
|
||||
"level": "info",
|
||||
"timestamp": "2023-Feb-15 23:44:36.934746",
|
||||
"line_number": 948,
|
||||
"filename": "ota_service.cpp",
|
||||
"msg": "ota::cleanup() Deleting directory \"/fisker/ota/1534\"",
|
||||
"received_timestamp": "2023-Feb-15 23:44:37.203102197"
|
||||
},
|
||||
{
|
||||
"level": "debug",
|
||||
"timestamp": "2023-Feb-15 23:44:36.970715",
|
||||
"line_number": 992,
|
||||
"filename": "ota_service.cpp",
|
||||
"msg": "ota::end() manifest process aborted with error state",
|
||||
"received_timestamp": "2023-Feb-15 23:44:37.203197597"
|
||||
},
|
||||
{
|
||||
"level": "debug",
|
||||
"timestamp": "2023-Feb-15 23:44:36.971745",
|
||||
"line_number": 91,
|
||||
"filename": "vom_impl.cpp",
|
||||
"msg": "vom::send_ota_result_fb() Sending 0x4F9->tbox_ota_res_fb (==OTA_error)",
|
||||
"received_timestamp": "2023-Feb-15 23:44:37.203249997"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const vehiclesAPI = {
|
||||
addVehicle: async (vehicle) => {
|
||||
data.push(vehicle);
|
||||
@@ -117,6 +149,9 @@ const vehiclesAPI = {
|
||||
getCANSignals: async (vin, vehicle) => {
|
||||
return signals;
|
||||
},
|
||||
getTRexLogs: async (vin, date, offset, count, direction, token) => {
|
||||
return trexLogs;
|
||||
},
|
||||
getVersionLog: async (vin) => ({
|
||||
"data": [
|
||||
{
|
||||
|
||||
@@ -173,6 +173,17 @@ const vehiclesAPI = {
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
getTRexLogs: async (vin, date, offset, count, direction, token) =>
|
||||
fetch(`${API_ENDPOINT}/vehicle/${vin}/trex-logs?date=${date}&offset=${offset}&count=${count}&direction=${direction}`, {
|
||||
method: "GET",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
getVersionLog: async ({vin, ...search}, token) => {
|
||||
const u = addQueryParams(`${API_ENDPOINT}/vehicle/${vin}/version/logs`, search);
|
||||
return fetch(u, {
|
||||
|
||||
Reference in New Issue
Block a user