From bc40c1437aa166e96dc85479d459a3f88bf67355 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 16 Jun 2026 13:22:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=82=D0=B5=D0=BA=D1=83=D1=89=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8=20raspberry=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/server/main.go | 3 +++ cmd/server/web/css/style.css | 19 ++++++++++++++++--- cmd/server/web/dashboard.html | 1 + cmd/server/web/js/app.ts | 6 ++++++ cmd/server/web/js/data.ts | 1 + cmd/server/web/js/state.ts | 4 +--- cmd/server/web/js/ui.ts | 7 +++++++ 7 files changed, 35 insertions(+), 6 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 2af661c..2b040b3 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -42,6 +42,8 @@ func (a *API) HandleHealth(w http.ResponseWriter, r *http.Request) { status = "Нет связи" } + now := time.Now() + writeJSON(w, map[string]any{ "status": status, "uptime_sec": time.Since(a.startTime).Seconds(), @@ -50,6 +52,7 @@ func (a *API) HandleHealth(w http.ResponseWriter, r *http.Request) { "has_data": ok, "latest": latest, "stats": a.buf.Stats(), + "server_time": now.Format("02.01.2006 15:04"), }) } diff --git a/cmd/server/web/css/style.css b/cmd/server/web/css/style.css index 50d7fb0..c75c9f7 100644 --- a/cmd/server/web/css/style.css +++ b/cmd/server/web/css/style.css @@ -12,9 +12,9 @@ body { /* ===== HEADER BAR ===== */ .header-bar { - display: flex; + display: grid; + grid-template-columns: 1fr auto 1fr; align-items: center; - justify-content: space-between; margin-bottom: 15px; gap: 16px; } @@ -22,7 +22,20 @@ body { h1 { font-size: 22px; margin: 0; - flex: 1; +} + +.header-time { + font-size: 16px; + text-align: center; + white-space: nowrap; + padding: 6px 12px; + border: 1px solid rgba(0, 255, 136, 0.35); + border-radius: 8px; + background: rgba(0, 255, 136, 0.05); +} + +.header-bar .cam-btn { + justify-self: end; } /* ===== CAMERA BUTTON (теперь в header) ===== */ diff --git a/cmd/server/web/dashboard.html b/cmd/server/web/dashboard.html index aa6683c..67780b7 100644 --- a/cmd/server/web/dashboard.html +++ b/cmd/server/web/dashboard.html @@ -13,6 +13,7 @@

GPIO МОНИТОРИНГ В РЕАЛЬНОМ ВРЕМЕНИ

+
--:--:--