feat(web): rebuild the console around the fused control plane

Render the Hub feature set in the existing Animal Island styling: fleet
messages, notification centre, log centre, organisation panel, per-instance
device module panels and the settings backup, connection and maintenance
surfaces.
This commit is contained in:
chick
2026-09-05 18:53:04 +08:00
parent f9186bd851
commit a75badeb58
77 changed files with 20578 additions and 435 deletions
+81 -5
View File
@@ -8,7 +8,7 @@ export type OverviewFieldValue = string | number | boolean | null;
export type OverviewSection = Readonly<Record<string, OverviewFieldValue>>;
export interface OverviewSnapshot {
readonly observedAt?: string;
readonly observedAt?: string | undefined;
readonly device: OverviewSection;
readonly sim: OverviewSection;
readonly network: OverviewSection;
@@ -24,11 +24,11 @@ export interface OverviewDataSource {
export interface OverviewSystemPageProps {
readonly instance: InstanceContext;
readonly dataSource?: OverviewDataSource;
readonly dataSource?: OverviewDataSource | undefined;
/** Change this value when an external owner has requested a refresh. */
readonly refreshSignal?: unknown;
readonly operationClient?: OperationClient;
readonly revision?: number;
readonly refreshSignal?: unknown | undefined;
readonly operationClient?: OperationClient | undefined;
readonly revision?: number | undefined;
}
type ReadState =
@@ -70,10 +70,86 @@ const FIELD_LABELS: Readonly<Record<string, string>> = {
Temperature: '温度',
State: '状态',
Latency: '延迟',
// Device payloads arrive with their native snake_case field names.
model: '型号',
manufacturer: '制造商',
brand: '品牌',
imei: 'IMEI',
meid: 'MEID',
iccid: 'ICCID',
imsi: 'IMSI',
phone_number: '号码',
firmware_version: '固件版本',
os_version: '系统版本',
version: '版本',
baseband_version: '基带版本',
uptime: '运行时间',
uptime_seconds: '运行时间(秒)',
slots: '卡槽数',
active_slots: '活跃数',
active: '已激活',
enabled: '已启用',
operator: '运营商',
carrier: '运营商',
network_type: '接入制式',
technology: '技术',
radio_mode: '网络模式',
signal: '信号强度',
signal_dbm: '信号强度(dBm',
signal_percent: '信号质量',
rsrp: 'RSRP',
rsrq: 'RSRQ',
sinr: 'SINR',
mcc: 'MCC',
mnc: 'MNC',
registration: '注册状态',
registration_state: '注册状态',
roaming: '漫游',
airplane_mode: '飞行模式',
ipv4: 'IPv4 地址',
ipv6: 'IPv6 地址',
ip_address: 'IP 地址',
gateway: '网关',
dns: 'DNS',
download: '下行速率',
upload: '上行速率',
download_bytes: '下行流量',
upload_bytes: '上行流量',
messages_today: '今日消息数',
calls: '通话数',
usage: '使用率',
temperature: '温度',
max_temperature_c: '最高温度',
cpu_percent: 'CPU 使用率',
cpu_load: 'CPU 负载',
memory_percent: '内存使用率',
memory_total_mb: '内存总量',
memory_available_mb: '可用内存',
battery_level: '电量',
battery_percent: '电量',
latency: '延迟',
connected: '连接状态',
interface: '网络接口',
ssid: '无线网络',
apn: 'APN',
};
const ENUM_LABELS: Readonly<Record<string, string>> = {
connected: '已连接',
not_registered: '未注册',
attached: '已附着',
detached: '已分离',
enabled: '已启用',
disabled: '已停用',
true: '是',
false: '否',
lte: 'LTE',
nr: 'NR',
nr5g: '5G NR',
gsm: 'GSM',
wcdma: 'WCDMA',
td_scdma: 'TD-SCDMA',
evdo: 'EVDO',
disconnected: '未连接',
connecting: '正在连接',
registered: '已注册',