From b29b808c6d73b1937a471069b7ad0a0eb90bd342 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 1 Jun 2026 21:25:33 +0500 Subject: [PATCH] =?UTF-8?q?ui:=20restore=20=E2=9F=B3/=E2=9C=95=20actions?= =?UTF-8?q?=20in=20edit=20mode=20only;=20shrink=20toggles;=20uniform=2022p?= =?UTF-8?q?x=20rows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The camera table actions column is back as the 9th column but stays empty in the normal view — restart (⟳) and delete (✕) buttons render only on existing cameras while bulk-editing. Restart in bulk mode no longer reloads the table (keeps pending edits); delete reloads as before. Row height is now truly uniform: cams-fixed cells use line-height:1 with vertically-centred controls, the Вкл/Запись toggles shrink to 30×16, and selects/inputs/action buttons cap at 20px so filled rows match empty slots. Co-Authored-By: Claude Opus 4.8 (1M context) --- VERSION | 2 +- frontend/settings.html | 2 +- frontend/static/app.js | 23 ++++++++++++++++++----- frontend/static/style.css | 20 ++++++++++++++++++-- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index ccefc02..202169a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.137 +0.0.138 diff --git a/frontend/settings.html b/frontend/settings.html index 4cad582..d5ae907 100644 --- a/frontend/settings.html +++ b/frontend/settings.html @@ -47,7 +47,7 @@ - +
IDКамераIPПотокиВклЗаписьХранилищеСтатус
IDКамераIPПотокиВклЗаписьХранилищеСтатус
diff --git a/frontend/static/app.js b/frontend/static/app.js index d124b58..bed7e84 100644 --- a/frontend/static/app.js +++ b/frontend/static/app.js @@ -1257,6 +1257,12 @@ const CamSettings = { `` + `` + `` + + `` + + `` + + (cam + ? ` ` + + `` + : "") + `` ); }, @@ -1328,7 +1334,7 @@ const CamSettings = { const v = (x) => this.esc(x); const isEdit = !!cam; return ( - `` + + `` + `
` + `` + `` + @@ -1444,7 +1450,8 @@ const CamSettings = { `` + `` + `` + - `${statusCell}`; + `${statusCell}` + + ``; tb.appendChild(tr); } else { tr.className = "slot-empty"; @@ -1452,7 +1459,8 @@ const CamSettings = { tr.innerHTML = `${i + 1}` + `——————` + - `пусто`; + `пусто` + + ``; tb.appendChild(tr); } } @@ -1473,9 +1481,14 @@ const CamSettings = { } else if (act === "delete") { this.remove(id, this.byId[id] ? this.byId[id].name : id); } else if (act === "restart") { - btn.disabled = true; btn.textContent = "…"; + const prev = btn.textContent; btn.disabled = true; btn.textContent = "…"; await post(`/api/cameras/${id}/restart`); - setTimeout(() => this.load(), 1500); + if (this.bulk) { // в массовом режиме строки не перерисовываем (правки не теряем) + btn.textContent = "✓"; + setTimeout(() => { btn.textContent = prev; btn.disabled = false; }, 1500); + } else { + setTimeout(() => this.load(), 1500); + } } else if (act === "log") { const box = document.getElementById("log-" + id); if (!box.hidden) { box.hidden = true; return; } diff --git a/frontend/static/style.css b/frontend/static/style.css index a9436a8..73176bc 100644 --- a/frontend/static/style.css +++ b/frontend/static/style.css @@ -425,9 +425,25 @@ table.cams th, table.cams td { table.cams th { color: var(--text-dim); font-weight: 500; font-size: 11px; padding: 4px 10px; } table.cams td.actions { white-space: nowrap; text-align: right; } table.cams tr.slot-empty td { opacity: .5; } -/* камеры: жёстко фиксированная высота строки 22px (плотная таблица) */ +/* камеры: жёстко фиксированная высота строки 22px независимо от контролов. + line-height:1 + контролы по центру и ниже 22px → строки не распирает. */ table.cams.cams-fixed td, table.cams.cams-fixed th { - height: 22px; padding-top: 0; padding-bottom: 0; line-height: 22px; + height: 22px; padding-top: 0; padding-bottom: 0; line-height: 1; +} +table.cams.cams-fixed td > * { vertical-align: middle; } +/* тумблеры «Вкл»/«Запись» в строке — компактные (30×16) */ +table.cams.cams-fixed td input[type="checkbox"] { + width: 30px; height: 16px; border-radius: 8px; +} +table.cams.cams-fixed td input[type="checkbox"]::before { width: 12px; height: 12px; top: 1px; left: 1px; } +table.cams.cams-fixed td input[type="checkbox"]:checked::before { transform: translateX(14px); } +/* селекты и инпуты в строке — на 2px ниже строки, по центру */ +table.cams.cams-fixed td select.stor-sel, +table.cams.cams-fixed td select.cell-sel, +table.cams.cams-fixed td input.cell-in { height: 20px; } +/* кнопки действий ⟳/✕ (режим редактирования) — компактные */ +table.cams.cams-fixed td.actions button { + height: 20px; padding: 0 6px; font-size: 13px; line-height: 1; } /* ── Инлайн-редактор строки (вместо всплывающего окна) ── */