mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
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:
@@ -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 },
|
||||
}
|
||||
}, {}),
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user