feat: 增加WOL服务端历史记录并支持跨浏览器同步

This commit is contained in:
mofeng-git
2026-02-11 17:04:40 +08:00
parent fb975875f1
commit 60b294e0ab
5 changed files with 176 additions and 18 deletions

View File

@@ -136,6 +136,15 @@ export const msdConfigApi = {
// ===== ATX 配置 API =====
import type { AtxDevices } from '@/types/generated'
export interface WolHistoryEntry {
mac_address: string
updated_at: number
}
export interface WolHistoryResponse {
history: WolHistoryEntry[]
}
export const atxConfigApi = {
/**
* 获取 ATX 配置
@@ -166,6 +175,13 @@ export const atxConfigApi = {
method: 'POST',
body: JSON.stringify({ mac_address: macAddress }),
}),
/**
* 获取 WOL 历史记录(服务端持久化)
* @param limit 返回条数1-50
*/
getWolHistory: (limit = 5) =>
request<WolHistoryResponse>(`/atx/wol/history?limit=${Math.max(1, Math.min(50, limit))}`),
}
// ===== Audio 配置 API =====