From 7a003e5df6f3bae925935df69e776ab1dbe56331 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 9 Sep 2026 01:08:48 +0300 Subject: [PATCH] Add system info dashboard to settings - New /api/system-info endpoint returning DB size, table sizes, photo/file counts, uploads stats, disk usage - System info cards in settings page (responsive grid) - Replaced inline onclick handlers with data attributes + event delegation in groups.html --- public/admin.css | 30 ++++- public/groups.html | 59 +++++++-- public/settings.html | 76 +++++++++++ server.js | 304 ++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 439 insertions(+), 30 deletions(-) diff --git a/public/admin.css b/public/admin.css index 08e981e..b2795ea 100644 --- a/public/admin.css +++ b/public/admin.css @@ -128,7 +128,7 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;b .group-card .name-input:focus{border-color:var(--accent)} .group-card .del{background:none;border:none;color:var(--muted);cursor:pointer;font-size:1.2rem;padding:4px;flex-shrink:0} .group-card .del:hover{color:#ef4444} -.group-card .group-schedule{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;align-items:start} +.group-card .group-schedule{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:8px;align-items:start} .group-card .group-schedule label{font-size:.75rem;color:var(--muted);display:block;margin-bottom:4px} .group-card .group-schedule select,.group-card .group-schedule input[type=time]{width:100%;background:var(--bg);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:6px 8px;font-size:.8rem} .group-card .group-foot{display:flex;justify-content:space-between;align-items:center;gap:8px} @@ -144,7 +144,13 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;b .settings-card .btn-link:hover{opacity:.85;border-color:transparent} .group-card .sched-status{font-size:.8rem;color:var(--muted)} @media(max-width:1024px){.group-grid{grid-template-columns:repeat(2,1fr)}} -@media(max-width:640px){.group-grid{grid-template-columns:1fr}} +@media(max-width:640px){ + .group-grid{grid-template-columns:1fr} + .group-card .group-schedule{grid-template-columns:1fr 1fr} +} +@media(max-width:480px){ + .group-card .group-schedule{grid-template-columns:1fr} +} .modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100;display:none;align-items:center;justify-content:center} .modal-overlay.open{display:flex} @@ -297,6 +303,26 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;b .stat .label a:hover{text-decoration:underline} @media(max-width:1100px){.dash-grid{grid-template-columns:1fr}} @media(max-width:640px){.photos-grid-dash{grid-template-columns:repeat(2,1fr)}} +/* --- System Info Dashboard --- */ +.sys-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px} +@media(max-width:480px){.sys-grid{grid-template-columns:1fr;gap:10px}} +.sys-card{background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:8px;min-width:0} +.sys-card.loading{color:var(--muted);justify-content:center;align-items:center;min-height:80px} +.sys-card.err{color:#ef4444} +.sys-title{font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px;padding-bottom:8px;border-bottom:1px solid var(--border)} +.sys-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 0} +.sys-label{font-size:.82rem;color:var(--muted)} +.sys-value{font-size:.9rem;font-weight:600;color:var(--text);text-align:right;word-break:break-word} +.sys-details{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)} +.sys-details summary{cursor:pointer;font-size:.75rem;color:var(--muted);font-weight:600} +.sys-table-list{margin-top:8px;display:flex;flex-direction:column;gap:4px} +.sys-table-row{display:flex;justify-content:space-between;font-size:.75rem;padding:2px 0} +.sys-table-row span:first-child{color:var(--muted)} +.sys-table-row span:last-child{font-weight:600;color:var(--text)} +.sys-bar-wrap{height:6px;background:var(--border);border-radius:3px;overflow:hidden;margin-top:4px} +.sys-bar{height:100%;transition:width .3s,background .3s} +.sys-meta{font-size:.7rem;color:var(--muted);margin-top:4px} + .actions-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap} .audit-table{width:100%;border-collapse:collapse;font-size:.85rem} .audit-table th{text-align:left;color:var(--muted);font-weight:600;padding:8px 10px;border-bottom:1px solid var(--border);font-size:.75rem;text-transform:uppercase;letter-spacing:.03em} diff --git a/public/groups.html b/public/groups.html index 58de8ac..187204e 100644 --- a/public/groups.html +++ b/public/groups.html @@ -11,8 +11,9 @@

Группы

-
- +
+ +
@@ -62,8 +63,20 @@