diff --git a/api/app/static/js/dashboard.js b/api/app/static/js/dashboard.js index 658d126..6a8ecb3 100644 --- a/api/app/static/js/dashboard.js +++ b/api/app/static/js/dashboard.js @@ -20,6 +20,7 @@ document.addEventListener('DOMContentLoaded', async () => { loadDashOrders(); startSyncPolling(); wireFilterBar(); + checkFirstTime(); }); async function initPollInterval() { @@ -124,6 +125,28 @@ function updateSyncPanel(data) { } } +async function checkFirstTime() { + const welcomeEl = document.getElementById('welcomeCard'); + if (!welcomeEl) return; + try { + const data = await fetchJSON('/api/sync/status'); + if (!data.last_run) { + welcomeEl.innerHTML = `
+
Bine ai venit!
+

Configureaza si ruleaza primul sync:

+
+ 1. Verifica Settings + 2. Apasa "Start Sync" + 3. Mapeaza SKU-urile lipsa +
+
`; + welcomeEl.style.display = ''; + } else { + welcomeEl.style.display = 'none'; + } + } catch(e) { welcomeEl.style.display = 'none'; } +} + // Wire last-sync-row click → journal (use current running sync if active) document.addEventListener('DOMContentLoaded', () => { document.getElementById('lastSyncRow')?.addEventListener('click', () => { diff --git a/api/app/templates/dashboard.html b/api/app/templates/dashboard.html index 26753a8..864f922 100644 --- a/api/app/templates/dashboard.html +++ b/api/app/templates/dashboard.html @@ -6,6 +6,8 @@ {% block content %}

Panou de Comanda

+ +
@@ -121,5 +123,5 @@ {% endblock %} {% block scripts %} - + {% endblock %}