mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
refactor(app-show): refactor component (#961)
* refactor(app-show): refactor component * chore: remove precommit hook for the time being * chore: fix mutation by spreading Co-authored-by: Drew Ansbacher <drew.ansbacher@spiredigital.com>
This commit is contained in:
committed by
Aiden McClelland
parent
dbc159c82e
commit
5e681aa3fb
@@ -0,0 +1,38 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
||||
import {
|
||||
InstallProgress,
|
||||
PackageDataEntry,
|
||||
} from 'src/app/services/patch-db/data-model'
|
||||
import { ProgressData } from 'src/app/util/package-loading-progress'
|
||||
|
||||
@Component({
|
||||
selector: 'app-show-progress',
|
||||
templateUrl: './app-show-progress.component.html',
|
||||
styleUrls: ['./app-show-progress.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AppShowProgressComponent {
|
||||
@Input()
|
||||
pkg: PackageDataEntry
|
||||
|
||||
@Input()
|
||||
installProgress: ProgressData
|
||||
|
||||
get unpackingBuffer(): number {
|
||||
return this.installProgress.validateProgress === 100 &&
|
||||
!this.installProgress.unpackProgress
|
||||
? 0
|
||||
: 1
|
||||
}
|
||||
|
||||
get validationBuffer(): number {
|
||||
return this.installProgress.downloadProgress === 100 &&
|
||||
!this.installProgress.validateProgress
|
||||
? 0
|
||||
: 1
|
||||
}
|
||||
|
||||
getColor(action: keyof InstallProgress): string {
|
||||
return this.pkg['install-progress'][action] ? 'success' : 'secondary'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user