-
{hours}:{minutes}:{seconds}
@@ -65,17 +65,17 @@
method: "POST",
url: "https://dev.lauf-fuer-kaya.de/api/scans/trackscans",
headers: { Authorization: "Bearer " + $apikey },
- data: { card, station: JSON.parse($stationinfo).id },
+ data: { card },
})
.then((response) => {
- console.log(response.data.runner);
- lastscan_totaldistance = response.data.runner.distance + "m";
const time = new Date();
const hours = (time.getHours() + "").padStart(2, "0");
const minutes = (time.getMinutes() + "").padStart(2, "0");
const seconds = (time.getSeconds() + "").padStart(2, "0");
lastscan_time = hours + ":" + minutes + ":" + seconds;
- lastscan_laptime = response.data.lapTime + "s";
+ response.data.lapTime = Math.floor(response.data.lapTime / 60) + 'min ' + (Math.floor(response.data.lapTime % 60) + "").padStart(2, "0") + "s"
+ lastscan_laptime = response.data.lapTime;
+ lastscan_totaldistance = Math.floor(response.data.runner.distance / 1000) + 'km ' + (Math.floor(response.data.runner.distance % 1000) + "").padStart(3, "0") + "m"
})
.catch((e) => {
lastscan_error = e.response.data.message;
@@ -101,15 +101,14 @@
last scan
{lastscan_time}
total distance
-
+
{lastscan_totaldistance}
lap time
- {lastscan_laptime}
+ {lastscan_laptime}
{:else}
please scan a card...
{/if}
-