KDS: Show restaurant name in header, remove Loading text
This commit is contained in:
parent
849cea6404
commit
977fd7dffa
2 changed files with 23 additions and 2 deletions
|
|
@ -76,8 +76,7 @@
|
|||
|
||||
<div class="header">
|
||||
<div>
|
||||
<h1>Kitchen Display System <span id="stationBadge"></span></h1>
|
||||
<div style="margin-top: 5px; font-size: 14px; color: #888;" id="servicePointName">Loading...</div>
|
||||
<h1><span id="businessName">Kitchen Display System</span> <span id="stationBadge"></span></h1>
|
||||
</div>
|
||||
<div class="status">
|
||||
<div class="status-dot" id="statusDot"></div>
|
||||
|
|
|
|||
22
kds/kds.js
22
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue