diff --git a/api/app/static/css/style.css b/api/app/static/css/style.css index d992814..d8adcb6 100644 --- a/api/app/static/css/style.css +++ b/api/app/static/css/style.css @@ -1039,6 +1039,8 @@ tr.mapping-deleted td { display: flex; gap: 2px; align-items: center; + overflow-x: auto; + flex-shrink: 0; } .preset-btn { background: var(--surface); diff --git a/api/app/static/js/dashboard.js b/api/app/static/js/dashboard.js index 6a8ecb3..a803c11 100644 --- a/api/app/static/js/dashboard.js +++ b/api/app/static/js/dashboard.js @@ -224,19 +224,21 @@ async function loadSchedulerStatus() { // ── Filter Bar wiring ───────────────────────────── function wireFilterBar() { - // Period dropdown - document.getElementById('periodSelect')?.addEventListener('change', function () { - document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active')); - const matchBtn = document.querySelector(`.preset-btn[data-days="${this.value}"]`); - if (matchBtn) matchBtn.classList.add('active'); - const cr = document.getElementById('customRangeInputs'); - if (this.value === 'custom') { - cr?.classList.add('visible'); - } else { - cr?.classList.remove('visible'); - dashPage = 1; - loadDashOrders(); - } + // Period preset buttons + document.querySelectorAll('.preset-btn[data-days]').forEach(btn => { + btn.addEventListener('click', function() { + document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active')); + this.classList.add('active'); + const days = this.dataset.days; + const cr = document.getElementById('customRangeInputs'); + if (days === 'custom') { + cr?.classList.add('visible'); + } else { + cr?.classList.remove('visible'); + dashPage = 1; + loadDashOrders(); + } + }); }); // Custom range inputs @@ -266,20 +268,6 @@ function wireFilterBar() { loadDashOrders(); }, 300); }); - - // Period preset buttons - document.querySelectorAll('.preset-btn[data-days]').forEach(btn => { - btn.addEventListener('click', function() { - document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active')); - this.classList.add('active'); - const days = this.dataset.days; - const sel = document.getElementById('periodSelect'); - if (sel) { sel.value = days; } - document.getElementById('customRangeInputs')?.classList.remove('visible'); - dashPage = 1; - loadDashOrders(); - }); - }); } // ── Dashboard Orders Table ──────────────────────── @@ -300,7 +288,8 @@ function dashSortBy(col) { } async function loadDashOrders() { - const periodVal = document.getElementById('periodSelect')?.value || '7'; + const activePreset = document.querySelector('.preset-btn.active'); + const periodVal = activePreset?.dataset.days || '3'; const params = new URLSearchParams(); if (periodVal === 'custom') { diff --git a/api/app/templates/base.html b/api/app/templates/base.html index f2a0bf3..c19096b 100644 --- a/api/app/templates/base.html +++ b/api/app/templates/base.html @@ -19,7 +19,7 @@ {% set rp = request.scope.get('root_path', '') %} - +
diff --git a/api/app/templates/dashboard.html b/api/app/templates/dashboard.html index 864f922..b723f98 100644 --- a/api/app/templates/dashboard.html +++ b/api/app/templates/dashboard.html @@ -54,23 +54,14 @@