refactor: Remove unused preview actions from ASNs, Domains, and IPRanges managers; streamline PageHeaderActions component for improved clarity and usability
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 25m46s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 25m46s
This commit is contained in:
@@ -15,8 +15,7 @@ import {
|
|||||||
IconDeviceFloppy,
|
IconDeviceFloppy,
|
||||||
IconHash,
|
IconHash,
|
||||||
IconClock,
|
IconClock,
|
||||||
IconFileText,
|
IconFileText
|
||||||
IconEye
|
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import LockBanner from './components/LockBanner.jsx';
|
import LockBanner from './components/LockBanner.jsx';
|
||||||
import TableSkeleton from './components/TableSkeleton.jsx';
|
import TableSkeleton from './components/TableSkeleton.jsx';
|
||||||
@@ -399,8 +398,6 @@ function ASNsNewManager() {
|
|||||||
<div className="col-auto ms-auto d-print-none">
|
<div className="col-auto ms-auto d-print-none">
|
||||||
<PageHeaderActions
|
<PageHeaderActions
|
||||||
loading={loading}
|
loading={loading}
|
||||||
onPreview={handlePreviewDiff}
|
|
||||||
disablePreview={loading || items.length === 0}
|
|
||||||
onRefresh={fetchItems}
|
onRefresh={fetchItems}
|
||||||
disableRefresh={loading}
|
disableRefresh={loading}
|
||||||
onImport={handleImport}
|
onImport={handleImport}
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import {
|
|||||||
IconDeviceFloppy,
|
IconDeviceFloppy,
|
||||||
IconHash,
|
IconHash,
|
||||||
IconClock,
|
IconClock,
|
||||||
IconFileText,
|
IconFileText
|
||||||
IconEye
|
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import LockBanner from './components/LockBanner.jsx';
|
import LockBanner from './components/LockBanner.jsx';
|
||||||
import TableSkeleton from './components/TableSkeleton.jsx';
|
import TableSkeleton from './components/TableSkeleton.jsx';
|
||||||
@@ -406,8 +405,6 @@ function DomainsNewManager() {
|
|||||||
<div className="col-auto ms-auto d-print-none">
|
<div className="col-auto ms-auto d-print-none">
|
||||||
<PageHeaderActions
|
<PageHeaderActions
|
||||||
loading={loading}
|
loading={loading}
|
||||||
onPreview={handlePreviewDiff}
|
|
||||||
disablePreview={loading || items.length === 0}
|
|
||||||
onRefresh={fetchItems}
|
onRefresh={fetchItems}
|
||||||
disableRefresh={loading}
|
disableRefresh={loading}
|
||||||
onImport={handleImport}
|
onImport={handleImport}
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import {
|
|||||||
IconDeviceFloppy,
|
IconDeviceFloppy,
|
||||||
IconHash,
|
IconHash,
|
||||||
IconClock,
|
IconClock,
|
||||||
IconFileText,
|
IconFileText
|
||||||
IconEye
|
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import LockBanner from './components/LockBanner.jsx';
|
import LockBanner from './components/LockBanner.jsx';
|
||||||
import TableSkeleton from './components/TableSkeleton.jsx';
|
import TableSkeleton from './components/TableSkeleton.jsx';
|
||||||
@@ -415,8 +414,6 @@ function IPRangesManager() {
|
|||||||
<div className="col-auto ms-auto d-print-none">
|
<div className="col-auto ms-auto d-print-none">
|
||||||
<PageHeaderActions
|
<PageHeaderActions
|
||||||
loading={loading}
|
loading={loading}
|
||||||
onPreview={handlePreviewDiff}
|
|
||||||
disablePreview={loading || items.length === 0}
|
|
||||||
onRefresh={fetchItems}
|
onRefresh={fetchItems}
|
||||||
disableRefresh={loading}
|
disableRefresh={loading}
|
||||||
onImport={handleImport}
|
onImport={handleImport}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {
|
import {
|
||||||
IconEye,
|
|
||||||
IconRefresh,
|
IconRefresh,
|
||||||
IconUpload,
|
IconUpload,
|
||||||
IconDownload,
|
IconDownload,
|
||||||
@@ -28,38 +27,58 @@ function PageHeaderActions({
|
|||||||
return (
|
return (
|
||||||
<div className="header-actions" role="toolbar" aria-label="Действия страницы">
|
<div className="header-actions" role="toolbar" aria-label="Действия страницы">
|
||||||
<div className="btn-group">
|
<div className="btn-group">
|
||||||
{onOnlineUpdate && (
|
{(onBackgroundUpdate || onOnlineUpdate) && (
|
||||||
<button className="btn btn-outline-warning" type="button" onClick={onOnlineUpdate} title="Online-обновление BGP (WebSocket)">
|
<div className="btn-group">
|
||||||
<IconBolt className="me-1" /> Online-обновление
|
{/* Дефолтное действие — фоновое обновление */}
|
||||||
</button>
|
<button
|
||||||
)}
|
className="btn btn-outline-success"
|
||||||
{onBackgroundUpdate && (
|
type="button"
|
||||||
<button className="btn btn-outline-success" type="button" onClick={onBackgroundUpdate} title="Фоновое обновление BGP (POST)">
|
onClick={onBackgroundUpdate || onOnlineUpdate}
|
||||||
<IconPlayerPlay className="me-1" /> Фоновое обновление
|
title="Фоновое обновление BGP (POST)"
|
||||||
</button>
|
>
|
||||||
|
<IconPlayerPlay className="me-1" /> Фоновое обновление
|
||||||
|
</button>
|
||||||
|
{(onBackgroundUpdate && onOnlineUpdate) && (
|
||||||
|
<>
|
||||||
|
<button className="btn btn-outline-success dropdown-toggle dropdown-toggle-split" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Другие варианты обновления"></button>
|
||||||
|
<div className="dropdown-menu">
|
||||||
|
<button className="dropdown-item" type="button" onClick={onBackgroundUpdate}>
|
||||||
|
<IconPlayerPlay className="me-1" /> Фоновое обновление
|
||||||
|
</button>
|
||||||
|
<button className="dropdown-item" type="button" onClick={onOnlineUpdate}>
|
||||||
|
<IconBolt className="me-1" /> Online-обновление
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<span className="vr d-none d-lg-inline" />
|
<span className="vr d-none d-lg-inline" />
|
||||||
<div className="btn-group">
|
<div className="btn-group">
|
||||||
{onPreview && (
|
|
||||||
<button className="btn btn-outline-secondary" type="button" onClick={onPreview} disabled={disablePreview} title="Предпросмотр изменений">
|
|
||||||
<IconEye className="me-1" /> Предпросмотр
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
{onRefresh && (
|
{onRefresh && (
|
||||||
<button className="btn btn-outline-secondary" type="button" onClick={onRefresh} disabled={disableRefresh} title="Обновить данные">
|
<button className="btn btn-outline-secondary" type="button" onClick={onRefresh} disabled={disableRefresh} title="Обновить данные">
|
||||||
<IconRefresh className={loading ? 'spin me-1' : 'me-1'} /> Обновить
|
<IconRefresh className={loading ? 'spin me-1' : 'me-1'} /> Обновить
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{onImport && (
|
{(onImport || onExport) && (
|
||||||
<button className="btn btn-outline-primary" type="button" onClick={onImport} title="Импорт">
|
<div className="dropdown">
|
||||||
<IconUpload className="me-1" /> Импорт
|
<button className="btn btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" title="Импорт/Экспорт">
|
||||||
</button>
|
<IconDownload className="me-1" /> Импорт/Экспорт
|
||||||
)}
|
</button>
|
||||||
{onExport && (
|
<div className="dropdown-menu">
|
||||||
<button className="btn btn-outline-primary" type="button" onClick={onExport} disabled={disableExport} title="Экспорт">
|
{onImport && (
|
||||||
<IconDownload className="me-1" /> Экспорт
|
<button className="dropdown-item" type="button" onClick={onImport}>
|
||||||
</button>
|
<IconUpload className="me-1" /> Импорт
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{onExport && (
|
||||||
|
<button className="dropdown-item" type="button" onClick={onExport} disabled={disableExport}>
|
||||||
|
<IconDownload className="me-1" /> Экспорт
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
{onClear && (
|
{onClear && (
|
||||||
<button className="btn btn-outline-secondary" type="button" onClick={onClear} disabled={disableClear} title="Очистить пустые/невалидные">
|
<button className="btn btn-outline-secondary" type="button" onClick={onClear} disabled={disableClear} title="Очистить пустые/невалидные">
|
||||||
|
|||||||
Reference in New Issue
Block a user