feat(system): 添加设备信息及重启关机控制

关于页展示宿主系统、处理器、架构、内核和资源占用,合并同一文件系统上的系统与 MSD 容量。
新增 Linux 宿主机重启和关机接口,在其他设置中提供二次确认、请求互斥及失败提示。
修正 Linux 磁盘已用空间计算,并补充设备信息和电源控制的后端单元测试。

验证:独立暂存快照前端构建通过;6 项后端测试通过;设置页保存、系统信息及模拟电源控制浏览器测试通过。
This commit is contained in:
mofeng-git
2026-10-28 07:20:44 +08:00
parent fed753261b
commit 8d58119b77
13 changed files with 703 additions and 1 deletions

View File

@@ -1,12 +1,49 @@
export const settingsUiZh = {
watchdogAutoReset: '启用自动复位',
deviceControls: '设备操作',
deviceControlsHelp: '管理运行 One-KVM 的设备',
reboot: '重启',
poweroff: '关机',
rebootConfirm: '确认重启设备?',
poweroffConfirm: '确认关闭设备?',
rebootDescription: '将重启运行 One-KVM 的设备,当前连接会中断。启动完成后可重新连接。',
poweroffDescription: '将关闭运行 One-KVM 的设备,当前连接会中断。关机后需要手动重新上电。',
rebootSent: '重启请求已发送,请等待设备重新启动后再连接。',
poweroffSent: '关机请求已发送,设备即将关闭。',
deviceActionFailed: '操作请求未能发送,请重试。',
mcpRate: '请求频率(次/秒)',
help: '查看提示',
back: '返回控制台',
saveCapture: '保存采集设置',
saveEncoder: '保存编码设置',
saveConnection: '保存连接设置',
load: '系统监控',
loadHelp:
'显示 CPU、内存和分区的实际占用比例。系统与 MSD 位于同一文件系统时合并显示,不重复统计容量。',
cpu: 'CPU 占用',
memory: '内存占用',
systemDisk: '系统分区占用',
msdDisk: 'MSD 分区占用',
sharedDisk: '系统 / MSD 分区占用',
cores: '{count} 核处理器',
systemInfo: '版本与系统',
systemInfoHelp:
'报告问题时,可提供软件版本、系统、处理器、架构、内核与主机名,方便定位设备环境。',
softwareVersion: '软件版本',
operatingSystem: '操作系统',
processor: '处理器',
architecture: '系统架构',
kernel: '内核版本',
hostname: '主机名',
copyInfo: '复制信息',
copied: '信息已复制',
copyFailed: '复制失败,请手动选择信息',
unavailable: '暂不可用',
project: '项目主页',
docs: '使用文档',
feedback: '反馈问题',
loadFailed: '无法刷新系统信息,暂时保留最近一次读取的数据。',
featuresHelp:
'USB 功能会按当前驱动与设备能力提供。修改后只保存本卡片配置,设备可能重新识别 USB 连接。',
identifiers: '高级设备标识',
@@ -22,13 +59,52 @@ export const settingsUiZh = {
}
export const settingsUiEn = {
watchdogAutoReset: 'Enable automatic recovery',
deviceControls: 'Device controls',
deviceControlsHelp: 'Manage the device running One-KVM',
reboot: 'Restart',
poweroff: 'Shut down',
rebootConfirm: 'Restart this device?',
poweroffConfirm: 'Shut down this device?',
rebootDescription:
'The device running One-KVM will restart and disconnect this session. Reconnect after startup.',
poweroffDescription:
'The device running One-KVM will shut down and disconnect this session. You will need to power it on manually.',
rebootSent: 'Restart requested. Reconnect after the device starts up.',
poweroffSent: 'Shutdown requested. The device will turn off shortly.',
deviceActionFailed: 'Could not send the request. Please try again.',
mcpRate: 'Requests per second',
help: 'Show help',
back: 'Back to console',
saveCapture: 'Save capture',
saveEncoder: 'Save encoder',
saveConnection: 'Save connection',
load: 'System monitoring',
loadHelp:
'Actual CPU, memory and filesystem usage. System and MSD storage share one indicator when they belong to the same filesystem.',
cpu: 'CPU usage',
memory: 'Memory usage',
systemDisk: 'System partition',
msdDisk: 'MSD partition',
sharedDisk: 'System / MSD partition',
cores: '{count} CPU cores',
systemInfo: 'Version & system',
systemInfoHelp:
'Include the software version, operating system, processor, architecture, kernel and hostname when reporting an issue.',
softwareVersion: 'Software version',
operatingSystem: 'Operating system',
processor: 'Processor',
architecture: 'Architecture',
kernel: 'Kernel version',
hostname: 'Hostname',
copyInfo: 'Copy information',
copied: 'Information copied',
copyFailed: 'Copy failed. Select and copy the information manually.',
unavailable: 'Unavailable',
project: 'Project',
docs: 'Documentation',
feedback: 'Report an issue',
loadFailed: 'Could not refresh system information. Showing the most recent data.',
featuresHelp:
'Available USB functions depend on the driver and hardware. Saving applies only this card and may reconnect the USB device.',
identifiers: 'Advanced device identity',