update done fix

This commit is contained in:
Drew Ansbacher
2022-02-10 16:49:56 -07:00
committed by Aiden McClelland
parent e3fd98f8c9
commit 6fbe207a8c
4 changed files with 55 additions and 30 deletions

View File

@@ -298,6 +298,7 @@ export class AppComponent {
}
})
}
m
private watchUpdateProgress (): Subscription {
return this.patch

View File

@@ -63,19 +63,30 @@
</p>
<!-- "Software Update" button only -->
<p *ngIf="button.title === 'Software Update'">
<ng-container
*ngIf="eosService.updateAvailable$ | async; else check"
>
<ion-text class="inline" color="success">
<ion-icon name="rocket-outline"></ion-icon>
Update Available
<ng-container *ngIf="button.disabled | async; else enabled">
<ion-text
*ngIf="patch.data['server-info']['status-info'].updated"
class="inline"
color="warning"
>
Update Complete, Restart to apply changes
</ion-text>
</ng-container>
<ng-template #check>
<ion-text class="inline" color="dark">
<ion-icon name="refresh"></ion-icon>
Check for updates
</ion-text>
<ng-template #enabled>
<ng-container
*ngIf="eosService.updateAvailable$ | async; else check"
>
<ion-text class="inline" color="success">
<ion-icon name="rocket-outline"></ion-icon>
Update Available
</ion-text>
</ng-container>
<ng-template #check>
<ion-text class="inline" color="dark">
<ion-icon name="refresh"></ion-icon>
Check for updates
</ion-text>
</ng-template>
</ng-template>
</p>
</ion-label>

View File

@@ -236,7 +236,10 @@ export class ServerShowPage {
disabled: this.patch
.watch$('server-info', 'status-info')
.pipe(
map(status => status['backing-up'] || !!status['update-progress']),
map(
status =>
status && (status['backing-up'] || !!status['update-progress']),
),
),
},
],
@@ -250,7 +253,17 @@ export class ServerShowPage {
? this.updateEos()
: this.checkForEosUpdate(),
detail: false,
disabled: of(false),
disabled: this.patch
.watch$('server-info', 'status-info')
.pipe(
map(
status =>
status &&
(status['backing-up'] ||
!!status['update-progress'] ||
status.updated),
),
),
},
{
title: 'Preferences',