refresh button in embassy drive page in wizard

This commit is contained in:
Drew Ansbacher
2022-01-17 10:57:26 -07:00
committed by Aiden McClelland
parent 13c6201893
commit 4c6abe7e60
3 changed files with 12 additions and 4 deletions

View File

@@ -8,10 +8,16 @@
</div>
<ion-card color="dark">
<ion-card-header class="ion-text-center" style="padding-bottom: 8px;">
<ion-card-header class="ion-text-center" style="padding-bottom: 8px;" *ngIf="loading || storageDrives.length; else empty">
<ion-card-title>Select Storage Drive</ion-card-title>
<ion-card-subtitle>Select the drive where your Embassy data will be stored.</ion-card-subtitle>
</ion-card-header>
<ng-template #empty>
<ion-card-header class="ion-text-center" style="padding-bottom: 8px;">
<ion-card-title>No drives found</ion-card-title>
<ion-card-subtitle>Please connect a storage drive to your Embassy and click "Refresh".</ion-card-subtitle>
</ion-card-header>
</ng-template>
<ion-card-content class="ion-margin">
<!-- loading -->
@@ -20,8 +26,9 @@
<!-- not loading -->
<ng-template #loaded>
<ng-container *ngIf="!storageDrives.length">
<h2>No drives found</h2>
<p>Please connect a storage drive to your Embassy and click "Refresh".</p>
<ion-button fill="clear" color="light" (click)="getDrives()">
<ion-icon color="primary" size="large" name='refresh' icon-start></ion-icon>
</ion-button>
</ng-container>
<ion-item-group *ngIf="storageDrives.length">

View File

@@ -38,6 +38,7 @@ export class EmbassyPage {
}
async getDrives () {
this.loading = true
try {
const { disks, reconnect } = await this.apiService.getDrives()
this.storageDrives = disks.filter(d => !d.partitions.map(p => p.logicalname).includes((this.stateService.recoverySource as DiskRecoverySource)?.logicalname))

View File

@@ -27,7 +27,7 @@ export class MockApiService extends ApiService {
await pauseFor(1000)
return {
disks: [],
reconnect: ['yolo'],
reconnect: [],
}
}