CEC-3577: trex logs (#285)

* CEC-3577: trex logs

add filtering
add progress bar for log fetching
always fetch all the logs
request canceling

* don't hide progress
This commit is contained in:
Eduard Voronkin
2023-03-02 11:14:39 -08:00
committed by GitHub
parent 24ac0898af
commit 54f4386a58
2 changed files with 106 additions and 27 deletions

View File

@@ -173,13 +173,14 @@ const vehiclesAPI = {
.then(fetchRespHandler)
.catch(errorHandler),
getTRexLogs: async (vin, date, offset, count, direction, token) =>
getTRexLogs: async (vin, date, offset, count, direction, token, controller) =>
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)
),
signal: controller.signal
})
.then(fetchRespHandler)
.catch(errorHandler),