diff --git a/frontend/src/pages/nodes/NodeList.css b/frontend/src/pages/nodes/NodeList.css index 90c8a5e42..ba6feda8e 100644 --- a/frontend/src/pages/nodes/NodeList.css +++ b/frontend/src/pages/nodes/NodeList.css @@ -4,198 +4,583 @@ font-weight: 400; font-display: swap; } - -.nodes-overview { - min-width: 0; +@font-face { + font-family: 'Source Sans Pro'; + src: url('./fonts/SourceSansPro-Semibold.woff2') format('woff2'); + font-weight: 600; + font-display: swap; +} +@font-face { + font-family: 'Source Sans Pro'; + src: url('./fonts/SourceSansPro-Bold.woff2') format('woff2'); + font-weight: 700; + font-display: swap; +} +.nodes-page.is-dark:not(.is-ultra) { + --bg-page: #1c1e23; } +@media (min-width: 769px) { + .nodes-page .ant-sidebar:not(.sidebar-pinned) { + --sider-rail: 69px !important; + } + + .nodes-page .ant-sidebar:not(.sidebar-pinned) .ant-layout-sider-collapsed { + flex-basis: 69px !important; + width: 69px !important; + min-width: 69px !important; + max-width: 69px !important; + } + + .nodes-page .content-area { + padding-inline-start: 23px; + } +} +.nodes-overview { + --node-fg: var(--node-text); + --node-secondary: var(--node-muted); + --node-card: var(--node-surface); + --node-field: var(--node-header-bg); + --node-line: var(--node-border); + --node-fleet: var(--node-fleet-bg); + --node-button: var(--node-accent); + --node-add-bg: #1269eb; + --node-link: #185ea8; + --node-good: #317a19; + --node-bad: #b42e35; + --node-purple: #722ed1; + --node-group-bg: #ebedf0; + --node-active-bg: #eef6e9; + --node-disabled-bg: #eeeff2; + --node-depleted-bg: #f9ebeb; + --node-online-bg: #e7f0fa; + min-width: 0; + font: + 400 13px/1.25 'Source Sans Pro', + system-ui, + sans-serif; + color: var(--node-fg); +} +.dark .nodes-overview, +.nodes-page.is-dark:not(.is-ultra) .nodes-overview { + --node-fg: #d6d9e0; + --node-secondary: #9296a0; + --node-card: #23252b; + --node-field: #2b2d32; + --node-line: #353841; + --node-fleet: #252b34; + --node-button: #1677ff; + --node-link: #8cb8ff; + --node-good: #66b740; + --node-bad: #eb6469; + --node-purple: #bb9df5; + --node-group-bg: #30333b; + --node-active-bg: #172d12; + --node-disabled-bg: #37393e; + --node-depleted-bg: #401a1c; + --node-online-bg: #102d4b; +} .nodes-heading, -.nodes-toolbar { +.nodes-toolbar, +.nodes-footnote { display: flex; align-items: center; - flex-wrap: wrap; - gap: 8px 12px; - margin-block-end: 12px; + gap: 12px; + margin-inline-start: 12px; } - .nodes-heading { + align-items: start; justify-content: space-between; + margin-block-end: 21px; } - -.nodes-heading .ant-typography { - margin-block: 0; +.nodes-heading h1 { + margin: 0; + font: + 600 25px/34px 'Source Sans Pro', + system-ui, + sans-serif; } - -.nodes-toolbar .ant-input-affix-wrapper { - width: min(100%, 22rem); +.nodes-heading p { + margin: 1px 0 0; + color: var(--node-secondary); + font-size: 13px; + line-height: 21px; } - -.nodes-toolbar .ant-select { - min-width: 9rem; -} - -.node-muted { - color: var(--node-muted); - font-size: 12px; -} - -.node-fleet-table .ant-table { - border: 1px solid var(--ant-color-border-secondary); - border-radius: var(--ant-border-radius); -} - -.node-fleet-table .ant-table-cell { - padding-inline: 6px !important; - overflow-wrap: anywhere; - vertical-align: middle; -} - -.node-fleet-table .ant-table-thead > tr > th { - background: var(--ant-color-fill-secondary); -} - -.node-row-fleet > td, -.node-card.node-row-fleet { - background: var(--node-fleet-bg); -} - -.node-row-master > td, -.node-card.node-row-master { - background: var(--node-master-bg); -} - -.node-cell-stack, -.node-client-counts, -.node-cards { +.nodes-heading-actions { display: flex; - flex-direction: column; - gap: 3px; - min-width: 0; + gap: 12px; + padding-block-start: 4px; } - -.name-cell .name { +.nodes-heading .ant-btn, +.nodes-toolbar .ant-btn { + font-family: inherit; + border-radius: 7px; +} +.nodes-heading .ant-btn { + height: 38px; +} +.nodes-heading .nodes-add { + width: 138px; + background: var(--node-add-bg); font-weight: 600; } - -.node-child-name { - padding-inline-start: 6px; +.nodes-heading .nodes-add:hover { + background: #145fd1; } - -.node-network-speed { - display: inline-grid; - gap: 3px; - font-variant-numeric: tabular-nums; +.nodes-heading .nodes-mtls { + width: 145px; + background: var(--node-card); + border-color: var(--node-line); } - -.node-network-direction { - display: grid; - grid-template-columns: 1em minmax(0, 1fr); - gap: 4px; -} - -.node-hardware { - font-family: 'Source Sans Pro', system-ui, sans-serif; - line-height: 1.25; - font-variant-numeric: tabular-nums; -} - -.node-cpu { - font-size: 17px; - font-weight: 400; -} - -.node-ram { - font-size: 16px; - font-weight: 400; -} - -.node-open-link, -.node-status-button { - display: inline-flex; - align-items: center; +.nodes-toolbar { + min-height: 36px; + margin-block-end: 13px; flex-wrap: wrap; - gap: 4px; } - -.node-open-link:any-link, -.node-update-available { - color: var(--node-text); - text-decoration: underline; +.nodes-toolbar .ant-input-affix-wrapper { + width: min(278px, 100%); } - +.nodes-toolbar .ant-input-affix-wrapper, +.nodes-toolbar .ant-select { + height: 36px; + border-radius: 7px; + font: inherit; + color: var(--node-fg); + background: var(--node-field); + border-color: var(--node-line); +} +.nodes-toolbar .ant-input::placeholder, +.nodes-toolbar .ant-input-prefix, +.node-registered { + color: var(--node-secondary); +} +.nodes-toolbar .ant-input { + font: inherit; +} +.nodes-toolbar .ant-select { + width: 148px; +} +.nodes-toolbar .ant-select-selector { + background: transparent; +} +.node-registered { + margin-inline-start: auto; +} +.nodes-table-card { + padding: 15px 11px 30px; + border: 1px solid var(--node-line); + border-radius: 12px; + background: var(--node-card); +} +.nodes-table-scroll { + overflow-x: auto; + container-type: inline-size; +} +.node-fleet-table { + width: 100%; + min-width: 920px; + table-layout: fixed; + border-spacing: 0; + color: var(--node-fg); +} +.node-fleet-table th, +.node-fleet-table td { + padding: 0 8px; + text-align: start; + vertical-align: middle; + overflow-wrap: anywhere; +} +.node-fleet-table thead th { + height: 44px; + padding-inline: 1px; + background: var(--node-field); + color: var(--node-secondary); + text-align: center; + font-size: 12px; + font-weight: 600; +} +.node-fleet-table thead th:nth-child(6), +.node-fleet-table thead th:nth-child(8) { + font-weight: 700; +} +.node-fleet-table thead th:first-child { + border-start-start-radius: 8px; + border-end-start-radius: 8px; +} +.node-fleet-table thead th:last-child { + border-start-end-radius: 8px; + border-end-end-radius: 8px; +} +.node-fleet-table tbody > tr:not(.node-history-row) { + height: 70px; +} +.node-fleet-table td, +.node-fleet-table .node-name-cell { + border-block-end: 1px solid var(--node-line); +} +.node-row-remote > td:first-child { + padding-inline-end: 0; +} +.node-fleet-table .node-enabled { + text-align: center; + color: var(--node-secondary); +} +.node-fleet-table .node-enabled .ant-switch { + min-width: 34px; + height: 18px; +} +.node-fleet-table .node-enabled .ant-switch-handle { + width: 14px; + height: 14px; +} +.node-fleet-table .node-enabled .ant-switch.ant-switch-checked { + background: var(--node-button); +} +.node-row-fleet > * { + background: var(--node-fleet); +} +.node-row-fleet td:first-child { + box-shadow: inset 3px 0 var(--node-button); +} +.node-row-fleet > td:nth-child(5) { + padding-inline-end: 2px; +} +[dir='rtl'] .node-row-fleet td:first-child { + box-shadow: inset -3px 0 var(--node-button); +} +.node-actions-heading, +.node-readonly-action, +.node-icon-action, +.node-expander, .node-status-button { - max-width: 100%; border: 0; - padding: 2px; + padding: 0; background: transparent; color: inherit; font: inherit; - text-align: start; cursor: pointer; } - -.node-status-button .online-dot, -.node-status-button .xray-error-dot { - display: inline-block; - height: 6px; - width: 6px; - border-radius: 50%; - background: var(--node-online-dot); +.node-actions, +.node-system-action, +.node-status-button { + display: flex; + align-items: center; } - -.node-status-button .xray-error-dot { - background: #722ed1; +.node-actions { + flex-wrap: wrap; + row-gap: 3px; } - -.node-status-tooltip { - overflow-wrap: anywhere; +.node-actions > .ant-checkbox-wrapper { + margin-inline: 8px 5px; } - -.node-update-available { - padding-inline: 0; - height: auto; - text-align: start; - white-space: normal; +.node-actions .ant-checkbox-inner { + width: 16px; + height: 16px; + background: var(--node-card); + border-color: #636b7b; } - -.node-client-counts .ant-tag { - color: var(--ant-color-text); - margin-inline-end: 0; - padding-inline: 3px; +.node-actions .ant-checkbox-checked .ant-checkbox-inner { + background: var(--node-button); + border-color: var(--node-button); } - -.node-cards { - gap: 10px; +.node-system-action { + gap: 12px; + padding-inline-start: 9px; + color: var(--node-secondary); } - -.node-card { - display: grid; - gap: 10px; +.node-system-badge { + min-width: 52px; + padding: 4px 12px; + border-radius: 4px; + color: var(--node-fg); + background: var(--node-group-bg); + font-size: 10px; + font-weight: 600; + text-align: center; + text-transform: uppercase; +} +.node-sigma { + color: var(--node-link); + font-size: 18px; + font-weight: 600; +} +.node-icon-action, +.node-expander { + display: inline-grid; + place-content: center; + width: 18px; + height: 24px; + font-size: 15px; +} +.node-icon-delete { + color: var(--node-bad); +} +.node-icon-action:disabled { + color: var(--node-secondary); + opacity: 0.5; + cursor: default; +} +.node-expander { + height: 18px; + border: 1px solid var(--node-line); + border-radius: 4px; + background: var(--node-field); + color: var(--node-secondary); + font-size: 13px; +} +.node-name, +.node-cell-stack { + display: flex; + flex-direction: column; min-width: 0; - overflow-wrap: anywhere; - background: var(--node-surface); - border: 1px solid var(--node-border); - border-radius: var(--node-radius); - padding: 10px; } - -.node-card-heading, -.node-card-metrics { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); - align-items: start; - gap: 8px; +.node-name { + gap: 4px; + font-size: 12px; + font-weight: 600; } - -.node-card-history summary { - cursor: pointer; -} - -.node-visually-hidden { - position: absolute; - width: 1px; - height: 1px; +.node-name > span, +.node-name > small { overflow: hidden; - clip-path: inset(50%); + text-overflow: ellipsis; white-space: nowrap; } +.node-row-fleet .node-name > span, +.node-row-master .node-name > span { + font-size: 14px; +} +.node-row-fleet .node-name > small { + font-size: 11px; + white-space: normal; +} +.node-name small { + color: var(--node-secondary); + font-size: 10px; + font-weight: 400; +} +.node-open-link:any-link { + color: var(--node-link); + font-size: 10px; + white-space: nowrap; +} +.node-open-link:hover, +.node-open-link:focus-visible { + text-decoration: underline; +} +.node-open-link span { + font-size: 13px; + font-weight: 600; +} +.node-status-button { + gap: 5px; + width: 100%; + text-align: start; + font-size: 11px; + font-weight: 600; +} +.node-status-button[data-status='online'] { + color: var(--node-good); +} +.node-status-button[data-status='offline'] { + color: var(--node-bad); +} +.node-status-button .online-dot, +.node-status-button .xray-error-dot, +.node-status-button .ant-badge-status-dot { + display: inline-block; + width: 8px; + height: 8px; + flex: 0 0 8px; + border-radius: 50%; +} +.node-status-button .online-dot { + background: var(--node-good); +} +.node-status-button .xray-error-dot { + background: var(--node-purple); +} +.node-status-info { + margin-inline-start: auto; + color: var(--node-secondary); + font-size: 10px; +} +.node-status-popup .ant-tooltip-container { + width: min(258px, 90vw); + padding: 12px 14px; + border: 1px solid #414550; + border-radius: 8px; + color: #d6d9e0; + font: + 400 11px/1.4 'Source Sans Pro', + system-ui, + sans-serif; +} +.node-status-tooltip h3 { + margin: 0 0 5px; + color: #a6aab4; + font: + 600 11px 'Source Sans Pro', + system-ui, + sans-serif; +} +.node-status-tooltip dl { + margin: 0; +} +.node-status-tooltip dl > div { + display: flex; + justify-content: space-between; + gap: 25px; + line-height: 23px; +} +.node-status-tooltip dd { + margin: 0; + font-size: 12px; + font-weight: 600; +} +.node-status-tooltip dt { + color: #a6aab4; +} +.node-hardware { + gap: 6px; + font-variant-numeric: tabular-nums; +} +.node-cpu { + font: + 400 11px/15px 'Source Sans Pro', + system-ui, + sans-serif; +} +.node-ram { + font: + 400 10px/13px 'Source Sans Pro', + system-ui, + sans-serif; +} +.node-memory-detail { + color: var(--node-secondary); + font-size: 9px; +} +.node-network-speed, +.node-runtime, +.node-connections, +.node-system-clients { + gap: 5px; + font-size: 10px; +} +.node-network-speed { + display: inline-grid; + font-variant-numeric: tabular-nums; +} +.node-network-direction { + display: flex; + align-items: center; + gap: 3px; +} +.node-network-up { + color: var(--node-link); +} +.node-row-fleet .node-network-speed, +.node-row-master .node-network-speed { + font-size: 12px; +} +.node-connections > span:nth-child(-n + 2) { + font-weight: 600; +} +.node-connection-load, +.node-runtime small { + color: var(--node-secondary); + font-size: 9px; +} +.node-runtime .node-panel-line { + display: flex; + align-items: center; + gap: 3px; +} +.node-runtime .node-icon-action { + width: 13px; + height: 13px; + color: var(--node-link); + font-size: 11px; +} +.node-system-clients { + font-size: 11px; +} +.node-system-clients small { + color: var(--node-secondary); + font-size: 10px; +} +.node-client-counts { + display: grid; + grid-template-columns: 52fr 54fr 58fr; + grid-template-rows: repeat(2, 21px); + gap: 4px 6px; + align-items: center; +} +.node-count-total { + grid-column: 1; + grid-row: 1 / span 2; +} +.node-client-counts .ant-tag { + margin: 0; + padding-inline: 2px; + text-align: center; + line-height: 19px; + font: + 400 11px/19px 'Source Sans Pro', + system-ui, + sans-serif; + color: var(--node-fg); + background: var(--node-disabled-bg); +} +.node-client-counts .node-count-active { + grid-column: 2; + grid-row: 1; + background: var(--node-active-bg); + color: var(--node-good); +} +.node-client-counts .node-count-disabled { + grid-column: 3; + grid-row: 1; +} +.node-client-counts .node-count-depleted { + grid-column: 2; + grid-row: 2; + background: var(--node-depleted-bg); + color: var(--node-bad); +} +.node-client-counts .node-count-online { + grid-column: 3; + grid-row: 2; + background: var(--node-online-bg); + color: var(--node-link); +} +.node-history-row td { + padding: 12px; +} +.nodes-footnote { + justify-content: space-between; + margin-block-start: 9px; + color: var(--node-secondary); + font-size: 11px; + line-height: 22px; +} +@container (max-width: 1205px) { + .node-actions > .ant-checkbox-wrapper { + margin-inline: 4px; + } + + .node-actions > .node-icon-action { + width: 17px; + } +} +@media (max-width: 650px) { + .nodes-heading { + flex-wrap: wrap; + } + .nodes-heading-actions { + flex-wrap: wrap; + } + .node-registered { + margin-inline-start: 0; + } +} diff --git a/frontend/src/pages/nodes/NodeList.stories.tsx b/frontend/src/pages/nodes/NodeList.stories.tsx index 262fb94b6..932e3c954 100644 --- a/frontend/src/pages/nodes/NodeList.stories.tsx +++ b/frontend/src/pages/nodes/NodeList.stories.tsx @@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react-vite'; import { expect, within } from 'storybook/test'; import { ConfigProvider } from 'antd'; import { useState } from 'react'; -import { useMediaQuery } from '@/hooks/useMediaQuery'; import type { NodeRecord } from '@/schemas/node'; import NodeList from './NodeList'; @@ -16,9 +15,8 @@ const counts = { }; const noop = () => {}; -function Fixture({ compact, rtl }: { compact?: boolean; rtl?: boolean }) { +function Fixture({ rtl }: { rtl?: boolean }) { const [selectedIds, setSelectedIds] = useState([]); - const { isMobile } = useMediaQuery(1080); const [now] = useState(Date.now); const nodes: NodeRecord[] = [ { @@ -84,7 +82,6 @@ function Fixture({ compact, rtl }: { compact?: boolean; rtl?: boolean }) {
void; @@ -213,9 +210,7 @@ function OnlineTag({ node }: { node: Pick - - {counts.label} - + {counts.label} ); } @@ -245,22 +240,27 @@ function HealthStatus({ relativeTime: (ts?: number) => string; }) { const { t } = useTranslation(); - const status = node.enable === false ? 'disabled' : node.status; + const status = node.enable === false && node.status !== 'offline' ? 'disabled' : node.status; const { tip, iconColor } = statusIssue(node); return ( +

{t('pages.nodes.fleet.connectionDetails')}

{node.id !== undefined && ( - <> +
- {t('pages.nodes.lastHeartbeat')} · {relativeTime(node.lastHeartbeat)} +
{t('pages.nodes.latency')}
+
{node.latencyMs ? node.latencyMs + ' ms' : '—'}
- {t('pages.nodes.latency')} · {node.latencyMs ? node.latencyMs + ' ms' : '—'} +
{t('pages.nodes.lastHeartbeat')}
+
{relativeTime(node.lastHeartbeat)}
- +
)} {node.xrayState && (
@@ -271,24 +271,55 @@ function HealthStatus({
} > -
); } -function Hardware({ sample, fleet }: { sample?: NodeTelemetry; fleet: boolean }) { - const { t } = useTranslation(); +function Hardware({ + sample, + fleet, + system, +}: { + sample?: NodeTelemetry; + fleet: boolean; + system: boolean; +}) { + const { t, i18n } = useTranslation(); const total = sample?.memTotalBytes; const used = sample?.memUsedBytes; const hasMemory = used != null && total != null && total > 0 && used <= total; + const memorySize = (value: number) => { + if (!total || total < SizeFormatter.ONE_GB) return SizeFormatter.sizeFormat(value); + const useTB = total >= SizeFormatter.ONE_TB; + return new Intl.NumberFormat(i18n.language, { + maximumFractionDigits: 1, + style: 'unit', + unit: useTB ? 'terabyte' : 'gigabyte', + unitDisplay: 'short', + }).format(value / (useTB ? SizeFormatter.ONE_TB : SizeFormatter.ONE_GB)); + }; return (
@@ -302,15 +333,14 @@ function Hardware({ sample, fleet }: { sample?: NodeTelemetry; fleet: boolean }) RAM{' '} {hasMemory ? ( - {SizeFormatter.sizeFormat(used)} / {SizeFormatter.sizeFormat(total)} ·{' '} - {formatPct((100 * used) / total)} + {memorySize(used)} / {memorySize(total)} · {formatPct((100 * used) / total)} ) : ( '—' )}
- {hasMemory && ( - + {system && hasMemory && ( + {sample?.memAvailableBytes != null ? t('pages.nodes.fleet.availableMemory', { size: SizeFormatter.sizeFormat(sample?.memAvailableBytes), @@ -328,14 +358,14 @@ function Connections({ sample, fleet }: { sample?: NodeTelemetry; fleet: boolean const { t, i18n } = useTranslation(); const count = new Intl.NumberFormat(i18n.language); return ( -
+
TCP {sample?.tcpCount == null ? '—' : count.format(sample.tcpCount)} UDP {sample?.udpCount == null ? '—' : count.format(sample.udpCount)} - + {fleet ? t('pages.nodes.fleet.loadSum') : t('pages.nodes.fleet.load')}{' '} {[sample?.load1, sample?.load5, sample?.load15] @@ -363,31 +393,25 @@ function ClientCounts({ const { t } = useTranslation(); return (
- + {counts.clientCount ?? 0} - - - {!!counts.activeCount && ( - - - {counts.activeCount} - - - )} - {!!counts.disabledCount && ( - - {counts.disabledCount} - - )} - {!!counts.depletedCount && ( - - - {counts.depletedCount} - - - )} - - + + {!!counts.activeCount && ( + + {counts.activeCount} + + )} + {!!counts.disabledCount && ( + + {counts.disabledCount} + + )} + {!!counts.depletedCount && ( + + {counts.depletedCount} + + )} +
); } @@ -427,18 +451,46 @@ function sampleVersions( ]; } -function MobileHistory({ node }: { node: NodeRecord }) { - const { t } = useTranslation(); - const [open, setOpen] = useState(false); +const columnWidths = [ + { key: 'actions', px: 148 }, + { key: 'enabled', px: 52 }, + { key: 'node', px: 118 }, + { key: 'address', px: 54 }, + { key: 'status', px: 104 }, + { key: 'hardware', px: 160 }, + { key: 'traffic', px: 120 }, + { key: 'connections', px: 125 }, + { key: 'runtime', px: 145 }, + { key: 'clients', px: 200 }, +]; + +function RowAction({ + label, + icon, + disabled, + danger, + onClick, +}: { + label: string; + icon: ReactNode; + disabled?: boolean; + danger?: boolean; + onClick: () => void; +}) { return ( -
setOpen(event.currentTarget.open)}> - {t('pages.nodes.fleet.history')} - {open && } -
+ ); } -const editable = (row: FleetRow) => row.kind === 'remote' && !row.node.transitive; const canSelect = (row: FleetRow) => row.kind === 'remote' && !row.node.transitive && isUpdateEligible(row.node); @@ -448,7 +500,6 @@ export default function NodeList({ fleet, nodesUpdatedAt, loading = false, - isMobile = false, latestVersion = '', selectedIds, onSelectionChange, @@ -463,11 +514,12 @@ export default function NodeList({ onRestart, restartingIds = noRestarts, }: NodeListProps) { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const { token } = theme.useToken(); const relativeTime = useRelativeTime(); const [search, setSearch] = useState(''); const [filter, setFilter] = useState('all'); + const [opened, setOpened] = useState>(() => new Set()); const [showAddress, setShowAddress] = useState(false); const samples = useMemo( () => [master?.telemetry, ...nodes.map((node) => node.telemetry)], @@ -548,327 +600,403 @@ export default function NodeList({ [nodes], ); - const columns = useMemo[]>( - () => [ - { - title: t('pages.nodes.actions'), - width: '5%', - render: (_, row) => { - if (row.kind !== 'remote') return '—'; - const node = row.node; - if (!editable(row)) - return ( - - - - ); - const items = [ - { - key: 'probe', - label: t('pages.nodes.probe'), - icon: , - onClick: () => onProbe(node), - }, - { - key: 'edit', - label: t('edit'), - icon: , - onClick: () => onEdit(node), - }, - ...(isUpdateEligible(node) - ? [ - { - key: 'update', - label: t('pages.nodes.updatePanel'), - icon: , - onClick: () => onUpdateNode(node), - }, - ] - : []), - ...(['xray', 'panel'] as const).map((target) => ({ - key: 'restart-' + target, - label: - target === 'xray' ? t('pages.nodes.restartXray') : t('pages.nodes.restartPanel'), - icon: , - disabled: !node.enable || restartingIds.has(node.id), - onClick: () => onRestart(node, target), - })), - { - key: 'delete', - label: t('delete'), - danger: true, - icon: , - onClick: () => onDelete(node), - }, - ]; - return ( - -
- } - > - - - ) : ( - { + const nf = new Intl.NumberFormat(i18n.language); + const headers = [ + t('pages.nodes.actions'), + t('pages.nodes.enable'), + t('pages.nodes.fleet.node'), + t('pages.nodes.address'), + t('pages.nodes.status'), + t('pages.nodes.fleet.hardware'), + t('pages.inbounds.traffic'), + t('pages.nodes.fleet.connections'), + t('pages.nodes.fleet.runtime'), + t('clients'), + ]; + const selectableIds = rows + .filter(canSelect) + .map((row) => (row.kind === 'remote' ? row.node.id : 0)); + const allSelected = + selectableIds.length > 0 && selectableIds.every((id) => selectedIds.includes(id)); + const toggleAll = () => { + if (allSelected) onSelectionChange(selectedIds.filter((id) => !selectableIds.includes(id))); + else onSelectionChange([...new Set([...selectedIds, ...selectableIds])]); + }; + return ( +
+
+ + + {columnWidths.map((width) => ( + + ))} + + + + {headers.map((title, index) => ( + + ))} + + + + {rows.map((row) => { + const remote = row.kind === 'remote' ? row.node : undefined; + const managed = remote && !remote.transitive ? remote : undefined; + const isFleet = row.kind === 'fleet'; + const name = isFleet + ? t('pages.nodes.fleet.allNodes') + : row.kind === 'master' + ? t('pages.nodes.fleet.master') + : row.node.name || t('pages.nodes.statusValues.unknown'); + const host = + row.kind === 'remote' ? row.node : row.kind === 'master' ? row.host : undefined; + const url = remote + ? panelUrl(remote) + : row.kind === 'master' + ? withBasePath('/panel/') + : undefined; + const expanded = managed != null && opened.has(managed.id); + return ( + + + + + + + + + + + + + + {expanded && managed && ( + + + + )} + + ); + })} + +
- ), - }, - { - title: t('pages.nodes.fleet.hardware'), - width: '15%', - render: (_, row) => , - }, - { - title: t('pages.nodes.networkSpeed'), - width: '9%', - render: (_, row) => ( - - ), - }, - { - title: t('pages.nodes.fleet.connections'), - width: '10%', - render: (_, row) => , - }, - { - title: t('pages.nodes.fleet.runtime'), - width: '10%', - render: (_, row) => { - if (row.kind === 'fleet') { - const version = (values: string[]) => - values.length > 1 ? t('pages.nodes.fleet.mixed') : values[0] || '—'; - return ( -
- - {t('pages.nodes.xrayVersion')} · {version(row.xrayVersions)} - - - {t('pages.nodes.panelVersion')} · {version(row.panelVersions)} - -
- ); - } - const host = row.kind === 'remote' ? row.node : row.host; - const canUpdate = - row.kind === 'remote' && - !row.node.transitive && - isUpdateEligible(row.node) && - isPanelUpdateAvailable(latestVersion, host.panelVersion || ''); - return ( -
- - {t('pages.nodes.xrayVersion')} · {host.xrayVersion || '—'} - - - {t('pages.nodes.panelVersion')} · {host.panelVersion || '—'} - - - {t('pages.nodes.uptime')} ·{' '} - - {formatUptime(row.telemetry?.uptimeSecs, row.telemetry?.uptimeSecs != null)} - - - {canUpdate && row.kind === 'remote' && ( - - )} -
- ); - }, - }, - { - title: t('clients'), - width: '8%', - render: (_, row) => ( - - ), - }, - ], - [ - t, - nameByGuid, - latestVersion, - onDelete, - onEdit, - onProbe, - onRestart, - onToggleEnable, - onUpdateNode, - relativeTime, - restartingIds, - showAddress, - ], - ); + > + {index === 0 && selectableIds.length > 0 ? ( + + + + ) : ( + title + )} +
+ {managed ? ( +
+ + + onSelectionChange( + event.target.checked + ? [...new Set([...selectedIds, managed.id])] + : selectedIds.filter((id) => id !== managed.id), + ) + } + /> + } + onClick={() => onProbe(managed)} + /> + } + disabled={!isUpdateEligible(managed)} + onClick={() => onUpdateNode(managed)} + /> + } + onClick={() => onEdit(managed)} + /> + ({ + key: target, + label: + target === 'xray' + ? t('pages.nodes.restartXray') + : t('pages.nodes.restartPanel'), + icon: , + disabled: !managed.enable || restartingIds.has(managed.id), + onClick: () => onRestart(managed, target), + })), + }} + > + + + } + danger + onClick={() => onDelete(managed)} + /> +
+ ) : remote ? ( + + + + ) : ( + + {isFleet ? ( + + Σ + + ) : ( + + )} + + {isFleet ? t('all') : t('pages.nodes.fleet.master')} + + + )} +
+ {managed ? ( + onToggleEnable(managed, enable)} + /> + ) : ( + '—' + )} + +
+ {name} + + {isFleet + ? t('pages.nodes.fleet.fleetScope', { remotes: row.registered - 1 }) + : row.kind === 'master' + ? t('pages.nodes.fleet.thisPanel') + : remote?.remark} + +
+
+ {url ? ( + + + {t('pages.nodes.fleet.open')} ↗ + + + ) : ( + '—' + )} + + {isFleet ? ( + +
+ {t('pages.nodes.fleet.reporting', { + live: row.reporting, + total: row.registered, + })} +
+
+ {t('pages.nodes.cpu')} · {row.cpuHosts}/{row.registered} +
+
+ RAM · {row.memoryHosts}/{row.registered} +
+
{t('pages.nodes.fleet.hostMetrics')}
+ + } + > + +
+ ) : ( + + )} +
+ + + + + + + {isFleet ? ( +
+ + {row.panelVersions.length > 1 || row.xrayVersions.length > 1 + ? t('pages.nodes.fleet.mixed') + : [row.xrayVersions[0], row.panelVersions[0]] + .filter(Boolean) + .join(' / ') || '—'} + + {t('pages.nodes.fleet.uptimeVaries')} +
+ ) : ( +
+ + Xray {host?.xrayVersion || '—'} + + + {t('pages.nodes.fleet.panel')} {host?.panelVersion || '—'} + {managed && + isUpdateEligible(managed) && + isPanelUpdateAvailable( + latestVersion, + managed.panelVersion || '', + ) && ( + } + onClick={() => onUpdateNode(managed)} + /> + )} + + + {t('pages.nodes.fleet.uptimeShort')}{' '} + + {formatUptime( + row.telemetry?.uptimeSecs, + row.telemetry?.uptimeSecs != null, + )} + + +
+ )} +
+ {row.kind === 'remote' ? ( + + ) : ( +
+ + {t('pages.nodes.fleet.clientRecords', { + records: nf.format( + isFleet ? row.counts.clientCount : row.host.counts.clientCount, + ), + })} + + + {isFleet + ? t('pages.nodes.fleet.acrossNodes', { total: row.registered }) + : nf.format(row.host.counts.inboundCount) + + ' ' + + t('pages.nodes.inboundTags')} + +
+ )} +
+ +
+
+
+ ); + }, [ + i18n.language, + latestVersion, + loading, + nameByGuid, + onDelete, + onEdit, + onProbe, + onRestart, + onSelectionChange, + onToggleEnable, + onUpdateNode, + opened, + relativeTime, + restartingIds, + rows, + selectedIds, + showAddress, + t, + ]); - const hasSelectable = rows.some(canSelect); - const nodeTable = useMemo( - () => ( - - dataSource={rows} - columns={columns} - tableLayout="fixed" - className="node-fleet-table" - pagination={false} - loading={loading} - size="small" - rowKey="key" - rowClassName={(row) => 'node-row-' + row.kind} - rowSelection={ - hasSelectable - ? { - columnWidth: 32, - selectedRowKeys: selectedIds, - renderCell: (_checked, row, _index, checkbox) => (editable(row) ? checkbox : null), - getCheckboxProps: (row) => ({ disabled: !canSelect(row) }), - onChange: (keys) => - onSelectionChange( - keys.filter( - (key): key is number => - typeof key === 'number' && - rows.some((row) => row.key === key && canSelect(row)), - ), - ), - } - : undefined - } - expandable={ - rows.some(editable) - ? { - columnWidth: 30, - columnTitle: ( - {t('pages.nodes.fleet.history')} - ), - expandedRowRender: (row) => - row.kind === 'remote' && , - rowExpandable: editable, - } - : undefined - } - /> - ), - [columns, hasSelectable, loading, onSelectionChange, rows, selectedIds, t], - ); - - const addressLabel = t('pages.index.toggleIpVisibility'); const filterOptions = [ { value: 'all', label: t('pages.nodes.fleet.allStatuses') }, { value: 'online', label: t('pages.nodes.statusValues.online') }, @@ -876,6 +1004,7 @@ export default function NodeList({ { value: 'disabled', label: t('disabled') }, { value: 'unknown', label: t('pages.nodes.statusValues.unknown') }, ]; + const summary = rows.find((row) => row.kind === 'fleet'); return (
- {t('menu.nodes')} - {t('pages.nodes.fleet.subtitle')} +

{t('menu.nodes')}

+

{t('pages.nodes.fleet.subtitle')}

- - - - +
} aria-label={t('search')} - placeholder={t('search')} + placeholder={t('pages.nodes.fleet.searchNodes')} allowClear value={search} onChange={(event) => setSearch(event.target.value)} @@ -927,54 +1061,37 @@ export default function NodeList({ value={filter} onChange={setFilter} /> - - {t('pages.nodes.fleet.registered', { - shown: rows.filter((row) => row.kind === 'remote').length, - total: nodes.length, - })} - - )} + + {t('pages.nodes.fleet.registered', { remotes: nodes.length, total: nodes.length + 1 })} + +
+ {table} +
+ + {t('pages.nodes.fleet.footnote', { + coverage: summary + ? summary.reporting + '/' + summary.registered + : rows.some((row) => row.kind === 'master' && reportingSample(row.telemetry)) + ? '1/1' + : '0/1', + })} + +
- {isMobile ? ( -
- {rows.map((row) => ( -
-
- {columns.slice(2, 5).map((column, index) => ( -
{column.render?.(null, row, index) as ReactNode}
- ))} - {editable(row) && ( - - {columns.slice(0, 2).map((column, index) => ( - {column.render?.(null, row, index) as ReactNode} - ))} - - )} -
-
- {columns.slice(5).map((column, index) => ( -
{column.render?.(null, row, index) as ReactNode}
- ))} -
- {row.kind === 'remote' && editable(row) && } -
- ))} -
- ) : ( - nodeTable - )} ); } diff --git a/frontend/src/pages/nodes/NodeNetworkSpeed.tsx b/frontend/src/pages/nodes/NodeNetworkSpeed.tsx index 2a43b6d34..baae090c9 100644 --- a/frontend/src/pages/nodes/NodeNetworkSpeed.tsx +++ b/frontend/src/pages/nodes/NodeNetworkSpeed.tsx @@ -46,18 +46,28 @@ export default function NodeNetworkSpeed({ ); } -export function NetworkSpeedValues({ up, down }: { up?: number | null; down?: number | null }) { +export function NetworkSpeedValues({ + up, + down, + uploadFirst, +}: { + up?: number | null; + down?: number | null; + uploadFirst?: boolean; +}) { const { t } = useTranslation(); const { token } = theme.useToken(); const directions = [ { rate: down, + isUpload: false, label: t('pages.index.download'), Icon: ArrowDownOutlined, color: token.colorTextTertiary, }, { rate: up, + isUpload: true, label: t('pages.index.upload'), Icon: ArrowUpOutlined, color: token.colorPrimary, @@ -65,25 +75,27 @@ export function NetworkSpeedValues({ up, down }: { up?: number | null; down?: nu ]; return ( - {directions.map(({ rate, label, Icon, color }) => { - const value = - typeof rate === 'number' && Number.isFinite(rate) && rate >= 0 - ? SizeFormatter.speedFormat(rate) - : '—'; - return ( - - - - {value} - - - ); - })} + {(uploadFirst ? directions.reverse() : directions).map( + ({ rate, label, Icon, color, isUpload }) => { + const value = + typeof rate === 'number' && Number.isFinite(rate) && rate >= 0 + ? SizeFormatter.speedFormat(rate) + : '—'; + return ( + + + + {value} + + + ); + }, + )} ); } diff --git a/frontend/src/pages/nodes/NodesPage.tsx b/frontend/src/pages/nodes/NodesPage.tsx index 3c7501270..2a7f512c5 100644 --- a/frontend/src/pages/nodes/NodesPage.tsx +++ b/frontend/src/pages/nodes/NodesPage.tsx @@ -15,7 +15,6 @@ import { message, } from 'antd'; import { useTheme } from '@/hooks/useTheme'; -import { useMediaQuery } from '@/hooks/useMediaQuery'; import { useNodeOverviewQuery } from '@/api/queries/useNodesQuery'; import type { NodeRecord } from '@/api/queries/useNodesQuery'; import { useNodeMutations } from '@/api/queries/useNodeMutations'; @@ -59,7 +58,6 @@ function UpdateChannelChoice({ onChange }: { onChange: (dev: boolean) => void }) export default function NodesPage() { const { t } = useTranslation(); const { isDark, isUltra, antdThemeConfig } = useTheme(); - const { isMobile } = useMediaQuery(1080); const [modal, modalContextHolder] = Modal.useModal(); const [messageApi, messageContextHolder] = message.useMessage(); useEffect(() => { @@ -356,7 +354,6 @@ export default function NodesPage() { fleet={fleet} nodesUpdatedAt={nodesUpdatedAt} loading={loading} - isMobile={isMobile} latestVersion={latestVersion} selectedIds={selectedIds} onSelectionChange={setSelectedIds} diff --git a/frontend/src/pages/nodes/fonts/SourceSansPro-Bold.woff2 b/frontend/src/pages/nodes/fonts/SourceSansPro-Bold.woff2 new file mode 100644 index 000000000..30e01df9c Binary files /dev/null and b/frontend/src/pages/nodes/fonts/SourceSansPro-Bold.woff2 differ diff --git a/frontend/src/pages/nodes/fonts/SourceSansPro-Semibold.woff2 b/frontend/src/pages/nodes/fonts/SourceSansPro-Semibold.woff2 new file mode 100644 index 000000000..0fc83eda4 Binary files /dev/null and b/frontend/src/pages/nodes/fonts/SourceSansPro-Semibold.woff2 differ diff --git a/frontend/src/test/node-fleet-monitoring.test.tsx b/frontend/src/test/node-fleet-monitoring.test.tsx index d2b678aaf..7b2955301 100644 --- a/frontend/src/test/node-fleet-monitoring.test.tsx +++ b/frontend/src/test/node-fleet-monitoring.test.tsx @@ -40,7 +40,7 @@ it('keeps the master visible on an empty install and adds the summary for a disa } const view = renderWithProviders(list([])); expect(screen.queryByText('All nodes')).toBeNull(); - expect(screen.getByRole('row', { name: /This panel/ })).toBeTruthy(); + expect(screen.getByRole('rowheader', { name: 'Master' })).toBeTruthy(); expect(screen.queryByRole('switch')).toBeNull(); view.rerender(list([{ id: 1, name: 'disabled edge', enable: false, status: 'online' }])); const rows = screen.getAllByRole('row'); @@ -98,7 +98,7 @@ it('expires only the stale host and keeps weighted RAM and live byte rates separ />, ); const fleet = () => within(screen.getByRole('row', { name: /All nodes/ })); - expect(fleet().getByText(/10.00 GB \/ 24.00 GB · 41.7%/)).toBeTruthy(); + expect(fleet().getByText(/10 GB \/ 24 GB · 41.7%/)).toBeTruthy(); expect(fleet().getByText('30.0%')).toBeTruthy(); expect(fleet().getByLabelText(/download 3.00 KB\/s/i)).toBeTruthy(); act(() => vi.advanceTimersByTime(501)); diff --git a/frontend/src/test/node-list-a11y.test.tsx b/frontend/src/test/node-list-a11y.test.tsx index 8d86fa442..532d6d649 100644 --- a/frontend/src/test/node-list-a11y.test.tsx +++ b/frontend/src/test/node-list-a11y.test.tsx @@ -18,11 +18,10 @@ const failing: NodeRecord = { lastError: 'dial tcp 10.0.0.2:2053: i/o timeout', }; -function renderList(isMobile: boolean) { +function renderList() { renderWithProviders( { it('announces the node error from the status column', () => { - renderList(false); + renderList(); expect(screen.getByRole('img', { name: failing.lastError }).tagName).toBe('SPAN'); }); - it.each([false, true])('names the enable switch (mobile=%s)', (isMobile) => { - renderList(isMobile); + it('names the enable switch', () => { + renderList(); expect(screen.getByRole('switch', { name: 'Enabled' }).getAttribute('aria-checked')).toBe( 'true', diff --git a/frontend/src/test/node-list-online-total.test.tsx b/frontend/src/test/node-list-online-total.test.tsx index 4f153a402..fe5ce9431 100644 --- a/frontend/src/test/node-list-online-total.test.tsx +++ b/frontend/src/test/node-list-online-total.test.tsx @@ -9,10 +9,7 @@ import { renderWithProviders } from './test-utils'; const noop = () => {}; -function renderNode( - counts: Pick, - isMobile = false, -) { +function renderNode(counts: Pick) { const node: NodeRecord = { id: 1, name: 'edge', @@ -25,7 +22,6 @@ function renderNode( renderWithProviders( { renderNode(counts); expect(screen.getByText('7')).toBeTruthy(); - expect(screen.queryByText(/\d \/ \d/)).toBeNull(); - }); - - it('shows synced / total directly on the mobile row', () => { - renderNode({ onlineCount: 3, onlineTotalCount: 12 }, true); - - expect(screen.getByText('3 / 12')).toBeTruthy(); + expect(screen.queryByText(/^\d+ \/ \d+$/)).toBeNull(); }); }); diff --git a/frontend/src/test/node-list-rerender.test.tsx b/frontend/src/test/node-list-rerender.test.tsx index 486ffc94a..8e232dd32 100644 --- a/frontend/src/test/node-list-rerender.test.tsx +++ b/frontend/src/test/node-list-rerender.test.tsx @@ -44,7 +44,6 @@ describe('NodeList re-render', () => { const noop = () => {}; const props = { nodes, - isMobile: false, latestVersion: '3.0.1', selectedIds: [] as number[], onSelectionChange: noop, diff --git a/frontend/src/test/node-list-rowkey.test.tsx b/frontend/src/test/node-list-rowkey.test.tsx index 7b1dcc216..1e303bae6 100644 --- a/frontend/src/test/node-list-rowkey.test.tsx +++ b/frontend/src/test/node-list-rowkey.test.tsx @@ -24,7 +24,6 @@ describe('NodeList desktop table row keys', () => { renderWithProviders( ) { renderWithProviders( {}; describe('node metric availability', () => { - it.each([false, true])( - 'does not present unavailable CPU as measured zero (mobile=%s)', - (isMobile) => { - const node = NodeRecordSchema.parse({ - id: 1, - name: 'edge', - status: 'online', - enable: true, - cpuPct: 0, - memPct: 44.4, - uptimeSecs: 0, - unavailableMetrics: ['cpu', 'uptime'], - }); - renderWithProviders( - , - ); - expect(screen.queryByText('0.0%')).toBeNull(); - expect(screen.getAllByText('—').length).toBeGreaterThanOrEqual(2); - }, - ); + it('does not present unavailable CPU as measured zero', () => { + const node = NodeRecordSchema.parse({ + id: 1, + name: 'edge', + status: 'online', + enable: true, + cpuPct: 0, + memPct: 44.4, + uptimeSecs: 0, + unavailableMetrics: ['cpu', 'uptime'], + }); + renderWithProviders( + , + ); + expect(screen.queryByText('0.0%')).toBeNull(); + expect(screen.getAllByText('—').length).toBeGreaterThanOrEqual(2); + }); it('keeps a measured zero CPU and an unprobed uptime apart', () => { const node = NodeRecordSchema.parse({ id: 1, @@ -67,8 +63,8 @@ describe('node metric availability', () => { />, ); expect(screen.getByText('0.0%')).not.toBeNull(); - const cell = within(screen.getAllByRole('row')[1]).getByText(/Uptime/); - expect(cell.textContent).toBe('Uptime · —'); + const cell = within(screen.getAllByRole('row')[1]).getByTitle('Uptime'); + expect(cell.textContent).toBe('Up —'); }); }); @@ -86,43 +82,40 @@ describe('node network speed', () => { onUpdateSelected: noop, onRestart: noop, }; - it.each([false, true])( - 'renders current directions and preserves measured zero (mobile=%s)', - (isMobile) => { - const node = NodeRecordSchema.parse({ - id: 1, - name: 'edge', - enable: true, - status: 'online', - lastHeartbeat: Math.floor(Date.now() / 1000), - telemetry: { sampledAt: Date.now(), netDown: 2048, netUp: 0 }, - }); - function Fixture() { - const [record, setRecord] = useState(node); - return ( - <> - - - - ); - } - renderWithProviders(); - expect(screen.getByLabelText(/^download .*2\.00 KB\/s$/i).textContent).toContain('2.00 KB/s'); - expect(screen.getByLabelText(/^upload .*0 B\/s$/i).textContent).toContain('0 B/s'); - fireEvent.click(screen.getByText('Age sample')); - expect(screen.getByLabelText(/^download .*—$/i).textContent).toContain('—'); - }, - ); + it('renders current directions and preserves measured zero', () => { + const node = NodeRecordSchema.parse({ + id: 1, + name: 'edge', + enable: true, + status: 'online', + lastHeartbeat: Math.floor(Date.now() / 1000), + telemetry: { sampledAt: Date.now(), netDown: 2048, netUp: 0 }, + }); + function Fixture() { + const [record, setRecord] = useState(node); + return ( + <> + + + + ); + } + renderWithProviders(); + expect(screen.getByLabelText(/^download .*2\.00 KB\/s$/i).textContent).toContain('2.00 KB/s'); + expect(screen.getByLabelText(/^upload .*0 B\/s$/i).textContent).toContain('0 B/s'); + fireEvent.click(screen.getByText('Age sample')); + expect(screen.getByLabelText(/^download .*—$/i).textContent).toContain('—'); + }); it.each([-120, 120])('expires throughput with %s seconds of clock skew', (skew) => { vi.useFakeTimers(); diff --git a/frontend/src/test/node-restart.test.tsx b/frontend/src/test/node-restart.test.tsx index 488482ed9..172f48eb3 100644 --- a/frontend/src/test/node-restart.test.tsx +++ b/frontend/src/test/node-restart.test.tsx @@ -8,12 +8,10 @@ import type { NodeRecord } from '@/schemas/node'; import { renderWithProviders } from './test-utils'; const state = vi.hoisted(() => ({ - isMobile: false, nodes: [] as NodeRecord[], refetch: vi.fn(), })); -vi.mock('@/hooks/useMediaQuery', () => ({ useMediaQuery: () => ({ isMobile: state.isMobile }) })); vi.mock('@/api/queries/useNodesQuery', () => ({ useNodeOverviewQuery: () => ({ nodes: state.nodes, @@ -28,7 +26,6 @@ vi.mock('@/pages/nodes/NodeHistoryPanel', () => ({ default: () => null })); vi.mock('@/layouts/AppSidebar', () => ({ default: () => null })); beforeEach(() => { - state.isMobile = false; state.nodes = [{ id: 7, name: 'edge-seven', guid: 'seven', enable: true, status: 'offline' }]; vi.spyOn(HttpUtil, 'get').mockResolvedValue(new Msg(true, '', {})); }); @@ -41,43 +38,39 @@ async function openRestart(label: string) { } describe('remote node restart', () => { - it.each([false, true])( - 'confirms each action and sends only the selected request (mobile=%s)', - async (mobile) => { - state.isMobile = mobile; - const post = vi - .spyOn(HttpUtil, 'post') - .mockResolvedValue({ success: true, msg: '', obj: null }); - renderWithProviders( - - - , - ); - let dialog = await openRestart('Restart Xray'); - expect(dialog.textContent).toContain('edge-seven'); - expect(post).not.toHaveBeenCalled(); - fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' })); + it('confirms each action and sends only the selected request', async () => { + const post = vi + .spyOn(HttpUtil, 'post') + .mockResolvedValue({ success: true, msg: '', obj: null }); + renderWithProviders( + + + , + ); + let dialog = await openRestart('Restart Xray'); + expect(dialog.textContent).toContain('edge-seven'); + expect(post).not.toHaveBeenCalled(); + fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' })); + + await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull()); + expect(post).not.toHaveBeenCalled(); + for (const [label, action, success] of [ + ['Restart Xray', 'restartXray', 'Xray restarted on the node.'], + [ + 'Restart Panel', + 'restartPanel', + 'Panel restart request accepted. The node may be temporarily unavailable.', + ], + ]) { + dialog = await openRestart(label); + fireEvent.click(within(dialog).getByRole('button', { name: label })); + await screen.findByText(success); + expect(post.mock.calls.at(-1)?.[0]).toBe(`/panel/api/nodes/${action}/7`); await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull()); - expect(post).not.toHaveBeenCalled(); - for (const [label, action, success] of [ - ['Restart Xray', 'restartXray', 'Xray restarted on the node.'], - [ - 'Restart Panel', - 'restartPanel', - 'Panel restart request accepted. The node may be temporarily unavailable.', - ], - ]) { - dialog = await openRestart(label); - fireEvent.click(within(dialog).getByRole('button', { name: label })); - await screen.findByText(success); - expect(post.mock.calls.at(-1)?.[0]).toBe(`/panel/api/nodes/${action}/7`); - - await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull()); - } - expect(post).toHaveBeenCalledTimes(2); - }, - ); + } + expect(post).toHaveBeenCalledTimes(2); + }); it('keeps both actions disabled while the request is pending and reports a node rejection without retrying', async () => { let finish!: (msg: Msg) => void; @@ -106,32 +99,28 @@ describe('remote node restart', () => { expect(post).toHaveBeenCalledTimes(1); }); - it.each([false, true])( - 'does not offer restart for transitive nodes and disables it for disabled nodes (mobile=%s)', - async (mobile) => { - state.isMobile = mobile; - state.nodes = [ - { id: 0, name: 'child', guid: 'child', transitive: true, enable: true, status: 'online' }, - ]; - const view = renderWithProviders( - - - , + it('does not offer restart for transitive nodes and disables it for disabled nodes', async () => { + state.nodes = [ + { id: 0, name: 'child', guid: 'child', transitive: true, enable: true, status: 'online' }, + ]; + const view = renderWithProviders( + + + , + ); + expect(screen.queryByRole('button', { name: /^more$/i })).toBeNull(); + view.unmount(); + state.nodes = [{ id: 7, name: 'disabled', enable: false }]; + renderWithProviders( + + + , + ); + fireEvent.click(screen.getByRole('button', { name: /^more$/i })); + for (const name of ['Restart Xray', 'Restart Panel']) { + expect((await screen.findByRole('menuitem', { name })).getAttribute('aria-disabled')).toBe( + 'true', ); - expect(screen.queryByRole('button', { name: /^more$/i })).toBeNull(); - view.unmount(); - state.nodes = [{ id: 7, name: 'disabled', enable: false }]; - renderWithProviders( - - - , - ); - fireEvent.click(screen.getByRole('button', { name: /^more$/i })); - for (const name of ['Restart Xray', 'Restart Panel']) { - expect((await screen.findByRole('menuitem', { name })).getAttribute('aria-disabled')).toBe( - 'true', - ); - } - }, - ); + } + }); }); diff --git a/internal/web/translation/ar-EG.json b/internal/web/translation/ar-EG.json index 7586ef83e..126296240 100644 --- a/internal/web/translation/ar-EG.json +++ b/internal/web/translation/ar-EG.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "تحذف النود \"{name}\"؟", "deleteConfirmContent": "ده هيوقّف مراقبة النود. البانل البعيد نفسه مش هيتأثر.", "fleet": { - "subtitle": "راقب هذه اللوحة والعُقد البعيدة.", + "subtitle": "راقب العقدة الرئيسية وسائر العقد المتصلة في عرض واحد.", "allNodes": "جميع العُقد", "master": "الرئيسية", "thisPanel": "هذه اللوحة", "fleetScope": "الرئيسية + {remotes} عُقد بعيدة", "reporting": "{live} من {total} ترسل بيانات", - "registered": "{shown} من {total} عُقد مسجلة", + "registered": "{remotes} عقدة بعيدة · {total} إجمالاً", "allStatuses": "جميع الحالات", "open": "فتح", "hardware": "المعالج / الذاكرة", @@ -1297,7 +1297,16 @@ "hostMetrics": "تُجمع السرعات والاتصالات لكل مضيف.", "runtime": "وقت التشغيل", "mixed": "إصدارات متعددة", - "history": "السجل" + "history": "السجل", + "node": "العقدة", + "searchNodes": "البحث عن العقد…", + "panel": "اللوحة", + "uptimeShort": "مدة العمل", + "uptimeVaries": "تختلف مدة العمل حسب العقدة", + "clientRecords": "{records} سجل عميل", + "acrossNodes": "عبر {total} عقدة", + "connectionDetails": "تفاصيل الاتصال", + "footnote": "تُجمع القيم من العقد التي ترسل بيانات ({coverage}). الحمل في ١ و٥ و١٥ دقيقة، ويُجمع عبر العقد المبلِّغة. مرّر المؤشر فوق الحالة لعرض آخر اتصال وزمن الاستجابة." }, "statusValues": { "online": "متصل", diff --git a/internal/web/translation/en-US.json b/internal/web/translation/en-US.json index d3071ab58..8181134c9 100644 --- a/internal/web/translation/en-US.json +++ b/internal/web/translation/en-US.json @@ -1397,13 +1397,13 @@ "deleteConfirmTitle": "Delete node \"{name}\"?", "deleteConfirmContent": "This stops monitoring the node. The remote panel itself is unaffected.", "fleet": { - "subtitle": "Monitor this panel and its remote nodes.", + "subtitle": "Monitor the master and every connected node in one view.", "allNodes": "All nodes", "master": "Master", "thisPanel": "This panel", "fleetScope": "Master + {remotes} remote nodes", "reporting": "{live}/{total} reporting", - "registered": "{shown}/{total} registered nodes", + "registered": "{remotes} remote nodes · {total} total", "allStatuses": "All statuses", "open": "Open", "hardware": "CPU / RAM", @@ -1417,8 +1417,17 @@ "loadWindow": "System load over 1, 5 and 15 minutes", "hostMetrics": "Rates and connections are summed per host.", "runtime": "Runtime", - "mixed": "Mixed", - "history": "History" + "mixed": "Versions vary", + "history": "History", + "node": "Node", + "searchNodes": "Search nodes…", + "panel": "Panel", + "uptimeShort": "Up", + "uptimeVaries": "Uptime varies by node", + "clientRecords": "{records} client records", + "acrossNodes": "Across {total} nodes", + "connectionDetails": "Connection details", + "footnote": "Fleet totals use reporting nodes only ({coverage}). Load values are 1 / 5 / 15 min; fleet values sum the reporting nodes. Hover status for heartbeat and latency." }, "statusValues": { "online": "Online", diff --git a/internal/web/translation/es-ES.json b/internal/web/translation/es-ES.json index aa93c6732..691569098 100644 --- a/internal/web/translation/es-ES.json +++ b/internal/web/translation/es-ES.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "¿Eliminar el nodo \"{name}\"?", "deleteConfirmContent": "Esto detiene la monitorización del nodo. El panel remoto en sí no se ve afectado.", "fleet": { - "subtitle": "Supervisa este panel y sus nodos remotos.", + "subtitle": "Supervisa el nodo principal y todos los nodos conectados en una vista.", "allNodes": "Todos los nodos", "master": "Principal", "thisPanel": "Este panel", "fleetScope": "Principal + {remotes} nodos remotos", "reporting": "{live}/{total} con datos", - "registered": "{shown}/{total} nodos registrados", + "registered": "{remotes} remotos · {total} en total", "allStatuses": "Todos los estados", "open": "Abrir", "hardware": "CPU / RAM", @@ -1297,7 +1297,16 @@ "hostMetrics": "Las tasas y conexiones se suman por servidor.", "runtime": "Ejecución", "mixed": "Mixto", - "history": "Historial" + "history": "Historial", + "node": "Nodo", + "searchNodes": "Buscar nodos…", + "panel": "Panel", + "uptimeShort": "Activo", + "uptimeVaries": "El tiempo activo varía por nodo", + "clientRecords": "{records} clientes registrados", + "acrossNodes": "En {total} nodos", + "connectionDetails": "Detalles de conexión", + "footnote": "Los totales usan los nodos que informan ({coverage}). Las cargas son de 1, 5 y 15 min y se suman entre nodos. Pasa el cursor por el estado para ver latencia y último contacto." }, "statusValues": { "online": "En línea", diff --git a/internal/web/translation/fa-IR.json b/internal/web/translation/fa-IR.json index 334ce67ee..00a214bb8 100644 --- a/internal/web/translation/fa-IR.json +++ b/internal/web/translation/fa-IR.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "نود «{name}» حذف شود؟", "deleteConfirmContent": "نظارت روی این نود متوقف می‌شود. خود پنل ریموت تغییری نمی‌کند.", "fleet": { - "subtitle": "وضعیت این پنل و نودهای راه دور را پایش کنید.", + "subtitle": "مستر و همهٔ نودهای متصل را در یک نما پایش کنید.", "allNodes": "همهٔ نودها", "master": "مستر", "thisPanel": "این پنل", "fleetScope": "مستر + {remotes} نود راه دور", "reporting": "{live} از {total} در حال گزارش", - "registered": "{shown} از {total} نود ثبت‌شده", + "registered": "{remotes} نود راه دور · {total} در مجموع", "allStatuses": "همهٔ وضعیت‌ها", "open": "باز کردن", "hardware": "پردازنده / حافظه", @@ -1297,7 +1297,16 @@ "hostMetrics": "نرخ‌ها و اتصال‌ها به تفکیک میزبان جمع می‌شوند.", "runtime": "زمان اجرا", "mixed": "چند نسخه", - "history": "تاریخچه" + "history": "تاریخچه", + "node": "نود", + "searchNodes": "جست‌وجوی نودها…", + "panel": "پنل", + "uptimeShort": "زمان کار", + "uptimeVaries": "زمان کار به نود بستگی دارد", + "clientRecords": "{records} کلاینت ثبت‌شده", + "acrossNodes": "در {total} نود", + "connectionDetails": "جزئیات اتصال", + "footnote": "جمع کل از نودهای در حال گزارش محاسبه می‌شود ({coverage}). بار در بازه‌های ۱، ۵ و ۱۵ دقیقه نمایش داده می‌شود و در نمای کل، مجموع نودهای گزارش‌دهنده است. برای دیدن ضربان و تأخیر روی وضعیت مکث کنید." }, "statusValues": { "online": "آنلاین", diff --git a/internal/web/translation/id-ID.json b/internal/web/translation/id-ID.json index 279bb2bae..34f81ba1b 100644 --- a/internal/web/translation/id-ID.json +++ b/internal/web/translation/id-ID.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "Hapus node \"{name}\"?", "deleteConfirmContent": "Ini menghentikan pemantauan node. Panel jarak jauh itu sendiri tidak terpengaruh.", "fleet": { - "subtitle": "Pantau panel ini dan node jarak jauhnya.", + "subtitle": "Pantau node utama dan semua node terhubung dalam satu tampilan.", "allNodes": "Semua node", "master": "Utama", "thisPanel": "Panel ini", "fleetScope": "Utama + {remotes} node jarak jauh", "reporting": "{live}/{total} melapor", - "registered": "{shown}/{total} node terdaftar", + "registered": "{remotes} node jarak jauh · {total} total", "allStatuses": "Semua status", "open": "Buka", "hardware": "CPU / RAM", @@ -1297,7 +1297,16 @@ "hostMetrics": "Laju dan koneksi dijumlahkan per host.", "runtime": "Runtime", "mixed": "Campuran", - "history": "Riwayat" + "history": "Riwayat", + "node": "Node", + "searchNodes": "Cari node…", + "panel": "Panel", + "uptimeShort": "Aktif", + "uptimeVaries": "Waktu aktif berbeda menurut node", + "clientRecords": "{records} catatan klien", + "acrossNodes": "Di {total} node", + "connectionDetails": "Detail koneksi", + "footnote": "Total berasal dari node yang melapor ({coverage}). Beban 1, 5, dan 15 menit dijumlahkan antar node. Arahkan ke status untuk melihat heartbeat dan latensi." }, "statusValues": { "online": "Online", diff --git a/internal/web/translation/ja-JP.json b/internal/web/translation/ja-JP.json index e3bd1454d..f1ed3655d 100644 --- a/internal/web/translation/ja-JP.json +++ b/internal/web/translation/ja-JP.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "ノード「{name}」を削除しますか?", "deleteConfirmContent": "ノードの監視を停止します。リモートパネル自体には影響しません。", "fleet": { - "subtitle": "このパネルとリモートノードを監視します。", + "subtitle": "マスターと接続中の全ノードをまとめて監視します。", "allNodes": "全ノード", "master": "マスター", "thisPanel": "このパネル", "fleetScope": "マスターとリモート {remotes} 台", "reporting": "{live}/{total} 台が報告中", - "registered": "登録済み {shown}/{total} 台", + "registered": "リモート {remotes} 台 · 合計 {total} 台", "allStatuses": "すべての状態", "open": "開く", "hardware": "CPU / RAM", @@ -1297,7 +1297,16 @@ "hostMetrics": "転送速度と接続数はホストごとの値を合計しています。", "runtime": "実行環境", "mixed": "混在", - "history": "履歴" + "history": "履歴", + "node": "ノード", + "searchNodes": "ノードを検索…", + "panel": "パネル", + "uptimeShort": "稼働", + "uptimeVaries": "稼働時間はノードによって異なります", + "clientRecords": "クライアント登録数 {records}", + "acrossNodes": "{total} 台のノード", + "connectionDetails": "接続の詳細", + "footnote": "集計対象は報告中のノードです ({coverage})。1、5、15 分の負荷は報告中のノードの合計です。状態にカーソルを合わせると最終応答と遅延を確認できます。" }, "statusValues": { "online": "オンライン", diff --git a/internal/web/translation/pt-BR.json b/internal/web/translation/pt-BR.json index 21897fa56..449b324cf 100644 --- a/internal/web/translation/pt-BR.json +++ b/internal/web/translation/pt-BR.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "Excluir o nó \"{name}\"?", "deleteConfirmContent": "Isso interrompe o monitoramento do nó. O painel remoto em si não é afetado.", "fleet": { - "subtitle": "Monitore este painel e seus nós remotos.", + "subtitle": "Monitore o nó principal e todos os nós conectados em uma única tela.", "allNodes": "Todos os nós", "master": "Principal", "thisPanel": "Este painel", "fleetScope": "Principal + {remotes} nós remotos", "reporting": "{live}/{total} enviando dados", - "registered": "{shown}/{total} nós registrados", + "registered": "{remotes} remotos · {total} no total", "allStatuses": "Todos os estados", "open": "Abrir", "hardware": "CPU / RAM", @@ -1297,7 +1297,16 @@ "hostMetrics": "As taxas e conexões são somadas por host.", "runtime": "Execução", "mixed": "Misto", - "history": "Histórico" + "history": "Histórico", + "node": "Nó", + "searchNodes": "Pesquisar nós…", + "panel": "Painel", + "uptimeShort": "Ativo", + "uptimeVaries": "O tempo ativo varia por nó", + "clientRecords": "{records} clientes registrados", + "acrossNodes": "Em {total} nós", + "connectionDetails": "Detalhes da conexão", + "footnote": "Os totais usam os nós que enviam dados ({coverage}). As cargas de 1, 5 e 15 min são somadas. Passe o cursor pelo status para ver latência e último contato." }, "statusValues": { "online": "Online", diff --git a/internal/web/translation/ru-RU.json b/internal/web/translation/ru-RU.json index a5a60c442..71e14ffa3 100644 --- a/internal/web/translation/ru-RU.json +++ b/internal/web/translation/ru-RU.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "Удалить узел \"{name}\"?", "deleteConfirmContent": "Это остановит мониторинг узла. Сама удалённая панель не будет затронута.", "fleet": { - "subtitle": "Мониторинг этой панели и её удалённых узлов.", + "subtitle": "Следите за главным и всеми подключёнными узлами на одной странице.", "allNodes": "Все узлы", "master": "Главный", "thisPanel": "Эта панель", "fleetScope": "Главный + удалённых узлов: {remotes}", "reporting": "Передают данные: {live}/{total}", - "registered": "Зарегистрированные узлы: {shown}/{total}", + "registered": "Удалённых: {remotes} · Всего: {total}", "allStatuses": "Все статусы", "open": "Открыть", "hardware": "ЦП / ОЗУ", @@ -1297,7 +1297,16 @@ "hostMetrics": "Скорости и соединения суммируются по хостам.", "runtime": "Среда выполнения", "mixed": "Разные версии", - "history": "История" + "history": "История", + "node": "Узел", + "searchNodes": "Поиск узлов…", + "panel": "Панель", + "uptimeShort": "Работа", + "uptimeVaries": "Время работы различается по узлам", + "clientRecords": "Клиентских записей: {records}", + "acrossNodes": "На {total} узлах", + "connectionDetails": "Сведения о подключении", + "footnote": "Итоги учитывают узлы, передающие данные ({coverage}). Нагрузка за 1, 5 и 15 минут суммируется. Наведите курсор на статус, чтобы увидеть задержку и последнюю проверку." }, "statusValues": { "online": "В сети", diff --git a/internal/web/translation/sk-SK.json b/internal/web/translation/sk-SK.json index 303883f5d..800971a72 100644 --- a/internal/web/translation/sk-SK.json +++ b/internal/web/translation/sk-SK.json @@ -1397,13 +1397,13 @@ "deleteConfirmTitle": "Odstrániť server „{name}“?", "deleteConfirmContent": "Prestane sa sledovať tento server. Samotný vzdialený panel sa nezmení.", "fleet": { - "subtitle": "Monitorujte tento panel a jeho vzdialené uzly.", + "subtitle": "Monitorujte hlavný uzol a všetky pripojené uzly v jednom zobrazení.", "allNodes": "Všetky uzly", "master": "Hlavný uzol", "thisPanel": "Tento panel", "fleetScope": "Hlavný uzol + {remotes} vzdialených uzlov", "reporting": "{live}/{total} hlási údaje", - "registered": "{shown}/{total} registrovaných uzlov", + "registered": "{remotes} vzdialených · {total} spolu", "allStatuses": "Všetky stavy", "open": "Otvoriť", "hardware": "CPU / RAM", @@ -1418,7 +1418,16 @@ "hostMetrics": "Rýchlosti a spojenia sa sčítavajú za jednotlivé hostitele.", "runtime": "Beh", "mixed": "Rôzne verzie", - "history": "História" + "history": "História", + "node": "Uzol", + "searchNodes": "Vyhľadať uzly…", + "panel": "Panel", + "uptimeShort": "Beh", + "uptimeVaries": "Čas prevádzky sa líši podľa uzla", + "clientRecords": "{records} záznamov klientov", + "acrossNodes": "Na {total} uzloch", + "connectionDetails": "Podrobnosti pripojenia", + "footnote": "Súčty zahŕňajú uzly, ktoré hlásia údaje ({coverage}). Záťaž za 1, 5 a 15 minút sa sčítava. Pre posledný kontakt a odozvu ukážte na stav." }, "statusValues": { "online": "Online", diff --git a/internal/web/translation/tr-TR.json b/internal/web/translation/tr-TR.json index 7168a47e6..b5929d33c 100644 --- a/internal/web/translation/tr-TR.json +++ b/internal/web/translation/tr-TR.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "\"{name}\" düğümü silinsin mi?", "deleteConfirmContent": "Bu işlem düğüm izlemeyi durdurur. Uzak panelin kendisi etkilenmez.", "fleet": { - "subtitle": "Bu paneli ve uzak düğümlerini izleyin.", + "subtitle": "Ana düğümü ve bağlı tüm düğümleri tek bir görünümde izleyin.", "allNodes": "Tüm düğümler", "master": "Ana düğüm", "thisPanel": "Bu panel", "fleetScope": "Ana düğüm + {remotes} uzak düğüm", "reporting": "{live}/{total} veri gönderiyor", - "registered": "{shown}/{total} kayıtlı düğüm", + "registered": "{remotes} uzak düğüm · {total} toplam", "allStatuses": "Tüm durumlar", "open": "Aç", "hardware": "CPU / RAM", @@ -1297,7 +1297,16 @@ "hostMetrics": "Hızlar ve bağlantılar ana makine bazında toplanır.", "runtime": "Çalışma zamanı", "mixed": "Karma", - "history": "Geçmiş" + "history": "Geçmiş", + "node": "Düğüm", + "searchNodes": "Düğüm ara…", + "panel": "Panel", + "uptimeShort": "Çalışma", + "uptimeVaries": "Çalışma süresi düğüme göre değişir", + "clientRecords": "{records} istemci kaydı", + "acrossNodes": "{total} düğümde", + "connectionDetails": "Bağlantı ayrıntıları", + "footnote": "Toplamlara veri gönderen düğümler dahildir ({coverage}). 1, 5 ve 15 dakikalık yükler toplanır. Son sinyali ve gecikmeyi görmek için durumun üzerine gelin." }, "statusValues": { "online": "Çevrimiçi", diff --git a/internal/web/translation/uk-UA.json b/internal/web/translation/uk-UA.json index 790c8b09c..6c3a2848a 100644 --- a/internal/web/translation/uk-UA.json +++ b/internal/web/translation/uk-UA.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "Видалити вузол \"{name}\"?", "deleteConfirmContent": "Це зупинить моніторинг вузла. Сама віддалена панель не зазнає змін.", "fleet": { - "subtitle": "Моніторинг цієї панелі та її віддалених вузлів.", + "subtitle": "Стежте за головним і всіма підключеними вузлами на одній сторінці.", "allNodes": "Усі вузли", "master": "Головний", "thisPanel": "Ця панель", "fleetScope": "Головний + віддалених вузлів: {remotes}", "reporting": "Передають дані: {live}/{total}", - "registered": "Зареєстровані вузли: {shown}/{total}", + "registered": "Віддалених: {remotes} · Усього: {total}", "allStatuses": "Усі стани", "open": "Відкрити", "hardware": "ЦП / ОЗП", @@ -1297,7 +1297,16 @@ "hostMetrics": "Швидкості та з’єднання підсумовуються за хостами.", "runtime": "Середовище виконання", "mixed": "Різні версії", - "history": "Історія" + "history": "Історія", + "node": "Вузол", + "searchNodes": "Пошук вузлів…", + "panel": "Панель", + "uptimeShort": "Робота", + "uptimeVaries": "Час роботи залежить від вузла", + "clientRecords": "Записів клієнтів: {records}", + "acrossNodes": "На {total} вузлах", + "connectionDetails": "Відомості про з’єднання", + "footnote": "Підсумки враховують вузли, які передають дані ({coverage}). Навантаження за 1, 5 і 15 хвилин підсумовується. Наведіть курсор на стан для відомостей про затримку й останню перевірку." }, "statusValues": { "online": "У мережі", diff --git a/internal/web/translation/vi-VN.json b/internal/web/translation/vi-VN.json index aacd822c1..b5736bf83 100644 --- a/internal/web/translation/vi-VN.json +++ b/internal/web/translation/vi-VN.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "Xóa nút \"{name}\"?", "deleteConfirmContent": "Việc này dừng giám sát nút. Panel từ xa không bị ảnh hưởng.", "fleet": { - "subtitle": "Giám sát bảng điều khiển này và các nút từ xa.", + "subtitle": "Giám sát nút chính và tất cả các nút đã kết nối trong một chế độ xem.", "allNodes": "Tất cả nút", "master": "Nút chính", "thisPanel": "Bảng điều khiển này", "fleetScope": "Nút chính + {remotes} nút từ xa", "reporting": "{live}/{total} đang báo cáo", - "registered": "{shown}/{total} nút đã đăng ký", + "registered": "{remotes} nút từ xa · {total} tổng cộng", "allStatuses": "Mọi trạng thái", "open": "Mở", "hardware": "CPU / RAM", @@ -1297,7 +1297,16 @@ "hostMetrics": "Tốc độ và kết nối được cộng theo từng máy chủ.", "runtime": "Môi trường chạy", "mixed": "Nhiều phiên bản", - "history": "Lịch sử" + "history": "Lịch sử", + "node": "Nút", + "searchNodes": "Tìm nút…", + "panel": "Bảng điều khiển", + "uptimeShort": "Đã chạy", + "uptimeVaries": "Thời gian chạy tùy theo nút", + "clientRecords": "{records} hồ sơ máy khách", + "acrossNodes": "Trên {total} nút", + "connectionDetails": "Chi tiết kết nối", + "footnote": "Tổng chỉ tính các nút đang báo cáo ({coverage}). Tải 1, 5 và 15 phút được cộng trên các nút. Di chuột qua trạng thái để xem lần liên lạc cuối và độ trễ." }, "statusValues": { "online": "Trực tuyến", diff --git a/internal/web/translation/zh-CN.json b/internal/web/translation/zh-CN.json index df67374a9..1643fe480 100644 --- a/internal/web/translation/zh-CN.json +++ b/internal/web/translation/zh-CN.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "删除节点 \"{name}\"?", "deleteConfirmContent": "这将停止监控该节点。远程面板本身不受影响。", "fleet": { - "subtitle": "监控本面板和远程节点。", + "subtitle": "集中监控主节点与所有已连接的节点。", "allNodes": "所有节点", "master": "主节点", "thisPanel": "本面板", "fleetScope": "主节点 + {remotes} 个远程节点", "reporting": "{live}/{total} 正在上报", - "registered": "{shown}/{total} 个已注册节点", + "registered": "{remotes} 个远程节点 · 共 {total} 个", "allStatuses": "所有状态", "open": "打开", "hardware": "CPU / 内存", @@ -1297,7 +1297,16 @@ "hostMetrics": "速率和连接数按主机汇总。", "runtime": "运行状态", "mixed": "多个版本", - "history": "历史" + "history": "历史", + "node": "节点", + "searchNodes": "搜索节点…", + "panel": "面板", + "uptimeShort": "运行", + "uptimeVaries": "运行时长因节点而异", + "clientRecords": "{records} 条客户端记录", + "acrossNodes": "分布于 {total} 个节点", + "connectionDetails": "连接详情", + "footnote": "总计仅包括正在上报的节点 ({coverage})。负载按 1、5 和 15 分钟展示,并在上报节点之间求和。将鼠标悬停在状态上可查看心跳和延迟。" }, "statusValues": { "online": "在线", diff --git a/internal/web/translation/zh-TW.json b/internal/web/translation/zh-TW.json index 412c32634..ef125810b 100644 --- a/internal/web/translation/zh-TW.json +++ b/internal/web/translation/zh-TW.json @@ -1276,13 +1276,13 @@ "deleteConfirmTitle": "刪除節點「{name}」?", "deleteConfirmContent": "這將停止監控該節點。遠端面板本身不受影響。", "fleet": { - "subtitle": "監控本面板與遠端節點。", + "subtitle": "集中監控主節點和所有已連線的節點。", "allNodes": "所有節點", "master": "主節點", "thisPanel": "本面板", "fleetScope": "主節點 + {remotes} 個遠端節點", "reporting": "{live}/{total} 正在回報", - "registered": "{shown}/{total} 個已註冊節點", + "registered": "{remotes} 個遠端節點 · 共 {total} 個", "allStatuses": "所有狀態", "open": "開啟", "hardware": "CPU / 記憶體", @@ -1297,7 +1297,16 @@ "hostMetrics": "速率和連線數按主機加總。", "runtime": "執行狀態", "mixed": "多個版本", - "history": "歷史" + "history": "歷史", + "node": "節點", + "searchNodes": "搜尋節點…", + "panel": "面板", + "uptimeShort": "運作", + "uptimeVaries": "運作時間依節點而異", + "clientRecords": "{records} 筆用戶端紀錄", + "acrossNodes": "分佈於 {total} 個節點", + "connectionDetails": "連線詳細資料", + "footnote": "總計僅納入回報中的節點 ({coverage})。負載以 1、5、15 分鐘表示並加總回報節點的負載。將游標停在狀態上可查看心跳和延遲。" }, "statusValues": { "online": "上線",