Przebudowa aplikacji aby korzystała z bazy danych gastro a nie podsłuchiwania KDS

This commit is contained in:
2026-05-24 12:05:11 +02:00
parent 899cbaac42
commit 0396190927
7 changed files with 5256 additions and 3 deletions

View File

@@ -670,6 +670,9 @@
const HOT_WINDOW_MS = 5 * 60 * 60 * 1000;
// Dynamic Loader Messages
const LOADER_MIN_MS = 10_000;
const loadStartTime = Date.now();
const msgs = ["Rozgrzewamy piece...", "Szef kuchni sprawdza składniki...", "Łączenie z sercem restauracji...", "Prawie gotowe..."];
let msgIdx = 0;
const msgInterval = setInterval(() => {
@@ -682,10 +685,18 @@
tableLabel.textContent = `Stolik ${tableParam}`;
}
function hideLoader() {
const elapsed = Date.now() - loadStartTime;
const remaining = Math.max(0, LOADER_MIN_MS - elapsed);
setTimeout(() => {
loadingScreen.classList.add("hidden");
clearInterval(msgInterval);
}, remaining);
}
function updateUI(bills) {
// Hide loader on first data
loadingScreen.classList.add("hidden");
clearInterval(msgInterval);
// Hide loader after minimum display time
hideLoader();
const allArticles = bills.flatMap(b => Array.isArray(b?.Articles) ? b.Articles : []);
const items = mergeWithPersistedItems(allArticles);

1173
public/stolik2_api.html Normal file

File diff suppressed because it is too large Load Diff