Feature/server status restarting (#2503)

* extend `server-info`

* add restarting, shutting down to FE status bar

* fix build

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Matt Hill
2023-11-08 02:31:18 -07:00
committed by GitHub
parent 753fbc0c5c
commit 871f78b570
11 changed files with 117 additions and 37 deletions

View File

@@ -302,6 +302,27 @@ export class MockApiService extends ApiService {
params: RR.RestartServerReq,
): Promise<RR.RestartServerRes> {
await pauseFor(2000)
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/restarting',
value: true,
},
]
this.mockRevision(patch)
setTimeout(() => {
const patch2 = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/restarting',
value: false,
},
]
this.mockRevision(patch2)
}, 2000)
return null
}
@@ -309,14 +330,34 @@ export class MockApiService extends ApiService {
params: RR.ShutdownServerReq,
): Promise<RR.ShutdownServerRes> {
await pauseFor(2000)
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/shutting-down',
value: true,
},
]
this.mockRevision(patch)
setTimeout(() => {
const patch2 = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/shutting-down',
value: false,
},
]
this.mockRevision(patch2)
}, 2000)
return null
}
async systemRebuild(
params: RR.RestartServerReq,
): Promise<RR.RestartServerRes> {
await pauseFor(2000)
return null
params: RR.SystemRebuildReq,
): Promise<RR.SystemRebuildRes> {
return this.restartServer(params)
}
async repairDisk(params: RR.RestartServerReq): Promise<RR.RestartServerRes> {