From a127ebea82ca478c1afb1506e328ce62d304a410 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Sat, 21 Feb 2026 17:15:13 +0300 Subject: [PATCH] ui: add clear BOM button with server-side reset Co-Authored-By: Claude Sonnet 4.6 --- web/templates/index.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/web/templates/index.html b/web/templates/index.html index 0f1015e..5a4749f 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -294,6 +294,9 @@
+ @@ -2823,6 +2826,20 @@ function debouncedResolveBOM() { _resolveBOMTimer = setTimeout(() => resolveBOM(), 500); } +async function clearBOM() { + if (bomRows.length && !confirm('Очистить BOM? Данные будут удалены с сервера.')) return; + bomRows = []; + document.getElementById('bom-table-container').classList.add('hidden'); + document.getElementById('bom-paste-area').textContent = 'Нажмите сюда и вставьте из Excel (Ctrl+V)...'; + if (configUUID) { + await fetch(`/api/configs/${configUUID}/vendor-spec`, { + method: 'PUT', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({vendor_spec: []}) + }); + } +} + async function saveBOM() { if (!configUUID || !bomRows.length) return; const spec = bomRows.map(r => ({