feat: update button (download, verify, stage)
This commit is contained in:
1 parent
834493a4f5
commit
70460e4170
41 files changed
+5345
-97
No files matched your search
@@ -15,6 +15,14 @@ export interface UpdateNotes {
|
||||
items: string[]
|
||||
}
|
||||
|
||||
export interface UpdateProgress {
|
||||
percent: number
|
||||
downloaded_bytes: number
|
||||
total_bytes: number
|
||||
}
|
||||
|
||||
export type UpdateErrorKind = 'download' | 'verification'
|
||||
|
||||
export interface UpdateStatus {
|
||||
current: string
|
||||
latest: string
|
||||
@@ -24,8 +32,8 @@ export interface UpdateStatus {
|
||||
checked_at: string | null
|
||||
can_apply: boolean
|
||||
state: UpdateState
|
||||
progress: unknown
|
||||
error: string | null
|
||||
progress: UpdateProgress | null
|
||||
error: UpdateErrorKind | null
|
||||
started_at: string | null
|
||||
}
|
||||
|
||||
@@ -40,5 +48,9 @@ export function useUpdate() {
|
||||
return request<UpdateStatus>('/v1/system/update/check', { method: 'POST' })
|
||||
}
|
||||
|
||||
return { getUpdateStatus, checkForUpdate }
|
||||
function startUpdateDownload(): Promise<UpdateStatus> {
|
||||
return request<UpdateStatus>('/v1/system/update/download', { method: 'POST' })
|
||||
}
|
||||
|
||||
return { getUpdateStatus, checkForUpdate, startUpdateDownload }
|
||||
}
|
||||
Reference in new issue
Block a user