mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 04:53: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
8
frontend/projects/shared/src/pipes/guid/guid.module.ts
Normal file
8
frontend/projects/shared/src/pipes/guid/guid.module.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { NgModule } from '@angular/core'
|
||||
import { GuidPipe } from './guid.pipe'
|
||||
|
||||
@NgModule({
|
||||
declarations: [GuidPipe],
|
||||
exports: [GuidPipe],
|
||||
})
|
||||
export class GuidPipePipesModule {}
|
||||
11
frontend/projects/shared/src/pipes/guid/guid.pipe.ts
Normal file
11
frontend/projects/shared/src/pipes/guid/guid.pipe.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import { DiskInfo } from '../../types/api'
|
||||
|
||||
@Pipe({
|
||||
name: 'guid',
|
||||
})
|
||||
export class GuidPipe implements PipeTransform {
|
||||
transform(disk: DiskInfo): string | null {
|
||||
return disk.guid || disk.partitions.find(p => p.guid)?.guid || null
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ export * from './directives/safe-links/safe-links.module'
|
||||
|
||||
export * from './pipes/emver/emver.module'
|
||||
export * from './pipes/emver/emver.pipe'
|
||||
export * from './pipes/guid/guid.module'
|
||||
export * from './pipes/guid/guid.pipe'
|
||||
export * from './pipes/markdown/markdown.module'
|
||||
export * from './pipes/markdown/markdown.pipe'
|
||||
export * from './pipes/shared/shared.module'
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface PartitionInfo {
|
||||
capacity: number
|
||||
used: number | null
|
||||
'embassy-os': EmbassyOSDiskInfo | null
|
||||
guid: string | null
|
||||
}
|
||||
|
||||
export type EmbassyOSDiskInfo = {
|
||||
|
||||
Reference in New Issue
Block a user