新增数据同步服务端模式已认证设备列表管理

This commit is contained in:
lyswhut
2023-08-29 15:40:42 +08:00
parent 5d877d81e3
commit 7d17423e4b
24 changed files with 595 additions and 158 deletions
+17 -1
View File
@@ -1,6 +1,16 @@
import { mainHandle } from '@common/mainIpc'
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames'
import { startServer, stopServer, getServerStatus, generateCode, connectServer, disconnectServer, getClientStatus } from '@main/modules/sync'
import {
startServer,
stopServer,
getServerStatus,
generateCode,
connectServer,
disconnectServer,
getClientStatus,
getServerDevices,
removeServerDevice,
} from '@main/modules/sync'
import { sendEvent } from '../main'
let selectModeListenr: ((mode: LX.Sync.List.SyncMode | null) => void) | null = null
@@ -27,6 +37,12 @@ export default () => {
break
}
})
mainHandle<never, LX.Sync.ServerDevices>(WIN_MAIN_RENDERER_EVENT_NAME.sync_get_server_devices, async() => {
return getServerDevices()
})
mainHandle<string>(WIN_MAIN_RENDERER_EVENT_NAME.sync_remove_server_device, async({ params: clientId }) => {
await removeServerDevice(clientId)
})
}