mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
rework installing page and add cancel install button (#2915)
* rework installing page and add cancel install button * actually call cancel endpoint * fix two bugs * include translations in progress component * cancellable installs * fix: comments (#2916) * fix: comments * delete comments * ensure trailing slash and no qp for new registry url --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> * fix raspi * bump sdk --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Alex Inkin <alexander@inkin.ru>
This commit is contained in:
@@ -319,6 +319,9 @@ export namespace RR {
|
||||
export type InstallPackageReq = T.InstallParams
|
||||
export type InstallPackageRes = null
|
||||
|
||||
export type CancelInstallPackageReq = { id: string }
|
||||
export type CancelInstallPackageRes = null
|
||||
|
||||
export type GetActionInputReq = { packageId: string; actionId: string } // package.action.get-input
|
||||
export type GetActionInputRes = {
|
||||
spec: IST.InputSpec
|
||||
|
||||
@@ -325,6 +325,10 @@ export abstract class ApiService {
|
||||
params: RR.InstallPackageReq,
|
||||
): Promise<RR.InstallPackageRes>
|
||||
|
||||
abstract cancelInstallPackage(
|
||||
params: RR.CancelInstallPackageReq,
|
||||
): Promise<RR.CancelInstallPackageRes>
|
||||
|
||||
abstract getActionInput(
|
||||
params: RR.GetActionInputReq,
|
||||
): Promise<RR.GetActionInputRes>
|
||||
|
||||
@@ -560,6 +560,12 @@ export class LiveApiService extends ApiService {
|
||||
return this.rpcRequest({ method: 'package.install', params })
|
||||
}
|
||||
|
||||
async cancelInstallPackage(
|
||||
params: RR.CancelInstallPackageReq,
|
||||
): Promise<RR.CancelInstallPackageRes> {
|
||||
return this.rpcRequest({ method: 'package.cancel-install', params })
|
||||
}
|
||||
|
||||
async getActionInput(
|
||||
params: RR.GetActionInputReq,
|
||||
): Promise<RR.GetActionInputRes> {
|
||||
|
||||
@@ -50,10 +50,7 @@ const PROGRESS: T.FullProgress = {
|
||||
},
|
||||
{
|
||||
name: 'Installing',
|
||||
progress: {
|
||||
done: 0,
|
||||
total: 40,
|
||||
},
|
||||
progress: null,
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1077,6 +1074,22 @@ export class MockApiService extends ApiService {
|
||||
return null
|
||||
}
|
||||
|
||||
async cancelInstallPackage(
|
||||
params: RR.CancelInstallPackageReq,
|
||||
): Promise<RR.CancelInstallPackageRes> {
|
||||
await pauseFor(500)
|
||||
|
||||
const patch: RemoveOperation[] = [
|
||||
{
|
||||
op: PatchOp.REMOVE,
|
||||
path: `/packageData/${params.id}`,
|
||||
},
|
||||
]
|
||||
this.mockRevision(patch)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
async getActionInput(
|
||||
params: RR.GetActionInputReq,
|
||||
): Promise<RR.GetActionInputRes> {
|
||||
|
||||
Reference in New Issue
Block a user