feat(MikrotikBackupsManager): add large modal for displaying backup content with improved UI
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 56s

This commit is contained in:
2026-02-11 16:00:48 +07:00
parent bdc7dd2bb3
commit 6b8e060d54
+27 -21
View File
@@ -7,7 +7,7 @@ import TableSkeleton from './components/TableSkeleton.jsx';
import EmptyState from './components/EmptyState.jsx'; import EmptyState from './components/EmptyState.jsx';
import Tooltip from './components/Tooltip.jsx'; import Tooltip from './components/Tooltip.jsx';
import DataTable from './components/DataTable.jsx'; import DataTable from './components/DataTable.jsx';
import { FullscreenModal } from './components/Modal.jsx'; import { LargeModal, FullscreenModal } from './components/Modal.jsx';
import { countryToFlag } from './utils/serverUtils.js'; import { countryToFlag } from './utils/serverUtils.js';
import { import {
IconRefresh, IconRefresh,
@@ -138,6 +138,7 @@ function MikrotikBackupsManager() {
const [viewConfigKey, setViewConfigKey] = useState(null); const [viewConfigKey, setViewConfigKey] = useState(null);
const [viewConfigText, setViewConfigText] = useState(''); const [viewConfigText, setViewConfigText] = useState('');
const [viewLoading, setViewLoading] = useState(false); const [viewLoading, setViewLoading] = useState(false);
const [viewModalOpen, setViewModalOpen] = useState(false);
const [diffResult, setDiffResult] = useState(null); const [diffResult, setDiffResult] = useState(null);
const [diffLoading, setDiffLoading] = useState(false); const [diffLoading, setDiffLoading] = useState(false);
const [diffModalOpen, setDiffModalOpen] = useState(false); const [diffModalOpen, setDiffModalOpen] = useState(false);
@@ -382,6 +383,7 @@ function MikrotikBackupsManager() {
setViewLoading(true); setViewLoading(true);
setViewConfigKey(key); setViewConfigKey(key);
setViewConfigText(''); setViewConfigText('');
setViewModalOpen(true);
const res = await api.get('/mikrotik/backups/item', { params: { key } }); const res = await api.get('/mikrotik/backups/item', { params: { key } });
setViewConfigText(res.data?.config || ''); setViewConfigText(res.data?.config || '');
} catch (err) { } catch (err) {
@@ -852,18 +854,18 @@ function MikrotikBackupsManager() {
</div> </div>
</div> </div>
{viewConfigKey && ( <LargeModal
<div className="row mt-4"> show={viewModalOpen}
<div className="col-12"> onClose={() => {
<div className="card"> setViewModalOpen(false);
<div className="card-header d-flex align-items-center justify-content-between"> }}
<div> title="Содержимое бэкапа MikroTik"
<div className="card-title mb-0">Содержимое бэкапа</div> footer={(
<div className="text-muted small text-truncate" title={viewConfigKey}> <div className="d-flex justify-content-between w-100">
{viewConfigKey} <div className="text-muted small text-truncate" title={viewConfigKey || ''}>
{viewConfigKey || 'Бэкап не выбран'}
</div> </div>
</div> <div className="btn-list mb-0">
<div className="btn-list">
<button <button
type="button" type="button"
className="btn btn-outline-secondary btn-sm" className="btn btn-outline-secondary btn-sm"
@@ -873,24 +875,28 @@ function MikrotikBackupsManager() {
<IconCopy size={16} className="me-1" /> <IconCopy size={16} className="me-1" />
Копировать Копировать
</button> </button>
<button
type="button"
className="btn btn-secondary btn-sm"
onClick={() => setViewModalOpen(false)}
>
Закрыть
</button>
</div> </div>
</div> </div>
<div className="card-body"> )}
>
{viewLoading ? ( {viewLoading ? (
<TableSkeleton rows={6} columns={1} /> <TableSkeleton rows={6} columns={1} />
) : ( ) : (
<pre <pre
className="mb-0" className="bg-dark text-white p-3 rounded"
style={{ maxHeight: 420, overflow: 'auto', fontSize: 12 }} style={{ maxHeight: 500, overflow: 'auto', fontSize: 12 }}
> >
{viewConfigText || '# Нет данных для отображения'} <code>{viewConfigText || '# Нет данных для отображения'}</code>
</pre> </pre>
)} )}
</div> </LargeModal>
</div>
</div>
</div>
)}
<FullscreenModal <FullscreenModal
show={diffModalOpen} show={diffModalOpen}