diff --git a/DrSousan.Api/Pages/Index.cshtml b/DrSousan.Api/Pages/Index.cshtml index c7b1eb7..9671b55 100644 --- a/DrSousan.Api/Pages/Index.cshtml +++ b/DrSousan.Api/Pages/Index.cshtml @@ -179,7 +179,7 @@ .health-cat-card { background:var(--white); border-radius:24px; padding:2.2rem; border:1px solid var(--border); display:flex; flex-direction:column; gap:1rem; } .health-cat-icon { width:60px; height:60px; border-radius:18px; display:flex; align-items:center; justify-content:center; } .health-cat-icon svg { width:28px; height:28px; } - .health-cat-icon.beauty { background:#FCE4EC; color:#C2185B; } + .health-cat-icon.beauty { background:var(--gold-pale); color:var(--gold); } .health-cat-icon.health { background:#E3F2FD; color:#1565C0; } .health-cat-card h3 { font-size:1.15rem; font-weight:700; color:var(--dark); } .health-cat-card p { font-size:.88rem; color:var(--mid); line-height:1.8; } diff --git a/DrSousan.Api/wwwroot/admin/index.html b/DrSousan.Api/wwwroot/admin/index.html index d3cf229..338deeb 100644 --- a/DrSousan.Api/wwwroot/admin/index.html +++ b/DrSousan.Api/wwwroot/admin/index.html @@ -310,10 +310,21 @@ tr:hover td{background:#FAFBFC}
کل بازدید مقالات
-
نظرات بیماران
-
مقالات بدون متا
-
+
تعداد بیماران
-
+
درخواست‌های جدید
-
-
-
پربازدیدترین مقالات
-
عنوانبازدیدعملیات
+
+
+
پربازدیدترین مقالات
+
عنوانبازدیدعملیات
+
+
+
+
آخرین درخواست‌های سلامت
+ +
+
نامتلفندستهوضعیت
+
@@ -1313,9 +1324,11 @@ async function sendReply(id) { // ── Dashboard ───────────────────────────────────────────────────────────────── async function loadDashboard() { - const [seo, testims] = await Promise.all([ + const [seo, testims, patients, reqs] = await Promise.all([ api('/api/seo/stats'), - api('/api/testimonials/all') + api('/api/testimonials/all'), + api('/api/patients'), + api('/api/health-requests') ]); if (seo) { document.getElementById('ds-posts').textContent = seo.total; @@ -1325,6 +1338,22 @@ async function loadDashboard() { tb.innerHTML = seo.topPosts.map(p=>`${p.title}${p.viewCount}مشاهده`).join(''); } if (testims) document.getElementById('ds-testimonials').textContent = testims.length; + if (patients) document.getElementById('ds-patients').textContent = patients.length; + if (reqs) { + const pending = reqs.filter(r=>!r.isHandled); + document.getElementById('ds-requests').textContent = pending.length; + const catLabel = {beauty:'زیبایی پوست', health:'سلامت عمومی'}; + document.getElementById('dashReqTable').innerHTML = reqs.slice(0,6).map(r=>` + + ${r.fullName} + ${r.phoneNumber} + ${catLabel[r.category]||r.category} + ${r.isHandled?'بررسی شده':'جدید'} + `).join('') || 'درخواستی وجود ندارد'; + // update sidebar badge + const badge = document.getElementById('healthreqBadge'); + if(pending.length>0){badge.textContent=pending.length;badge.style.display='inline';}else{badge.style.display='none';} + } } // ── Section settings ────────────────────────────────────────────────────────── @@ -1624,9 +1653,11 @@ async function applyCrop() { const out = document.createElement('canvas'); out.width = Math.round(sw); out.height = Math.round(sh); out.getContext('2d').drawImage(cropper.img, sx, sy, sw, sh, 0, 0, out.width, out.height); + // Capture targets BEFORE closing (closeCropper doesn't clear them, but be safe) + const _inputId = cropper.inputId, _previewId = cropper.previewId; out.toBlob(async blob => { closeCropper(); - const inputId = cropper.inputId, previewId = cropper.previewId; + const inputId = _inputId, previewId = _previewId; const btn = document.getElementById(`upload-btn-${inputId}`); const orig = btn.innerHTML; btn.innerHTML = ' در حال آپلود...';