feat: about tab with update check/download (Gitea feed first, GitHub fallback)
- updater: dual-feed state machine, manual check/download/install IPC, changelog from Gitea releases API with GitHub fallback - settings: new About tab (version, channel, auto-check toggle, progress) - system.autoCheckUpdate setting gates the startup check
This commit is contained in:
1 parent
a9acdbe500
commit
f25a1627f3
11 files changed
+417
-46
No files matched your search
+40
-1
@@ -90,7 +90,15 @@ export const Ipc = {
|
||||
ZMODEM_DONE: 'zmodem:done',
|
||||
|
||||
// ---- misc ----
|
||||
APP_INFO: 'app:info'
|
||||
APP_INFO: 'app:info',
|
||||
|
||||
// ---- updater (check/download/install + state broadcast) ----
|
||||
UPDATE_CHECK: 'update:check',
|
||||
UPDATE_DOWNLOAD: 'update:download',
|
||||
UPDATE_INSTALL: 'update:install',
|
||||
UPDATE_CHANGELOG: 'update:changelog',
|
||||
/** main -> renderer broadcast: UpdateState */
|
||||
UPDATE_STATE: 'update:state'
|
||||
} as const
|
||||
|
||||
export interface PtyCreateOptions {
|
||||
@@ -122,6 +130,37 @@ export interface AppInfo {
|
||||
homeDir: string
|
||||
}
|
||||
|
||||
// ---- updater ----
|
||||
export type UpdateStatus =
|
||||
| 'idle'
|
||||
| 'checking'
|
||||
| 'available'
|
||||
| 'latest'
|
||||
| 'downloading'
|
||||
| 'downloaded'
|
||||
| 'error'
|
||||
/** dev builds have no update channel */
|
||||
| 'dev'
|
||||
|
||||
export interface UpdateState {
|
||||
status: UpdateStatus
|
||||
/** running app version */
|
||||
currentVersion: string
|
||||
/** newer version when available/downloading/downloaded */
|
||||
version?: string
|
||||
/** 0-100 while downloading */
|
||||
percent?: number
|
||||
error?: string
|
||||
/** which feed served the last check: domestic Gitea first, GitHub fallback */
|
||||
feed?: 'gitea' | 'github'
|
||||
}
|
||||
|
||||
export interface ReleaseNote {
|
||||
version: string
|
||||
date: string
|
||||
body: string
|
||||
}
|
||||
|
||||
export interface LayoutMeta {
|
||||
id: string
|
||||
name: string
|
||||
|
||||
Reference in new issue
Block a user