Improve failover startup handling and status UI
This commit is contained in:
@@ -796,11 +796,13 @@ export function ClientOverviewPage({
|
||||
? `Переключаем на ${subscriptionDomain(operationProfile.subscription.host)} · ${operationServer.label}`
|
||||
: '';
|
||||
const failoverIdentity = isGateway && state.failover.enabled
|
||||
? `${state.failover.currentRole === 'reserve'
|
||||
? state.failover.currentRole === 'other'
|
||||
? state.failover.reason === 'vpn-stopped'
|
||||
? 'Резерв включится при запуске VPN'
|
||||
: 'Резерв применится после перезапуска VPN'
|
||||
: `${state.failover.currentRole === 'reserve'
|
||||
? 'Резервный канал'
|
||||
: state.failover.currentRole === 'primary'
|
||||
? 'Основной канал'
|
||||
: 'Текущий канал вне резервной пары'} · ${failoverReasonLabel(state.failover.reason)}`
|
||||
: 'Основной канал'} · ${failoverReasonLabel(state.failover.reason)}`
|
||||
: '';
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent } from 'react';
|
||||
import { useEffect, useMemo, useRef, useState, type FormEvent, type KeyboardEvent as ReactKeyboardEvent } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
import { CONNECTIVITY_SITES, MAX_CUSTOM_DIAGNOSTIC_SERVICES, type DiagnosticSettings } from '../../../shared/connectivityDiagnostics.js';
|
||||
import { normalizeFailoverPolicy, type FailoverPolicy, type FailoverSnapshot } from '../../../shared/failover.js';
|
||||
@@ -72,6 +72,14 @@ const milliseconds = (value: string, fallback: number) => {
|
||||
return Number.isFinite(parsed) ? Math.round(parsed * 1000) : fallback;
|
||||
};
|
||||
|
||||
function pulseNumber(event: FormEvent<HTMLInputElement>) {
|
||||
if (matchMedia('(prefers-reduced-motion: reduce)').matches) return;
|
||||
event.currentTarget.animate([
|
||||
{ color: 'var(--client-accent)', textShadow: '0 0 10px color-mix(in oklch, var(--client-accent) 54%, transparent)' },
|
||||
{ color: 'var(--client-text)', textShadow: '0 0 0 transparent' },
|
||||
], { duration: 320, easing: 'cubic-bezier(0.16, 1, 0.3, 1)' });
|
||||
}
|
||||
|
||||
const reasonLabel = (reason: string | null) => ({
|
||||
'primary-healthy': 'Основной канал работает',
|
||||
'health-unknown': 'Ожидаем результаты проверки',
|
||||
@@ -270,6 +278,8 @@ export function FailoverPanel({
|
||||
const [serviceError, setServiceError] = useState('');
|
||||
const [openPicker, setOpenPicker] = useState('');
|
||||
const [removingCheckId, setRemovingCheckId] = useState('');
|
||||
const [advancedOpen, setAdvancedOpen] = useState(false);
|
||||
const [advancedClosing, setAdvancedClosing] = useState(false);
|
||||
useEffect(() => {
|
||||
if (!dirty) setDraft(snapshot.policy);
|
||||
}, [snapshot.policy, dirty]);
|
||||
@@ -374,6 +384,14 @@ export function FailoverPanel({
|
||||
if (!document.startViewTransition || matchMedia('(prefers-reduced-motion: reduce)').matches) finish();
|
||||
else document.startViewTransition(finish);
|
||||
};
|
||||
const toggleAdvanced = () => {
|
||||
if (!advancedOpen) {
|
||||
setAdvancedOpen(true);
|
||||
return;
|
||||
}
|
||||
if (matchMedia('(prefers-reduced-motion: reduce)').matches) setAdvancedOpen(false);
|
||||
else setAdvancedClosing(true);
|
||||
};
|
||||
|
||||
return <Drawer
|
||||
panelRef={feature.panelRef}
|
||||
@@ -415,14 +433,20 @@ export function FailoverPanel({
|
||||
))?.id || '';
|
||||
const healthLabel = missing
|
||||
? 'Цель недоступна'
|
||||
: !draft.enabled
|
||||
? 'Выключен'
|
||||
: snapshot.reason === 'vpn-stopped' || snapshot.activation === 'inactive'
|
||||
? 'VPN выключен'
|
||||
: snapshot.activation === 'pending'
|
||||
? 'Ожидает запуска VPN'
|
||||
: channel === 'primary' && snapshot.reason === 'failure-window'
|
||||
? `Нестабилен · ${seconds(Math.max(0, Date.now() - Date.parse(snapshot.primary.stateSince || new Date().toISOString())))} из ${seconds(draft.failureWindowMs)} с`
|
||||
: channel === 'primary' && snapshot.currentRole === 'reserve' && health === 'healthy' && snapshot.reason === 'recovery-hold'
|
||||
? 'Восстанавливается'
|
||||
: health === 'healthy' ? 'Работает' : health === 'unhealthy' ? 'Недоступен' : health === 'not-monitoring' ? 'Не проверяется' : 'Нет данных';
|
||||
return <section className="client-failover-channel" key={channel}>
|
||||
: health === 'healthy' ? 'Работает' : health === 'unhealthy' ? 'Недоступен' : health === 'not-monitoring' ? 'Не проверяется' : 'Ещё не проверен';
|
||||
return <section className="client-failover-channel" data-channel={channel} key={channel}>
|
||||
<div className="client-failover-channel-title">
|
||||
<span>{channel === 'primary' ? 'Основной' : 'Резервный'}</span>
|
||||
<span><b>{channel === 'primary' ? 'Основной' : 'Резервный'}</b><i aria-hidden="true">=</i></span>
|
||||
<strong className={health === 'healthy' ? 'is-healthy' : health === 'unhealthy' || missing ? 'is-unhealthy' : ''}>{healthLabel}</strong>
|
||||
</div>
|
||||
<FailoverPicker
|
||||
@@ -462,6 +486,7 @@ export function FailoverPanel({
|
||||
aria-label={`Таймаут проверки: ${service?.label || 'сервис недоступен'}`}
|
||||
value={seconds(check.timeoutMs)}
|
||||
disabled={blocked || !draft.enabled}
|
||||
onInput={pulseNumber}
|
||||
onChange={(event) => updateChecks((checks) => checks.map((item) => item.serviceId === check.serviceId
|
||||
? { ...item, timeoutMs: milliseconds(event.target.value, item.timeoutMs) }
|
||||
: item))}
|
||||
@@ -473,12 +498,17 @@ export function FailoverPanel({
|
||||
aria-label={`Убрать проверку: ${service?.label || 'сервис недоступен'}`}
|
||||
disabled={blocked || !draft.enabled || draft.checks.length === 1 || Boolean(removingCheckId)}
|
||||
onClick={() => removeCheck(check.serviceId)}
|
||||
>×</button>
|
||||
>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path className="client-failover-remove-lid" d="M8 7V5h8v2m-11 0h14" />
|
||||
<path d="M7 7l1 13h8l1-13M10 10v7m4-7v7" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>;
|
||||
})}
|
||||
{!addingService && <FailoverPicker
|
||||
id="client-failover-service-options"
|
||||
label="+ Добавить проверку"
|
||||
label="Добавить проверку"
|
||||
value=""
|
||||
options={servicePickerOptions}
|
||||
open={openPicker === 'services' && !blocked && draft.enabled}
|
||||
@@ -502,9 +532,9 @@ export function FailoverPanel({
|
||||
</fieldset>
|
||||
|
||||
<section className="client-failover-timing" aria-label="Пороги переключения">
|
||||
<label><span>Проверять каждые, сек</span><input type="number" min="15" max="900" disabled={blocked || !draft.enabled} value={seconds(draft.intervalMs)} onChange={(event) => update({ intervalMs: milliseconds(event.target.value, draft.intervalMs) })} /></label>
|
||||
<label><span>Сбой должен длиться, сек</span><input type="number" min={seconds(draft.intervalMs * 2)} max="1800" disabled={blocked || !draft.enabled} value={seconds(draft.failureWindowMs)} onChange={(event) => update({ failureWindowMs: milliseconds(event.target.value, draft.failureWindowMs) })} /></label>
|
||||
<label><span>Восстановление, сек</span><input type="number" min="60" max="86400" disabled={blocked || !draft.enabled} value={seconds(draft.recoveryWindowMs)} onChange={(event) => update({ recoveryWindowMs: milliseconds(event.target.value, draft.recoveryWindowMs) })} /></label>
|
||||
<label><span>Проверять каждые, сек</span><input type="number" min="15" max="900" disabled={blocked || !draft.enabled} value={seconds(draft.intervalMs)} onInput={pulseNumber} onChange={(event) => update({ intervalMs: milliseconds(event.target.value, draft.intervalMs) })} /></label>
|
||||
<label><span>Сбой должен длиться, сек</span><input type="number" min={seconds(draft.intervalMs * 2)} max="1800" disabled={blocked || !draft.enabled} value={seconds(draft.failureWindowMs)} onInput={pulseNumber} onChange={(event) => update({ failureWindowMs: milliseconds(event.target.value, draft.failureWindowMs) })} /></label>
|
||||
<label><span>Восстановление, сек</span><input type="number" min="60" max="86400" disabled={blocked || !draft.enabled} value={seconds(draft.recoveryWindowMs)} onInput={pulseNumber} onChange={(event) => update({ recoveryWindowMs: milliseconds(event.target.value, draft.recoveryWindowMs) })} /></label>
|
||||
<div className="client-failover-traffic-switch">
|
||||
<span><strong>Переключение во время работы</strong><small>{draft.trafficGuard.enabled ? 'Ждать тишины перед автоматическим переключением' : 'Переключать сразу после подтверждённого сбоя'}</small></span>
|
||||
<HarborSwitch
|
||||
@@ -514,22 +544,40 @@ export function FailoverPanel({
|
||||
onChange={(enabled) => update({ trafficGuard: { ...draft.trafficGuard, enabled } })}
|
||||
/>
|
||||
</div>
|
||||
<label><span>Тишина перед переключением, сек</span><input type="number" min="5" max="600" disabled={blocked || !draft.enabled || !draft.trafficGuard.enabled} value={seconds(draft.trafficGuard.quietWindowMs)} onChange={(event) => update({ trafficGuard: { ...draft.trafficGuard, quietWindowMs: milliseconds(event.target.value, draft.trafficGuard.quietWindowMs) } })} /></label>
|
||||
<label><span>Активный трафик, КБ/с</span><input type="number" min="1" max="102400" disabled={blocked || !draft.enabled || !draft.trafficGuard.enabled} value={Math.round(draft.trafficGuard.thresholdBytesPerSecond / 1024)} onChange={(event) => update({ trafficGuard: { ...draft.trafficGuard, thresholdBytesPerSecond: Number(event.target.value) * 1024 } })} /></label>
|
||||
<label><span>Тишина перед переключением, сек</span><input type="number" min="5" max="600" disabled={blocked || !draft.enabled || !draft.trafficGuard.enabled} value={seconds(draft.trafficGuard.quietWindowMs)} onInput={pulseNumber} onChange={(event) => update({ trafficGuard: { ...draft.trafficGuard, quietWindowMs: milliseconds(event.target.value, draft.trafficGuard.quietWindowMs) } })} /></label>
|
||||
<label><span>Активный трафик, КБ/с</span><input type="number" min="1" max="102400" disabled={blocked || !draft.enabled || !draft.trafficGuard.enabled} value={Math.round(draft.trafficGuard.thresholdBytesPerSecond / 1024)} onInput={pulseNumber} onChange={(event) => update({ trafficGuard: { ...draft.trafficGuard, thresholdBytesPerSecond: Number(event.target.value) * 1024 } })} /></label>
|
||||
</section>
|
||||
|
||||
<details className="client-failover-advanced"><summary>Защита от повторных сбоев</summary>
|
||||
<label><span>Минимум на резерве, сек</span><input type="number" min="60" max="86400" disabled={blocked || !draft.enabled} value={seconds(draft.minimumReserveMs)} onChange={(event) => update({ minimumReserveMs: milliseconds(event.target.value, draft.minimumReserveMs) })} /></label>
|
||||
<label><span>Падений до карантина</span><input type="number" min="2" max="10" disabled={blocked || !draft.enabled} value={draft.flapProtection.count} onChange={(event) => update({ flapProtection: { ...draft.flapProtection, count: Number(event.target.value) } })} /></label>
|
||||
<label><span>Окно повторных сбоев, ч</span><input type="number" min="1" max="72" disabled={blocked || !draft.enabled} value={Math.round(draft.flapProtection.windowMs / 3_600_000)} onChange={(event) => update({ flapProtection: { ...draft.flapProtection, windowMs: Number(event.target.value) * 3_600_000 } })} /></label>
|
||||
<label><span>Карантин основного, мин</span><input type="number" min="10" max="10080" disabled={blocked || !draft.enabled} value={Math.round(draft.flapProtection.quarantineMs / 60_000)} onChange={(event) => update({ flapProtection: { ...draft.flapProtection, quarantineMs: Number(event.target.value) * 60_000 } })} /></label>
|
||||
</details>
|
||||
<section className={`client-failover-advanced${advancedOpen ? ' is-open' : ''}${advancedClosing ? ' is-closing' : ''}`}>
|
||||
<button type="button" aria-expanded={advancedOpen && !advancedClosing} aria-controls="client-failover-advanced-options" onClick={toggleAdvanced}>
|
||||
<i aria-hidden="true" />
|
||||
<span>Защита от повторных сбоев</span>
|
||||
</button>
|
||||
{advancedOpen && <div
|
||||
id="client-failover-advanced-options"
|
||||
className="client-failover-advanced-options"
|
||||
inert={advancedClosing ? true : undefined}
|
||||
onAnimationEnd={(event) => {
|
||||
if (!advancedClosing || event.target !== event.currentTarget) return;
|
||||
setAdvancedClosing(false);
|
||||
setAdvancedOpen(false);
|
||||
}}
|
||||
>
|
||||
<label><span>Минимум на резерве, сек</span><input type="number" min="60" max="86400" disabled={blocked || !draft.enabled} value={seconds(draft.minimumReserveMs)} onInput={pulseNumber} onChange={(event) => update({ minimumReserveMs: milliseconds(event.target.value, draft.minimumReserveMs) })} /></label>
|
||||
<label><span>Падений до карантина</span><input type="number" min="2" max="10" disabled={blocked || !draft.enabled} value={draft.flapProtection.count} onInput={pulseNumber} onChange={(event) => update({ flapProtection: { ...draft.flapProtection, count: Number(event.target.value) } })} /></label>
|
||||
<label><span>Окно повторных сбоев, ч</span><input type="number" min="1" max="72" disabled={blocked || !draft.enabled} value={Math.round(draft.flapProtection.windowMs / 3_600_000)} onInput={pulseNumber} onChange={(event) => update({ flapProtection: { ...draft.flapProtection, windowMs: Number(event.target.value) * 3_600_000 } })} /></label>
|
||||
<label><span>Карантин основного, мин</span><input type="number" min="10" max="10080" disabled={blocked || !draft.enabled} value={Math.round(draft.flapProtection.quarantineMs / 60_000)} onInput={pulseNumber} onChange={(event) => update({ flapProtection: { ...draft.flapProtection, quarantineMs: Number(event.target.value) * 60_000 } })} /></label>
|
||||
</div>}
|
||||
</section>
|
||||
|
||||
<div className="client-failover-runtime">
|
||||
<strong role="status" aria-live="polite">{blocked ? 'Harbor выполняет действие…' : snapshot.activation === 'pending' ? 'Включится при следующем запуске VPN' : reasonLabel(snapshot.reason)}</strong>
|
||||
<span>Новые соединения: {role ? targetLabel(profiles, snapshot[role].target) : 'текущий канал вне настроенной пары'}</span>
|
||||
<span>{role
|
||||
? `Новые соединения: ${targetLabel(profiles, snapshot[role].target)}`
|
||||
: snapshot.reason === 'vpn-stopped'
|
||||
? `При запуске VPN: ${targetLabel(profiles, draft.primary)}`
|
||||
: `После перезапуска VPN: ${targetLabel(profiles, draft.primary)}`}</span>
|
||||
{snapshot.nextDecisionAt && <span>Следующее решение не раньше чем через {seconds(Math.max(0, Date.parse(snapshot.nextDecisionAt) - Date.now()))} с</span>}
|
||||
{snapshot.currentRole === 'other' && <span>Чтобы запустить автоматику, выключите VPN и включите снова на основном канале.</span>}
|
||||
{activity && <span>{activity.state === 'active' ? `Активный трафик · ${Math.round(activity.totalBytesPerSecond / 1024)} КБ/с · соединений: ${activity.transmittingConnections}` : activity.state === 'quiet' ? `Проверяем тишину · ${Math.min(seconds(quietElapsed), seconds(draft.trafficGuard.quietWindowMs))} из ${seconds(draft.trafficGuard.quietWindowMs)} с` : 'Не удалось определить активность · автоматическое переключение остановлено'}</span>}
|
||||
{activity?.blockers.slice(0, 2).map((blocker) => <small key={`${blocker.device}:${blocker.service}`}>{blocker.device} · {blocker.service} · {Math.round((blocker.uploadBytesPerSecond + blocker.downloadBytesPerSecond) / 1024)} КБ/с</small>)}
|
||||
{activity && activity.blockers.length > 2 && <small>Ещё {activity.blockers.length - 2}</small>}
|
||||
|
||||
@@ -11,12 +11,18 @@
|
||||
.client-failover-switch[aria-checked='true'] > span { background: var(--client-text); box-shadow: 0 0 10px color-mix(in oklch, var(--client-accent) 46%, transparent); transform: translateX(20px); }
|
||||
.client-failover-switch:disabled { cursor: default; opacity: .42; }
|
||||
.client-failover-switch:focus-visible { outline: 2px solid var(--client-accent); outline-offset: 0; border-radius: 999px; }
|
||||
.client-failover-channel { position: relative; display: grid; gap: 6px; }
|
||||
.client-failover-channel-title { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
||||
.client-failover-channel-title strong { min-width: 0; color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); text-align: right; transition: color 600ms ease, filter 600ms ease; }
|
||||
.client-failover-channel { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 52px; }
|
||||
.client-failover-channel-title { display: contents; }
|
||||
.client-failover-channel-title > span { display: flex; align-items: center; gap: 8px; font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); }
|
||||
.client-failover-channel-title > span b { font: inherit; }
|
||||
.client-failover-channel-title > span i { color: var(--client-muted); font-style: normal; }
|
||||
.client-failover-channel[data-channel='primary'] .client-failover-channel-title > span b { color: var(--harbor-connect); text-shadow: 0 0 9px color-mix(in oklch, var(--harbor-connect) 30%, transparent); }
|
||||
.client-failover-channel[data-channel='reserve'] .client-failover-channel-title > span b { color: var(--harbor-gateway); text-shadow: 0 0 9px color-mix(in oklch, var(--harbor-gateway) 30%, transparent); }
|
||||
.client-failover-channel-title strong { grid-column: 3; min-width: 0; color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); text-align: right; white-space: nowrap; transition: color 600ms ease, filter 600ms ease; }
|
||||
.client-failover-channel-title strong.is-healthy { color: var(--client-accent); }
|
||||
.client-failover-channel-title strong.is-unhealthy { color: oklch(0.68 0.15 28); }
|
||||
.client-failover-picker { position: relative; min-width: 0; z-index: 1; }
|
||||
.client-failover-channel > .client-failover-picker { grid-column: 2; }
|
||||
.client-failover-picker.is-open { z-index: 6; }
|
||||
.client-failover-picker-trigger { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--client-border); background: transparent; color: var(--client-text); font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); text-align: left; box-shadow: 0 1px 0 transparent; cursor: pointer; transition: color 220ms ease, box-shadow 300ms ease, text-shadow 300ms ease; }
|
||||
.client-failover-picker-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
@@ -24,7 +30,7 @@
|
||||
.client-failover-picker.is-open .client-failover-picker-trigger { color: var(--client-accent); box-shadow: 0 1px 0 color-mix(in oklch, var(--client-accent) 64%, transparent); text-shadow: 0 0 10px color-mix(in oklch, var(--client-accent) 34%, transparent); }
|
||||
.client-failover-picker.is-open .client-failover-picker-trigger svg { transform: rotate(180deg); }
|
||||
.client-failover-picker-trigger:disabled { color: var(--client-muted); cursor: default; opacity: .45; }
|
||||
.client-failover-picker-trigger:focus-visible { outline: 2px solid var(--client-accent); outline-offset: 2px; }
|
||||
.client-failover-picker-trigger:focus-visible { outline: 0; color: var(--client-accent); box-shadow: 0 1px 0 color-mix(in oklch, var(--client-accent) 72%, transparent); text-shadow: 0 0 10px color-mix(in oklch, var(--client-accent) 34%, transparent); }
|
||||
.client-failover-picker-list { position: absolute; top: calc(100% + 3px); left: -8px; z-index: 5; width: calc(100% + 16px); max-height: min(320px, 48vh); display: grid; gap: 1px; padding: 7px 8px; overflow-y: auto; background: color-mix(in oklch, var(--client-bg) 92%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); opacity: 0; visibility: hidden; filter: blur(6px); transform: translateY(-6px); pointer-events: none; transition: opacity 180ms ease, filter 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 180ms; }
|
||||
.client-failover-picker.is-open .client-failover-picker-list { opacity: 1; visibility: visible; filter: blur(0); transform: translateY(0); pointer-events: auto; transition: opacity 240ms ease, filter 240ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s; }
|
||||
.client-failover-picker-list button { min-height: 34px; padding: 6px; border: 0; background: transparent; color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); text-align: left; cursor: pointer; opacity: 0; filter: blur(5px); transform: translateY(-4px); transition: color 180ms ease, opacity 180ms ease, filter 180ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1); }
|
||||
@@ -32,20 +38,25 @@
|
||||
.client-failover-picker-list button:hover, .client-failover-picker-list button:focus-visible, .client-failover-picker-list button[aria-selected='true'] { outline: 0; color: var(--client-accent); text-shadow: 0 0 9px color-mix(in oklch, var(--client-accent) 38%, transparent); }
|
||||
.client-failover-picker-list button[aria-disabled='true'] { color: color-mix(in oklch, var(--client-muted) 58%, transparent); cursor: default; text-shadow: none; }
|
||||
.client-failover-timing label, .client-failover-advanced label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 48%); align-items: center; gap: 16px; min-height: 38px; color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); }
|
||||
.client-failover-timing input, .client-failover-advanced input { min-width: 0; min-height: 34px; border: 0; border-bottom: 1px solid var(--client-border); background: transparent; color: var(--client-text); font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); }
|
||||
.client-failover-timing input, .client-failover-advanced input { min-width: 0; min-height: 38px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--client-border); border-radius: 0; background: transparent; color: var(--client-text); font: var(--type-item-title); font-variant-numeric: var(--numeric-tabular); letter-spacing: var(--type-item-title-tracking); text-align: center; text-transform: var(--type-item-title-transform); appearance: textfield; transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, text-shadow 220ms ease; }
|
||||
.client-failover-timing input:disabled, .client-failover-advanced input:disabled { color: var(--client-muted); opacity: .45; }
|
||||
.client-failover-services { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
|
||||
.client-failover-services legend { margin-bottom: 10px; }
|
||||
.client-failover-service { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: 12px; min-height: 38px; animation: failover-service-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both; }
|
||||
.client-failover-service.is-removing { animation: failover-service-out 180ms ease both; pointer-events: none; }
|
||||
.client-failover-service.is-removing { animation: failover-service-out 300ms ease both; pointer-events: none; }
|
||||
.client-failover-service-name { min-width: 0; overflow: hidden; color: var(--client-text); font: var(--type-body); letter-spacing: var(--type-body-tracking); text-overflow: ellipsis; text-transform: var(--type-body-transform); white-space: nowrap; }
|
||||
.client-failover-service-timeout { display: flex; align-items: center; gap: 8px; color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); }
|
||||
.client-failover-service-timeout input { width: 52px; min-height: 30px; border: 0; border-bottom: 1px solid var(--client-border); background: transparent; color: var(--client-text); font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); }
|
||||
.client-failover-remove-service { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--client-muted); font: var(--type-icon-close); cursor: pointer; transition: color 180ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1); }
|
||||
.client-failover-remove-service:hover:not(:disabled), .client-failover-remove-service:focus-visible { outline: 0; color: oklch(0.68 0.15 28); transform: scale(1.08); }
|
||||
.client-failover-service-timeout input { width: 58px; min-height: 34px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--client-border); border-radius: 0; background: transparent; color: var(--client-text); font: var(--type-item-title); font-variant-numeric: var(--numeric-tabular); letter-spacing: var(--type-item-title-tracking); text-align: center; text-transform: var(--type-item-title-transform); appearance: textfield; transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, text-shadow 220ms ease; }
|
||||
.client-failover-remove-service { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: oklch(0.62 0.16 28); cursor: pointer; transition: color 180ms ease, filter 240ms ease; }
|
||||
.client-failover-remove-service svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.client-failover-remove-lid { transform-origin: center 7px; transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1); }
|
||||
.client-failover-remove-service:hover:not(:disabled), .client-failover-remove-service:focus-visible { outline: 0; color: oklch(0.7 0.18 28); filter: drop-shadow(0 0 7px oklch(0.7 0.18 28 / 0.42)); }
|
||||
.client-failover-remove-service:hover:not(:disabled) .client-failover-remove-lid, .client-failover-remove-service:focus-visible .client-failover-remove-lid { transform: translateY(-2px) rotate(-8deg); }
|
||||
.client-failover-remove-service:disabled { cursor: default; opacity: .28; }
|
||||
.client-failover-services > .client-failover-picker { justify-self: start; min-width: 210px; }
|
||||
.client-failover-services > .client-failover-picker .client-failover-picker-trigger { color: var(--client-accent); font: var(--type-control); letter-spacing: var(--type-control-tracking); text-transform: var(--type-control-transform); }
|
||||
.client-failover-services > .client-failover-picker .client-failover-picker-trigger::before { content: '+'; flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; color: var(--client-accent); font: var(--type-drawer-title); letter-spacing: var(--type-drawer-title-tracking); text-transform: var(--type-drawer-title-transform); transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), filter 240ms ease; }
|
||||
.client-failover-services > .client-failover-picker.is-open .client-failover-picker-trigger::before { transform: rotate(45deg); filter: drop-shadow(0 0 6px color-mix(in oklch, var(--client-accent) 44%, transparent)); }
|
||||
.client-failover-services > .client-failover-picker .client-failover-picker-list { width: max-content; min-width: calc(100% + 16px); }
|
||||
.client-failover-service-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 8px 12px; padding: 8px 0; animation: failover-service-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both; }
|
||||
.client-failover-service-editor input { min-width: 0; min-height: 34px; border: 0; border-bottom: 1px solid var(--client-border); background: transparent; color: var(--client-text); font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); }
|
||||
@@ -57,7 +68,16 @@
|
||||
.client-failover-traffic-switch > span { min-width: 0; display: grid; gap: 3px; }
|
||||
.client-failover-traffic-switch strong { color: var(--client-text); font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); }
|
||||
.client-failover-traffic-switch small { color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); }
|
||||
.client-failover-advanced summary { min-height: 38px; color: var(--client-accent); font: var(--type-control); letter-spacing: var(--type-control-tracking); text-transform: var(--type-control-transform); cursor: pointer; }
|
||||
.client-failover-advanced { display: grid; gap: 5px; }
|
||||
.client-failover-advanced > button { width: fit-content; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: var(--client-accent); font: var(--type-control); letter-spacing: var(--type-control-tracking); text-transform: var(--type-control-transform); cursor: pointer; }
|
||||
.client-failover-advanced > button i { position: relative; width: 14px; height: 14px; }
|
||||
.client-failover-advanced > button i::before, .client-failover-advanced > button i::after { content: ''; position: absolute; top: 6px; left: 0; width: 14px; height: 1px; background: currentColor; transform-origin: center; transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease; }
|
||||
.client-failover-advanced > button i::after { transform: rotate(90deg); }
|
||||
.client-failover-advanced.is-open > button i::before { transform: rotate(180deg); }
|
||||
.client-failover-advanced.is-open > button i::after { opacity: 0; transform: rotate(180deg); }
|
||||
.client-failover-advanced > button:focus-visible { outline: 0; text-shadow: 0 0 10px color-mix(in oklch, var(--client-accent) 44%, transparent); }
|
||||
.client-failover-advanced-options { display: grid; gap: 5px; animation: failover-advanced-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both; }
|
||||
.client-failover-advanced.is-closing .client-failover-advanced-options { animation: failover-advanced-out 220ms ease both; pointer-events: none; }
|
||||
.client-failover-runtime { min-height: 132px; display: grid; align-content: center; gap: 5px; padding: 14px 0; border-top: 1px solid color-mix(in oklch, var(--client-border) 48%, transparent); border-bottom: 1px solid color-mix(in oklch, var(--client-border) 48%, transparent); font-variant-numeric: var(--numeric-tabular); }
|
||||
.client-failover-runtime strong { font: var(--type-body); letter-spacing: var(--type-body-tracking); text-transform: var(--type-body-transform); }
|
||||
.client-failover-runtime span, .client-failover-runtime small { color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); }
|
||||
@@ -69,8 +89,11 @@
|
||||
.client-failover-actions button { padding: 7px 0; border: 0; background: transparent; color: var(--client-accent); font: var(--type-control); letter-spacing: var(--type-control-tracking); text-transform: var(--type-control-transform); cursor: pointer; }
|
||||
.client-failover-actions small { flex-basis: 100%; margin-top: -14px; color: var(--client-muted); font: var(--type-label); letter-spacing: var(--type-label-tracking); text-transform: var(--type-label-transform); }
|
||||
.client-failover-actions button:disabled { color: var(--client-muted); cursor: default; opacity: .45; }
|
||||
.client-failover-actions button:focus-visible, .client-failover-form input:focus-visible, .client-failover-advanced summary:focus-visible, .client-failover-service-editor button:focus-visible, .client-failover-discard button:focus-visible { outline: 2px solid var(--client-accent); outline-offset: 2px; }
|
||||
.client-failover-actions button:focus-visible, .client-failover-service-editor button:focus-visible, .client-failover-discard button:focus-visible { outline: 2px solid var(--client-accent); outline-offset: 2px; }
|
||||
.client-failover-form input:focus-visible { outline: 0; border-bottom-color: var(--client-accent); box-shadow: 0 1px 0 color-mix(in oklch, var(--client-accent) 60%, transparent); text-shadow: 0 0 9px color-mix(in oklch, var(--client-accent) 34%, transparent); }
|
||||
@keyframes failover-service-in { from { opacity: 0; filter: blur(5px); transform: translateY(-4px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }
|
||||
@keyframes failover-service-out { from { opacity: 1; filter: blur(0); transform: translateY(0); } to { opacity: 0; filter: blur(5px); transform: translateY(-4px); } }
|
||||
@media (max-width: 560px) { .client-failover-heading { padding-right: 44px; } .client-failover-channel-title { align-items: start; } .client-failover-channel-title strong { max-width: 60%; } .client-failover-timing label, .client-failover-advanced label { grid-template-columns: 1fr; gap: 4px; } .client-failover-service { grid-template-columns: minmax(0, 1fr) 32px; gap: 6px 10px; } .client-failover-service-timeout { grid-column: 1; grid-row: 2; justify-self: start; } .client-failover-remove-service { grid-column: 2; grid-row: 1 / span 2; } .client-failover-service-editor { grid-template-columns: 1fr; gap: 2px; } }
|
||||
@media (prefers-reduced-motion: reduce) { .client-failover-channel-title strong, .client-failover-switch::before, .client-failover-switch > span, .client-failover-picker-trigger, .client-failover-picker-trigger svg, .client-failover-picker-list, .client-failover-picker-list button, .client-failover-remove-service { transition: none; } .client-failover-service, .client-failover-service-editor { animation: none; } }
|
||||
@keyframes failover-service-out { from { opacity: 1; filter: blur(0); transform: translateX(0) scale(1); } to { opacity: 0; filter: blur(6px); transform: translateX(16px) scale(.96); } }
|
||||
@keyframes failover-advanced-in { from { opacity: 0; filter: blur(5px); transform: translateY(-5px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }
|
||||
@keyframes failover-advanced-out { from { opacity: 1; filter: blur(0); transform: translateY(0); } to { opacity: 0; filter: blur(5px); transform: translateY(-5px); } }
|
||||
@media (max-width: 560px) { .client-failover-heading { padding-right: 44px; } .client-failover-channel { grid-template-columns: auto minmax(0, 1fr); gap: 5px 10px; } .client-failover-channel-title strong { grid-column: 2; grid-row: 2; text-align: left; } .client-failover-channel > .client-failover-picker { grid-column: 2; grid-row: 1; } .client-failover-timing label, .client-failover-advanced label { grid-template-columns: 1fr; gap: 4px; } .client-failover-service { grid-template-columns: minmax(0, 1fr) 32px; gap: 6px 10px; } .client-failover-service-timeout { grid-column: 1; grid-row: 2; justify-self: start; } .client-failover-remove-service { grid-column: 2; grid-row: 1 / span 2; } .client-failover-service-editor { grid-template-columns: 1fr; gap: 2px; } }
|
||||
@media (prefers-reduced-motion: reduce) { .client-failover-channel-title strong, .client-failover-switch::before, .client-failover-switch > span, .client-failover-picker-trigger, .client-failover-picker-trigger::before, .client-failover-picker-trigger svg, .client-failover-picker-list, .client-failover-picker-list button, .client-failover-remove-service, .client-failover-remove-lid, .client-failover-advanced > button i::before, .client-failover-advanced > button i::after { transition: none; } .client-failover-service, .client-failover-service-editor, .client-failover-advanced-options { animation: none; } }
|
||||
|
||||
Reference in New Issue
Block a user