diff --git a/frontend/src/ASNsNewManager.jsx b/frontend/src/ASNsNewManager.jsx index b17aebf..c9fcb8b 100644 --- a/frontend/src/ASNsNewManager.jsx +++ b/frontend/src/ASNsNewManager.jsx @@ -17,7 +17,6 @@ import { IconClock, IconFileText } from '@tabler/icons-react'; -import LockBanner from './components/LockBanner.jsx'; import TableSkeleton from './components/TableSkeleton.jsx'; import S3MetaBar from './components/S3MetaBar.jsx'; import PageHeaderActions from './components/PageHeaderActions.jsx'; @@ -25,6 +24,8 @@ import ConfirmDialog from './components/ConfirmDialog.jsx'; import WsUpdateModal from './components/WsUpdateModal.jsx'; import ConfirmDiffModal from './components/ConfirmDiffModal.jsx'; import HistoryModal from './components/HistoryModal.jsx'; +import ErrorAlert from './components/ErrorAlert.jsx'; +import { notifyMutationSuccess } from './components/NotifyProvider.jsx'; const API_URL = '/api'; @@ -261,6 +262,7 @@ function ASNsNewManager() { setItems(unique); setSuccess('Изменения успешно сохранены!'); setTimeout(() => setSuccess(''), 3000); + notifyMutationSuccess('Изменения сохранены'); } catch (error) { console.error('Error saving changes:', error); setError('Не удалось сохранить изменения.'); @@ -370,6 +372,18 @@ function ASNsNewManager() { } }, [editingAsn]); + // Глобальные хоткеи: Ctrl+S — сохранить изменения + useEffect(() => { + const onKey = (e) => { + if ((e.ctrlKey || e.metaKey) && (e.key === 's' || e.key === 'S')) { + e.preventDefault(); + if (!loading) handleSaveChanges(); + } + }; + window.addEventListener('keydown', onKey); + return () => window.removeEventListener('keydown', onKey); + }, [loading, items, originalItems, etag, sortField, sortOrder, filterCommunity]); + const handleEditKeyDown = (e, asn) => { if (e.key === 'Enter') handleSaveEdit(asn); if (e.key === 'Escape') handleCancelEdit(); @@ -378,17 +392,7 @@ function ASNsNewManager() { return ( <> {error && ( -
+ {typeof details === 'string' ? details : JSON.stringify(details, null, 2)}
+
+