mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
fix conditional display state (#1612)
* fix conditional display state * fix footer * fix empty case * remove select all from backup restore * fix styling and add warning message to service restore * update copy
This commit is contained in:
@@ -10,14 +10,11 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
<h3 class="padding warning">
|
||||||
|
Warning! Restoring a service will <i>permanently overwrite</i> its current
|
||||||
|
data with data from its backup. Please make selections carefully.
|
||||||
|
</h3>
|
||||||
<ion-item-group>
|
<ion-item-group>
|
||||||
<ion-item-divider>
|
|
||||||
<ion-buttons slot="end" style="padding-bottom: 6px">
|
|
||||||
<ion-button fill="clear" (click)="toggleSelectAll()">
|
|
||||||
<b>{{ selectAll ? 'Select All' : 'Deselect All' }}</b>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-item-divider>
|
|
||||||
<ion-item *ngFor="let option of options">
|
<ion-item *ngFor="let option of options">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<h2>{{ option.title }}</h2>
|
<h2>{{ option.title }}</h2>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
.padding {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning {
|
||||||
|
color: var(--ion-color-warning)
|
||||||
|
}
|
||||||
@@ -27,7 +27,6 @@ export class AppRecoverSelectPage {
|
|||||||
'newer-eos': boolean
|
'newer-eos': boolean
|
||||||
})[]
|
})[]
|
||||||
hasSelection = false
|
hasSelection = false
|
||||||
selectAll = true
|
|
||||||
error: string | IonicSafeString
|
error: string | IonicSafeString
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -63,11 +62,6 @@ export class AppRecoverSelectPage {
|
|||||||
this.hasSelection = this.options.some(o => o.checked)
|
this.hasSelection = this.options.some(o => o.checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSelectAll() {
|
|
||||||
this.options.forEach(pkg => (pkg.checked = this.selectAll))
|
|
||||||
this.selectAll = !this.selectAll
|
|
||||||
}
|
|
||||||
|
|
||||||
async restore(): Promise<void> {
|
async restore(): Promise<void> {
|
||||||
const ids = this.options
|
const ids = this.options
|
||||||
.filter(option => !!option.checked)
|
.filter(option => !!option.checked)
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<div *ngIf="pkgs.length; else noServices">
|
<ion-content>
|
||||||
<ion-content>
|
<ng-container *ngIf="pkgs.length; else empty">
|
||||||
<ion-item-group>
|
<ion-item-group>
|
||||||
<ion-item-divider>
|
<ion-item-divider>
|
||||||
<ion-buttons slot="end" style="padding-bottom: 6px">
|
<ion-buttons slot="end" style="padding-bottom: 6px">
|
||||||
@@ -34,25 +34,24 @@
|
|||||||
></ion-checkbox>
|
></ion-checkbox>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-item-group>
|
</ion-item-group>
|
||||||
</ion-content>
|
</ng-container>
|
||||||
|
<ng-template #empty>
|
||||||
|
<h2 class="center">No services installed!</h2>
|
||||||
|
</ng-template>
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-buttons slot="end" class="ion-padding-end">
|
<ion-buttons slot="end" class="ion-padding-end">
|
||||||
<ion-button
|
<ion-button
|
||||||
[disabled]="!hasSelection"
|
[disabled]="!hasSelection"
|
||||||
fill="solid"
|
fill="solid"
|
||||||
color="primary"
|
color="primary"
|
||||||
(click)="dismiss(true)"
|
(click)="dismiss(true)"
|
||||||
class="enter-click btn-128"
|
class="enter-click btn-128"
|
||||||
>
|
>
|
||||||
Back Up Selected
|
Back Up Selected
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-footer>
|
</ion-footer>
|
||||||
</div>
|
|
||||||
|
|
||||||
<ng-template #noServices>
|
|
||||||
<ion-content><h2 class="center">No services installed!</h2></ion-content>
|
|
||||||
</ng-template>
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
.center {
|
.center {
|
||||||
text-align: center;
|
display: flex;
|
||||||
padding: 20px;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user