mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-28 16:30:48 +08:00
feat(platform): 按平台能力控制功能入口与请求
This commit is contained in:
@@ -260,6 +260,11 @@ export const useSystemStore = defineStore('system', () => {
|
||||
|
||||
async function fetchMsdState() {
|
||||
try {
|
||||
if (!platform.value) await fetchSystemInfo()
|
||||
if (!platform.value?.msd.available) {
|
||||
msd.value = null
|
||||
return null
|
||||
}
|
||||
const result = await msdApi.status()
|
||||
msd.value = {
|
||||
available: result.available,
|
||||
@@ -306,12 +311,13 @@ export const useSystemStore = defineStore('system', () => {
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
const systemInfoRequest = fetchSystemInfo()
|
||||
await Promise.all([
|
||||
fetchSystemInfo(),
|
||||
systemInfoRequest,
|
||||
fetchStreamState().catch(() => null),
|
||||
fetchHidState().catch(() => null),
|
||||
fetchAtxState().catch(() => null),
|
||||
fetchMsdState().catch(() => null),
|
||||
systemInfoRequest.then(() => fetchMsdState()).catch(() => null),
|
||||
])
|
||||
} catch (e) {
|
||||
error.value = e instanceof Error ? e.message : 'Failed to fetch states'
|
||||
|
||||
Reference in New Issue
Block a user