Add device traffic reset with outbound baselines
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
type CSSProperties,
|
||||
} from 'react';
|
||||
import { Drawer } from '../../ui/Drawer.js';
|
||||
import { ConfirmationDialog } from '../../ui/ConfirmationDialog.js';
|
||||
import { Tooltip } from '../../ui/Tooltip.js';
|
||||
import { copyText } from '../../utils/clientControls.js';
|
||||
import {
|
||||
@@ -70,9 +71,14 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) {
|
||||
refreshing,
|
||||
refreshCycle,
|
||||
savingId,
|
||||
resetOpen,
|
||||
resetting,
|
||||
load: onLoad,
|
||||
updateDevice,
|
||||
updatePolicy,
|
||||
requestTrafficReset,
|
||||
cancelTrafficReset,
|
||||
confirmResetTraffic,
|
||||
close: onClose,
|
||||
} = feature;
|
||||
const [editingId, setEditingId] = useState('');
|
||||
@@ -278,7 +284,7 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) {
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
return <>
|
||||
<Drawer
|
||||
panelRef={panelRef}
|
||||
closeRef={closeRef}
|
||||
@@ -333,6 +339,17 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) {
|
||||
<button type="button" aria-pressed={trafficScale === 'linear'} onClick={() => setTrafficScale('linear')}>Лин</button>
|
||||
<button type="button" aria-pressed={trafficScale === 'log'} onClick={() => setTrafficScale('log')}>Лог</button>
|
||||
</span>
|
||||
<button
|
||||
className="client-devices-reset"
|
||||
type="button"
|
||||
disabled={!snapshot || resetting}
|
||||
onClick={requestTrafficReset}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M4 12a8 8 0 1 0 2.3-5.7M4 5v7h7" />
|
||||
</svg>
|
||||
<span>Сбросить данные</span>
|
||||
</button>
|
||||
</div>
|
||||
<h2 id="client-devices-title">Устройства</h2>
|
||||
<div className="client-instructions-intro">
|
||||
@@ -623,5 +640,17 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) {
|
||||
})}
|
||||
</div>
|
||||
</Drawer>
|
||||
);
|
||||
<ConfirmationDialog
|
||||
open={resetOpen}
|
||||
id="client-devices-reset"
|
||||
kicker="Данные устройств"
|
||||
title="Сбросить статистику?"
|
||||
description="Вход и выход для всех устройств начнут считаться заново. Общая скорость и история Prometheus/Grafana останутся без изменений."
|
||||
cancelLabel="Оставить данные"
|
||||
confirmLabel="Сбросить"
|
||||
busy={resetting}
|
||||
onCancel={cancelTrafficReset}
|
||||
onConfirm={confirmResetTraffic}
|
||||
/>
|
||||
</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user