feat: signed releases, release feed, notification (read-only)
This commit is contained in:
1 parent
a49eec909c
commit
834493a4f5
49 files changed
+4191
-18
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { useApi } from '@/composables/useApi'
|
||||
|
||||
export type UpdateState =
|
||||
| 'idle'
|
||||
| 'downloading'
|
||||
| 'verifying'
|
||||
| 'ready'
|
||||
| 'restarting'
|
||||
| 'succeeded'
|
||||
| 'failed'
|
||||
|
||||
export interface UpdateNotes {
|
||||
version: string
|
||||
released_at: string
|
||||
items: string[]
|
||||
}
|
||||
|
||||
export interface UpdateStatus {
|
||||
current: string
|
||||
latest: string
|
||||
available: boolean
|
||||
release_url: string | null
|
||||
notes: UpdateNotes | null
|
||||
checked_at: string | null
|
||||
can_apply: boolean
|
||||
state: UpdateState
|
||||
progress: unknown
|
||||
error: string | null
|
||||
started_at: string | null
|
||||
}
|
||||
|
||||
export function useUpdate() {
|
||||
const { request } = useApi()
|
||||
|
||||
function getUpdateStatus(): Promise<UpdateStatus> {
|
||||
return request<UpdateStatus>('/v1/system/update')
|
||||
}
|
||||
|
||||
function checkForUpdate(): Promise<UpdateStatus> {
|
||||
return request<UpdateStatus>('/v1/system/update/check', { method: 'POST' })
|
||||
}
|
||||
|
||||
return { getUpdateStatus, checkForUpdate }
|
||||
}
|
||||
Reference in new issue
Block a user