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