mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
add select/deselect all to backups and enum lists (#1590)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ libs/js_engine/src/artifacts/ARM_JS_SNAPSHOT.bin
|
||||
libs/js_engine/src/artifacts/JS_SNAPSHOT.bin
|
||||
deploy_web.sh
|
||||
secrets.db
|
||||
.vscode/
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
|
||||
<ion-content>
|
||||
<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 pkg of pkgs">
|
||||
<ion-avatar slot="start">
|
||||
<img alt="" [src]="pkg.icon" />
|
||||
|
||||
@@ -12,6 +12,7 @@ import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||
export class BackupSelectPage {
|
||||
hasSelection = false
|
||||
error: string | IonicSafeString = ''
|
||||
selectAll = true
|
||||
pkgs: {
|
||||
id: string
|
||||
title: string
|
||||
@@ -58,4 +59,9 @@ export class BackupSelectPage {
|
||||
handleChange() {
|
||||
this.hasSelection = this.pkgs.some(p => p.checked)
|
||||
}
|
||||
|
||||
toggleSelectAll() {
|
||||
this.pkgs.forEach(pkg => (pkg.checked = this.selectAll))
|
||||
this.selectAll = !this.selectAll
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
<ion-content>
|
||||
<ion-item-group>
|
||||
<ion-item-divider style="padding-bottom: 4px">
|
||||
<ion-item-divider style="padding-bottom: 6px">
|
||||
<ion-buttons slot="end">
|
||||
<ion-button fill="clear" (click)="toggleSelectAll()">
|
||||
<b>{{ selectAll ? 'All' : 'None' }}</b>
|
||||
<b>{{ selectAll ? 'Select All' : 'Deselect All' }}</b>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-item-divider>
|
||||
|
||||
@@ -12,7 +12,7 @@ export class EnumListPage {
|
||||
@Input() spec: ValueSpecListOf<'enum'>
|
||||
@Input() current: string[]
|
||||
options: { [option: string]: boolean } = {}
|
||||
selectAll = true
|
||||
selectAll = false
|
||||
|
||||
constructor(private readonly modalCtrl: ModalController) {}
|
||||
|
||||
@@ -20,6 +20,8 @@ export class EnumListPage {
|
||||
for (let val of this.spec.spec.values) {
|
||||
this.options[val] = this.current.includes(val)
|
||||
}
|
||||
// if none are selected, set selectAll to true
|
||||
this.selectAll = Object.values(this.options).some(k => !k)
|
||||
}
|
||||
|
||||
dismiss() {
|
||||
|
||||
Reference in New Issue
Block a user