((resolve, error) => {
@@ -124,7 +223,10 @@ export class MonitorApi {
tripAscendingElevation: apiStatus.tae / 10,
tripMotorEnergy: apiStatus.tme / 10,
temperature: apiStatus.temp / 10,
- altitude: apiStatus.alt / 1000
+ latitude: apiStatus.lat <= -900 ? null : apiStatus.lat,
+ longitude: apiStatus.lng <= -900 ? null : apiStatus.lng,
+ altitude: apiStatus.alt / 1000,
+ dateTime: apiStatus.d == '' ? null : new Date(apiStatus.d)
};
return this.lastStatus;
diff --git a/WebApp/src/pages/dashboard/dashboard-page.tsx b/WebApp/src/pages/dashboard/dashboard-page.tsx
index 9e087d1..c0541d3 100644
--- a/WebApp/src/pages/dashboard/dashboard-page.tsx
+++ b/WebApp/src/pages/dashboard/dashboard-page.tsx
@@ -49,6 +49,7 @@ export class DashboardPage extends Page {
}
async refresh() {
+ await MonitorApi.get().autoUpdateInfo();
let newStatus = await MonitorApi.get().fetchStatus();
if(this.status == null)
m.redraw();
diff --git a/WebApp/src/pages/raw-data/raw-data-page.tsx b/WebApp/src/pages/raw-data/raw-data-page.tsx
index 7848f31..7f7522b 100644
--- a/WebApp/src/pages/raw-data/raw-data-page.tsx
+++ b/WebApp/src/pages/raw-data/raw-data-page.tsx
@@ -18,6 +18,7 @@ export class RawDataPage extends Page {
}
async refresh() {
+ await MonitorApi.get().autoUpdateInfo();
this.status = await MonitorApi.get().fetchStatus();
m.redraw();
if(this.autoRefresh)
@@ -35,6 +36,12 @@ export class RawDataPage extends Page {
Vitesse : {(this.status.speed * 3.6).toFixed(1)}km/h
Temperature : {this.status.temperature.toFixed(1)}°C
Altitude : {this.status.altitude.toFixed(1)}m
+ {this.status.latitude ?
+ Lat {this.status.latitude.toFixed(5)}° Lng {this.status.latitude.toFixed(5)}°
+ : null}
+ {this.status.dateTime ?
+ Time : {this.status.dateTime.toString()}
+ : null}
: Chargement...
;
}