feat(desktop): add client release updater
Desktop Client Build / Resolve Build Metadata (push) Successful in 19s
Frontend CI / Frontend (push) Successful in 3m20s
Backend CI / Backend (push) Successful in 16m48s
Desktop Client Build / Build Desktop Client (push) Successful in 24m46s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 37s

This commit is contained in:
2026-05-25 19:23:49 +08:00
parent 41b4a765ac
commit 5f6e9f11da
46 changed files with 5508 additions and 160 deletions
+37 -6
View File
@@ -1,7 +1,10 @@
import type {
CreatePublishJobResponse,
DesktopAccountInfo,
DesktopClientReleaseCheckResponse,
DesktopClientRotateResponse,
DesktopClientUpdateProgressEvent,
DesktopClientUpdateResult,
DesktopPublishTaskListResponse,
DesktopRuntimeSessionSyncRequest,
ListDesktopPublishTasksParams,
@@ -17,6 +20,11 @@ interface DesktopDeviceInfo {
cpu_arch: string
}
interface DesktopAppVersionInfo {
version: string
channel: string
}
interface DesktopClientIDScope {
tenant_id: number
workspace_id: number
@@ -115,6 +123,18 @@ if (import.meta.env.DEV) {
const desktopBridge = {
app: {
ping: () => ipcRenderer.invoke('desktop:ping') as Promise<string>,
versionInfo: () => ipcRenderer.invoke('desktop:version-info') as Promise<DesktopAppVersionInfo>,
checkClientRelease: () =>
ipcRenderer.invoke(
'desktop:check-client-release',
) as Promise<DesktopClientReleaseCheckResponse>,
clientReleaseDownloadURL: () =>
ipcRenderer.invoke('desktop:client-release-download-url') as Promise<{
download_url: string
}>,
quitApp: () => ipcRenderer.invoke('desktop:quit-app') as Promise<null>,
startClientUpdate: () =>
ipcRenderer.invoke('desktop:start-client-update') as Promise<DesktopClientUpdateResult>,
deviceInfo: () => ipcRenderer.invoke('desktop:device-info') as Promise<DesktopDeviceInfo>,
clientId: (scope: DesktopClientIDScope) =>
ipcRenderer.invoke('desktop:client-id', scope) as Promise<string>,
@@ -153,11 +173,14 @@ const desktopBridge = {
getAppSettings: () =>
ipcRenderer.invoke('desktop:get-app-settings') as Promise<DesktopAppSettings>,
getLoginCredentials: () =>
ipcRenderer.invoke('desktop:get-login-credentials') as Promise<DesktopLoginCredentials | null>,
ipcRenderer.invoke(
'desktop:get-login-credentials',
) as Promise<DesktopLoginCredentials | null>,
saveLoginCredentials: (credentials: DesktopLoginCredentials) =>
ipcRenderer.invoke('desktop:save-login-credentials', credentials) as Promise<
DesktopLoginCredentials
>,
ipcRenderer.invoke(
'desktop:save-login-credentials',
credentials,
) as Promise<DesktopLoginCredentials>,
clearLoginCredentials: () =>
ipcRenderer.invoke('desktop:clear-login-credentials') as Promise<null>,
setAppSetting: (key: keyof DesktopAppSettings, value: boolean) =>
@@ -205,6 +228,15 @@ const desktopBridge = {
ipcRenderer.off('desktop:network-observed', wrapped)
}
},
onClientUpdateProgress: (listener: (event: DesktopClientUpdateProgressEvent) => void) => {
const wrapped = (_event: IpcRendererEvent, payload: DesktopClientUpdateProgressEvent) => {
listener(payload)
}
ipcRenderer.on('desktop:client-update-progress', wrapped)
return () => {
ipcRenderer.off('desktop:client-update-progress', wrapped)
}
},
},
workbenchNavigation: {
getState: () =>
@@ -212,8 +244,7 @@ const desktopBridge = {
'desktop:workbench-navigation:get-state',
) as Promise<WorkbenchNavigationState>,
goBack: () => ipcRenderer.invoke('desktop:workbench-navigation:go-back') as Promise<null>,
goForward: () =>
ipcRenderer.invoke('desktop:workbench-navigation:go-forward') as Promise<null>,
goForward: () => ipcRenderer.invoke('desktop:workbench-navigation:go-forward') as Promise<null>,
reload: () => ipcRenderer.invoke('desktop:workbench-navigation:reload') as Promise<null>,
onStateChanged: (listener: (state: WorkbenchNavigationState) => void) => {
const wrapped = (_event: IpcRendererEvent, payload: WorkbenchNavigationState) => {