From cfcb44d5f025f8db2ec4a4d27b9b01cd88324c52 Mon Sep 17 00:00:00 2001 From: shats Date: Mon, 16 Feb 2026 17:18:24 +0700 Subject: [PATCH] refactor(DomainsNewManager): integrate LastSaved component and streamline button placement for improved UI consistency and user experience --- frontend/src/DomainsNewManager.jsx | 79 ++++++++++++++++-------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/frontend/src/DomainsNewManager.jsx b/frontend/src/DomainsNewManager.jsx index 8ba0f44..afb6af9 100644 --- a/frontend/src/DomainsNewManager.jsx +++ b/frontend/src/DomainsNewManager.jsx @@ -47,6 +47,7 @@ import FormField from './components/FormField.jsx'; import Tooltip from './components/Tooltip.jsx'; import Pagination from './components/Pagination.jsx'; import AddItemModal from './components/AddItemModal.jsx'; +import LastSaved from './components/LastSaved.jsx'; import { useToast } from './components/ToastContainer.jsx'; const API_URL = '/api'; @@ -514,47 +515,39 @@ function DomainsNewManager() { } actions={( -
- - { if (!filterCommunity) { setError('Выберите community в фильтре для очистки'); return; } setClearCommunitiesOpen(true); }} - disableClearCommunities={items.length === 0 || !filterCommunity} - onSave={handleSaveChanges} - disableSave={loading} - onHistory={() => setHistoryOpen(true)} - onOnlineUpdate={() => setWsOpen(true)} - onBackgroundUpdate={async () => { - try { - const res = await fetch('/api/update-bgp/background', { method: 'POST' }); - const data = await res.json().catch(() => ({})); - if (!res.ok || data.ok === false) { - throw new Error(data?.message || `HTTP ${res.status}`); - } - notifyMutationSuccess('Фоновое обновление запущено', data); - } catch (e) { - window.notify?.error('Не удалось запустить фоновое обновление', String(e)); + { if (!filterCommunity) { setError('Выберите community в фильтре для очистки'); return; } setClearCommunitiesOpen(true); }} + disableClearCommunities={items.length === 0 || !filterCommunity} + onSave={handleSaveChanges} + disableSave={loading} + onHistory={() => setHistoryOpen(true)} + lastModified={lastModified} + onOnlineUpdate={() => setWsOpen(true)} + onBackgroundUpdate={async () => { + try { + const res = await fetch('/api/update-bgp/background', { method: 'POST' }); + const data = await res.json().catch(() => ({})); + if (!res.ok || data.ok === false) { + throw new Error(data?.message || `HTTP ${res.status}`); } - }} + notifyMutationSuccess('Фоновое обновление запущено', data); + } catch (e) { + window.notify?.error('Не удалось запустить фоновое обновление', String(e)); + } + }} /> -
)} /> @@ -669,6 +662,16 @@ function DomainsNewManager() { +
+ +