mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Add guid to partition type (#1932)
* add guid to partitions and implement pipe in shared to return guid for any disk * fix bug and clean up
This commit is contained in:
committed by
Aiden McClelland
parent
22b273b145
commit
45a6a930c9
@@ -10,7 +10,7 @@ import {
|
||||
BackupRecoverySource,
|
||||
DiskRecoverySource,
|
||||
} from 'src/app/services/api/api.service'
|
||||
import { DiskInfo, ErrorToastService } from '@start9labs/shared'
|
||||
import { DiskInfo, ErrorToastService, GuidPipe } from '@start9labs/shared'
|
||||
import { StateService } from 'src/app/services/state.service'
|
||||
import { PasswordPage } from '../../modals/password/password.page'
|
||||
import { ActivatedRoute } from '@angular/router'
|
||||
@@ -19,6 +19,7 @@ import { ActivatedRoute } from '@angular/router'
|
||||
selector: 'app-embassy',
|
||||
templateUrl: 'embassy.page.html',
|
||||
styleUrls: ['embassy.page.scss'],
|
||||
providers: [GuidPipe],
|
||||
})
|
||||
export class EmbassyPage {
|
||||
storageDrives: DiskInfo[] = []
|
||||
@@ -32,6 +33,7 @@ export class EmbassyPage {
|
||||
private readonly stateService: StateService,
|
||||
private readonly loadingCtrl: LoadingController,
|
||||
private readonly errorToastService: ErrorToastService,
|
||||
private readonly guidPipe: GuidPipe,
|
||||
private route: ActivatedRoute,
|
||||
) {}
|
||||
|
||||
@@ -71,7 +73,10 @@ export class EmbassyPage {
|
||||
}
|
||||
|
||||
async chooseDrive(drive: DiskInfo) {
|
||||
if (!!drive.partitions.find(p => p.used) || !!drive.guid) {
|
||||
if (
|
||||
this.guidPipe.transform(drive) ||
|
||||
!!drive.partitions.find(p => p.used)
|
||||
) {
|
||||
const alert = await this.alertCtrl.create({
|
||||
header: 'Warning',
|
||||
subHeader: 'Drive contains data!',
|
||||
|
||||
Reference in New Issue
Block a user