mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
adding added ad slot support for adddss
This commit is contained in:
@@ -9,6 +9,20 @@ const discordInvite = config.discord?.invite || null;
|
||||
const kofiLink = config.kofi?.link || null;
|
||||
const serverTimezone = config.timezone || null;
|
||||
const configuredSocials = getConfiguredSocials(config);
|
||||
/*
|
||||
The driver ad is trusted deployment content supplied by the server operator.
|
||||
Normalize both values at the server boundary so every browser receives a
|
||||
predictable string-only contract, even when the YAML keys are absent or were
|
||||
accidentally configured with another scalar type.
|
||||
|
||||
Keep the title and markup together because they describe one optional card.
|
||||
An empty HTML string disables the card; the title alone must never leave an
|
||||
empty panel at the bottom of the driver layout.
|
||||
*/
|
||||
const driverAd = {
|
||||
title: typeof config.driverAd?.title === 'string' ? config.driverAd.title.trim() : '',
|
||||
html: typeof config.driverAd?.html === 'string' ? config.driverAd.html.trim() : '',
|
||||
};
|
||||
|
||||
const ACTIVITY_SYNC_COOLDOWN_MS = 3000;
|
||||
const GPIO_TOGGLE_SYNC_COOLDOWN_MS = 1000;
|
||||
@@ -19,6 +33,7 @@ module.exports = {
|
||||
kofiLink,
|
||||
serverTimezone,
|
||||
configuredSocials,
|
||||
driverAd,
|
||||
ACTIVITY_SYNC_COOLDOWN_MS,
|
||||
GPIO_TOGGLE_SYNC_COOLDOWN_MS,
|
||||
PERIODIC_SYNC_MS,
|
||||
|
||||
@@ -61,6 +61,7 @@ const {
|
||||
kofiLink,
|
||||
serverTimezone,
|
||||
configuredSocials,
|
||||
driverAd,
|
||||
ACTIVITY_SYNC_COOLDOWN_MS,
|
||||
GPIO_TOGGLE_SYNC_COOLDOWN_MS,
|
||||
PERIODIC_SYNC_MS,
|
||||
@@ -209,6 +210,13 @@ function buildSession(socket) {
|
||||
adminReason: getAdminReason(),
|
||||
users,
|
||||
socials,
|
||||
/*
|
||||
This is intentionally raw, operator-authored HTML. The browser only
|
||||
mounts it on the desktop driver page, but keeping it in the ordinary
|
||||
session payload makes the server configuration the single source of
|
||||
truth and avoids a separate endpoint for one small optional card.
|
||||
*/
|
||||
driverAd,
|
||||
discord: {
|
||||
invite: discordInvite,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user