From 977fd7dffa873c4afa8ce08a7d6a32b00623990e Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 18 Jan 2026 13:54:37 -0800 Subject: [PATCH] KDS: Show restaurant name in header, remove Loading text --- kds/index.html | 3 +-- kds/kds.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/kds/index.html b/kds/index.html index f14edbf..eae0544 100644 --- a/kds/index.html +++ b/kds/index.html @@ -76,8 +76,7 @@
-

Kitchen Display System

-
Loading...
+

Kitchen Display System

diff --git a/kds/kds.js b/kds/kds.js index 91b1706..bb26493 100644 --- a/kds/kds.js +++ b/kds/kds.js @@ -77,6 +77,9 @@ async function checkStationSelection() { console.log('[KDS] Starting with businessId:', config.businessId, 'stationId:', config.stationId); + // Load business name + await loadBusinessName(); + // If station already selected (including 0 for "all"), start KDS if (config.stationId !== null && config.stationId !== undefined) { updateStationBadge(); @@ -96,6 +99,25 @@ async function checkStationSelection() { } } +// Load business name from API +async function loadBusinessName() { + if (!config.businessId) return; + + try { + const response = await fetch(`${config.apiBaseUrl}/businesses/get.cfm`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ BusinessID: config.businessId }) + }); + const data = await response.json(); + if (data.OK && data.BUSINESS) { + document.getElementById('businessName').textContent = data.BUSINESS.BusinessName || 'Kitchen Display System'; + } + } catch (e) { + console.error('Failed to load business name:', e); + } +} + // Load stations from API async function loadStations() { if (!config.businessId) return;