mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-28 16:30:48 +08:00
feat(system): 添加设备信息及重启关机控制
关于页展示宿主系统、处理器、架构、内核和资源占用,合并同一文件系统上的系统与 MSD 容量。 新增 Linux 宿主机重启和关机接口,在其他设置中提供二次确认、请求互斥及失败提示。 修正 Linux 磁盘已用空间计算,并补充设备信息和电源控制的后端单元测试。 验证:独立暂存快照前端构建通过;6 项后端测试通过;设置页保存、系统信息及模拟电源控制浏览器测试通过。
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { HostInfo } from '@/api'
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { systemApi, streamApi, hidApi, atxApi, msdApi, type DeviceInfo, type DiskMode, type MountedMedia, type PlatformCapabilities } from '@/api'
|
||||
@@ -166,6 +167,7 @@ export const useSystemStore = defineStore('system', () => {
|
||||
const capabilities = ref<SystemCapabilities | null>(null)
|
||||
const diskSpace = ref<DiskSpaceInfo | null>(null)
|
||||
const deviceInfo = ref<DeviceInfo | null>(null)
|
||||
const hostInfo = ref<HostInfo | null>(null)
|
||||
const stream = ref<StreamState | null>(null)
|
||||
const hid = ref<HidState | null>(null)
|
||||
const atx = ref<AtxState | null>(null)
|
||||
@@ -189,6 +191,7 @@ export const useSystemStore = defineStore('system', () => {
|
||||
capabilities.value = info.capabilities
|
||||
diskSpace.value = info.disk_space ?? null
|
||||
deviceInfo.value = info.device_info ?? null
|
||||
hostInfo.value = info.host ?? null
|
||||
return info
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch system info:', e)
|
||||
@@ -455,6 +458,7 @@ export const useSystemStore = defineStore('system', () => {
|
||||
capabilities,
|
||||
diskSpace,
|
||||
deviceInfo,
|
||||
hostInfo,
|
||||
stream,
|
||||
hid,
|
||||
atx,
|
||||
|
||||
Reference in New Issue
Block a user