repository/software/device-tab/software-device-tab.component.ts
selector | c8y-software-device-tab |
templateUrl | software-device-tab.component.html |
Properties |
Methods |
|
constructor(route: ActivatedRoute, repository: RepositoryService, inventory: InventoryService, advancedSoftwareService: AdvancedSoftwareService)
|
|||||||||||||||
Parameters :
|
addChanges | ||||||
addChanges(requestedChanges: DeviceSoftwareChange[])
|
||||||
Parameters :
Returns :
void
|
Async applyChanges |
applyChanges()
|
Returns :
any
|
areSameChanges | |||||||||
areSameChanges(change1: DeviceSoftwareChange, change2: DeviceSoftwareChange)
|
|||||||||
Parameters :
Returns :
boolean
|
clearChanges |
clearChanges()
|
Returns :
void
|
dropChange | ||||||
dropChange(changeToBeDropped: DeviceSoftwareChange)
|
||||||
Parameters :
Returns :
void
|
Async loadDevice |
loadDevice()
|
Returns :
any
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
changes$ |
Default value : new BehaviorSubject<DeviceSoftwareChange[]>([])
|
changesInProgress$ |
Type : Observable<boolean>
|
Default value : this.changesOperation$.pipe(
map(operation => this.isInProgress(operation))
)
|
changesOperation$ |
Default value : new BehaviorSubject<IOperation>(null)
|
device$ |
Default value : new BehaviorSubject<IManagedObject>(this.route.snapshot.parent.data.contextData)
|
deviceId |
Type : string | number
|
Default value : this.route.snapshot.parent.data.contextData.id
|
list$ |
Type : Observable<DeviceSoftware[]>
|
Default value : this.device$.pipe(
distinctUntilKeyChanged('id'),
switchMap(device =>
this.advancedSoftwareService
.isASMAvailable()
.then(isASMAvailable => ({ isASMAvailable, device }))
),
map(({ isASMAvailable, device }) =>
// with ASM available software items will be retrieved directly in the
// device-software-list component
isASMAvailable ? undefined : this.repository.getDeviceSoftwareList(device)
)
)
|
reloading |
Type : boolean
|
Default value : false
|
showSoftwareChanges |
Type : boolean
|
Default value : false
|
<c8y-action-bar-item [placement]="'right'">
<button class="btn btn-link" title="{{ 'Reload' | translate }}" (click)="loadDevice()">
<i c8yIcon="refresh" [ngClass]="{ 'icon-spin': reloading }"></i>
{{ 'Reload' | translate }}
</button>
</c8y-action-bar-item>
<div class="card split-view--7-5 m-b-0">
<c8y-installed-software
class="split-view__list"
[device]="device$ | async"
[typesQuery]="typesQuery$ | async"
[softwareList]="list$ | async"
[deviceSoftwareChanges]="changes$ | async"
[deviceSoftwareChangesOperation]="changesOperation$ | async"
[deviceSoftwareChangesInProgress]="changesInProgress$ | async"
(changes)="addChanges($event)"
(showSoftwareChanges)="showSoftwareChanges = true"
></c8y-installed-software>
<c8y-device-software-changes
class="bg-gray-white split-view__detail"
[ngClass]="{ 'split-view__detail--selected': showSoftwareChanges }"
[changes]="changes$ | async"
[changesInProgress]="changesInProgress$ | async"
(clear)="clearChanges()"
(drop)="dropChange($event)"
(apply)="applyChanges()"
(hideSoftwareChanges)="showSoftwareChanges = false"
></c8y-device-software-changes>
</div>