Simplify device status display and bump client versions
Build and Deploy Gateway / build-and-push (push) Successful in 13s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-08-07 16:33:02 +03:00
parent 560c243047
commit 9f31eaf396
4 changed files with 23 additions and 60 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
export const HARBOR_VERSIONS = Object.freeze({
macClient: '0.12.0',
gatewayClient: '0.12.0',
macClient: '0.12.1',
gatewayClient: '0.12.1',
gatewayBackend: '0.12.0',
});
+7 -18
View File
@@ -6,11 +6,6 @@ import {
sortDevicesByTraffic,
} from '../utils/format.js';
const STATUS_LABELS = {
online: 'В сети',
recent: 'Недавно',
offline: 'Не в сети',
};
const AUTO_REFRESH_MS = 15_000;
const DEVICE_MOVE_MS = 520;
@@ -250,7 +245,7 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
const editing = editingId === device.id;
const saving = savingId === device.id;
const seen = formatLastSeen(device.lastSeenAt);
const uncertainIdentity = device.confidence !== 'high';
const online = device.status === 'online';
const download = formatByteString(device.downloadBytes);
const upload = formatByteString(device.uploadBytes);
const policyBusy = device.policyStatus === 'applying';
@@ -285,7 +280,6 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
key={device.id}
>
<div className="client-device-heading">
<span className="client-device-status">{STATUS_LABELS[device.status]}</span>
{editing ? (
<form className="client-device-alias" onSubmit={(event) => saveAlias(event, device)}>
<input
@@ -350,14 +344,6 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
<div className="client-device-addresses">
{title !== device.ip && device.ip && <span>{device.ip}</span>}
{device.manufacturer && <span className="client-device-manufacturer">{device.manufacturer}</span>}
{uncertainIdentity && <span className="client-device-identity client-tooltip-anchor" tabIndex="0" aria-label="Пояснение идентификации устройства">
<Tooltip>{device.confidence === 'medium'
? 'Устройство использует приватный MAC, производитель может не определиться'
: device.confidence === 'ambiguous'
? 'Gateway видит это устройство с несколькими IP или интерфейсами, поэтому индивидуальное правило небезопасно'
: 'Устройство определено приблизительно'}</Tooltip>
</span>}
</div>
<span className="client-device-policy-wrap client-tooltip-anchor">
<button
@@ -373,9 +359,12 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
</button>
<Tooltip>{policyTooltip}</Tooltip>
</span>
<span className="client-device-last-seen" tabIndex="0">
<time dateTime={device.lastSeenAt} aria-label={seen.tooltip}>
<TextMorph from={seen.label} to={seen.relative} />
<span className={`client-device-last-seen${online ? ' is-online' : ''}`} tabIndex="0">
<time
dateTime={device.lastSeenAt}
aria-label={`${online ? 'В сети' : 'Не в сети'}. Последний контакт: ${seen.tooltip}`}
>
{online ? 'В сети' : <TextMorph from={seen.label} to={seen.relative} />}
</time>
</span>
</div>
+7 -38
View File
@@ -885,7 +885,7 @@ p {
.client-device-heading {
display: grid;
grid-template-columns: 60px minmax(0, 1fr) auto 32px;
grid-template-columns: minmax(0, 1fr) auto 32px;
align-items: center;
gap: 6px;
min-height: 28px;
@@ -907,33 +907,6 @@ p {
white-space: nowrap;
}
.client-device-status {
display: flex;
align-items: center;
gap: 6px;
color: var(--client-muted);
font-size: 9px;
white-space: nowrap;
}
.client-device-status::before {
flex: 0 0 auto;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
background: currentColor;
content: '';
}
.client-device.is-online .client-device-status {
color: var(--client-accent);
}
.client-device.is-offline .client-device-status {
opacity: 0.56;
}
.client-device-edit-wrap,
.client-device-pin-wrap {
width: 28px;
@@ -996,7 +969,6 @@ p {
grid-template-columns: minmax(0, 1fr) 72px auto;
align-items: center;
gap: 8px;
margin-left: 66px;
color: var(--client-muted);
font-size: 9px;
line-height: 1.5;
@@ -1019,19 +991,17 @@ p {
content: '·';
}
.client-device-identity {
position: relative;
margin-left: 4px;
color: var(--client-accent);
cursor: help;
}
.client-device-last-seen {
color: var(--client-text);
cursor: default;
white-space: nowrap;
}
.client-device-last-seen.is-online {
color: var(--client-accent);
font-weight: 700;
}
.client-device-pin-wrap.client-tooltip-anchor > .client-tooltip {
right: 0;
left: auto;
@@ -1086,8 +1056,7 @@ p {
transform: scale(1);
}
.client-device-last-seen:focus-visible,
.client-device-identity:focus-visible {
.client-device-last-seen:focus-visible {
border-radius: 3px;
outline: 2px solid var(--client-accent);
outline-offset: 3px;