selective backups and better drive selection interface (#1576)

* selective backups and better drive selection interface

* fix disabled checkbox and backup drives menu styling

* feat: package-ids

* only show services that are backing up on backup page

* refactor for performace and cleanliness

Co-authored-by: Matt Hill <matthill@Matt-M1.start9.dev>
Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com>
Co-authored-by: J M <mogulslayer@gmail.com>
This commit is contained in:
Matt Hill
2022-06-28 12:14:26 -06:00
committed by GitHub
parent 753f395b8d
commit 2c5aa84fe7
25 changed files with 460 additions and 220 deletions

View File

@@ -392,12 +392,13 @@ export class MockApiService extends ApiService {
params: RR.CreateBackupReq,
): Promise<RR.CreateBackupRes> {
await pauseFor(2000)
const path = '/server-info/status-info/backing-up'
const ids = ['bitcoind', 'lnd']
const path = '/server-info/status-info/backup-progress'
const ids = params['package-ids']
setTimeout(async () => {
for (let i = 0; i < ids.length; i++) {
const appPath = `/package-data/${ids[i]}/installed/status/main/status`
const id = ids[i]
const appPath = `/package-data/${id}/installed/status/main/status`
const appPatch = [
{
op: PatchOp.REPLACE,
@@ -409,13 +410,19 @@ export class MockApiService extends ApiService {
await pauseFor(8000)
const newPatch = [
this.updateMock([
{
...appPatch[0],
value: PackageMainStatus.Stopped,
},
]
this.updateMock(newPatch)
])
this.updateMock([
{
op: PatchOp.REPLACE,
path: `${path}/${id}/complete`,
value: true,
},
])
}
await pauseFor(1000)
@@ -425,7 +432,7 @@ export class MockApiService extends ApiService {
{
op: PatchOp.REPLACE,
path,
value: false,
value: null,
},
]
this.updateMock(lastPatch)
@@ -435,7 +442,12 @@ export class MockApiService extends ApiService {
{
op: PatchOp.REPLACE,
path,
value: true,
value: ids.reduce((acc, val) => {
return {
...acc,
[val]: { complete: false },
}
}, {}),
},
]