Mobilprofilen visar nu per vald klassom det finns depå,mellantids

decoders
This commit is contained in:
larssand committed 2026-08-25 20:04:14 +02:00
1 parent abf887dccd
commit 84302a770d
7 files changed
+81 -2

No files matched your search

+13
View File
@@ -58,6 +58,10 @@ const messages = {
bestThree: "Bästa 3 sammanhängande",
bestFive: "Bästa 5 min",
fiveAverage: "Avg pace, bästa 5 min",
splitPassings: "Mellantidspasseringar",
bestSplit: "Bästa mellantid",
pitStops: "Depåstopp",
totalPit: "Total depåtid",
},
en: {
loading: "Loading training profile...",
@@ -108,6 +112,10 @@ const messages = {
bestThree: "Best 3 consecutive",
bestFive: "Best 5 min",
fiveAverage: "Average pace, best 5 min",
splitPassings: "Split passings",
bestSplit: "Best split",
pitStops: "Pit stops",
totalPit: "Total pit time",
},
};
@@ -167,6 +175,7 @@ function renderProfile(data) {
let activeClass = classProfiles.find((item) => String(item.classId || "") === selectedClassId) || classProfiles[0] || null;
if (activeClass && selectedClassId !== activeClass.classId) selectedClassId = activeClass.classId;
const stats = activeClass?.stats || data.stats;
const channelStats = activeClass?.channelStats || data.channelStats || {};
const nextMilestone = activeClass?.nextMilestone || data.nextMilestone;
const recommendation = activeClass?.recommendation || data.recommendation;
const goals = activeClass?.goals || data.goals || [];
@@ -275,6 +284,10 @@ function renderProfile(data) {
<div><span>${escapeHtml(t("bestThree"))}</span><strong>${stats.bestThreeConsecutive ? `3/${formatRaceResultTime(stats.bestThreeConsecutive.totalMs)}` : "-"}</strong></div>
<div><span>${escapeHtml(t("bestFive"))}</span><strong>${stats.bestFiveMinuteResult ? `${stats.bestFiveMinuteResult.lapCount}/${formatRaceResultTime(stats.bestFiveMinuteResult.totalMs)}` : "-"}</strong></div>
<div><span>${escapeHtml(t("fiveAverage"))}</span><strong>${stats.bestFiveMinuteResult ? formatLap(stats.bestFiveMinuteResult.averageLapMs) : "-"}</strong></div>
<div><span>${escapeHtml(t("splitPassings"))}</span><strong>${Number(channelStats.splitCount || 0)}</strong></div>
<div><span>${escapeHtml(t("bestSplit"))}</span><strong>${channelStats.splitCount ? formatLap(channelStats.bestSplitMs) : "-"}</strong></div>
<div><span>${escapeHtml(t("pitStops"))}</span><strong>${Number(channelStats.pitStopCount || 0)}</strong></div>
<div><span>${escapeHtml(t("totalPit"))}</span><strong>${channelStats.pitStopCount ? formatRaceResultTime(channelStats.totalPitMs) : "-"}</strong></div>
</div>
</section>