feat(profile): 'My race today' on the driver's mobile profile - next heats, grid place, marshal duties and today's results (1.89.31)
This commit is contained in:
1 parent
163e82224c
commit
01998952a7
14 files changed
+222
-3
No files matched your search
+23
@@ -25,6 +25,7 @@ import { decoderAlarm } from "./decoder_watch.js";
|
||||
import { resultsAutosavePlan } from "./results_autosave.js";
|
||||
import { normalizeCheckIn, checkInRows, checkInSummary, canRemoveNoShows, removeNoShows } from "./check_in_logic.js";
|
||||
import { renderCheckInPanel, bindCheckInPanel, buildCheckInPrintHtml } from "./check_in_view.js";
|
||||
import { buildPublicRaceDaySnapshot } from "./my_race_logic.js";
|
||||
import { RACE_AUDIO_EVENT_DEFINITIONS, createRaceAudioEngine, normalizeRaceAudioSettings, isSilencedDuringRace, formatSpokenLapTime, resolveDriverCallStyle, formatCarCall, formatHeatCallDrivers } from "./race_audio.js";
|
||||
|
||||
import { renderRaceFormatField, renderRaceFormatContextCard, getRaceSummaryItems, getRaceSummaryWarnings, renderManageStatusBadge, renderRaceWizardSteps, renderRaceWizardContent, renderRaceStandingsTable } from "./race_setup_ui.js";
|
||||
@@ -7835,6 +7836,28 @@ function updateConnectionBadge() {
|
||||
dom.connectionBadge.className = `badge ${isOnline ? "badge-online" : "badge-offline"}`;
|
||||
}
|
||||
|
||||
// "My race today" (my_race_logic.js): every 15 s the race master posts today's schedule as a small
|
||||
// snapshot (driver ids, no names) when it changed; drivers' mobile profiles read their part.
|
||||
let lastPublicRaceDayJson = "";
|
||||
async function publishPublicRaceDay() {
|
||||
if (overlayMode || !isRaceMaster()) return;
|
||||
const date = todayKey();
|
||||
const rows = buildDayRows(date);
|
||||
const snapshot = buildPublicRaceDaySnapshot({
|
||||
date,
|
||||
rows,
|
||||
getClassLabel: getDayClassLabel,
|
||||
getEntries: (session) => getSessionGridEntries(session),
|
||||
getResults: (session) => buildLeaderboard(session),
|
||||
isGridStart: (session) => normalizeStartMode(session.startMode) === "position",
|
||||
});
|
||||
const json = JSON.stringify(snapshot);
|
||||
if (json === lastPublicRaceDayJson || (!rows.length && !lastPublicRaceDayJson)) return;
|
||||
const response = await fetch(`${getBackendUrl()}/api/public-race-day`, { method: "POST", headers: { "Content-Type": "application/json" }, body: json });
|
||||
if (response.ok) lastPublicRaceDayJson = json;
|
||||
}
|
||||
if (!overlayMode) setInterval(() => { publishPublicRaceDay().catch(() => {}); }, 15000);
|
||||
|
||||
// Optional morning check-in (check_in_logic.js / check_in_view.js) in Manage race.
|
||||
function startOfTodayMs() { const d = new Date(); d.setHours(0, 0, 0, 0); return d.getTime(); }
|
||||
function checkInRowsFor(event) {
|
||||
|
||||
Reference in new issue
Block a user