KDS: Show restaurant name in header, remove Loading text

This commit is contained in:
John Mizerek 2026-01-18 13:54:37 -08:00
parent 849cea6404
commit 977fd7dffa
2 changed files with 23 additions and 2 deletions

View file

@ -76,8 +76,7 @@
<div class="header"> <div class="header">
<div> <div>
<h1>Kitchen Display System <span id="stationBadge"></span></h1> <h1><span id="businessName">Kitchen Display System</span> <span id="stationBadge"></span></h1>
<div style="margin-top: 5px; font-size: 14px; color: #888;" id="servicePointName">Loading...</div>
</div> </div>
<div class="status"> <div class="status">
<div class="status-dot" id="statusDot"></div> <div class="status-dot" id="statusDot"></div>

View file

@ -77,6 +77,9 @@ async function checkStationSelection() {
console.log('[KDS] Starting with businessId:', config.businessId, 'stationId:', config.stationId); 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 station already selected (including 0 for "all"), start KDS
if (config.stationId !== null && config.stationId !== undefined) { if (config.stationId !== null && config.stationId !== undefined) {
updateStationBadge(); 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 // Load stations from API
async function loadStations() { async function loadStations() {
if (!config.businessId) return; if (!config.businessId) return;