File

repository/software/device-tab/software-device-tab.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(route: ActivatedRoute, repository: RepositoryService, inventory: InventoryService, advancedSoftwareService: AdvancedSoftwareService)
Parameters :
Name Type Optional
route ActivatedRoute No
repository RepositoryService No
inventory InventoryService No
advancedSoftwareService AdvancedSoftwareService No

Methods

addChanges
addChanges(requestedChanges: DeviceSoftwareChange[])
Parameters :
Name Type Optional
requestedChanges DeviceSoftwareChange[] No
Returns : void
Async applyChanges
applyChanges()
Returns : any
areSameChanges
areSameChanges(change1: DeviceSoftwareChange, change2: DeviceSoftwareChange)
Parameters :
Name Type Optional
change1 DeviceSoftwareChange No
change2 DeviceSoftwareChange No
Returns : boolean
clearChanges
clearChanges()
Returns : void
dropChange
dropChange(changeToBeDropped: DeviceSoftwareChange)
Parameters :
Name Type Optional
changeToBeDropped DeviceSoftwareChange No
Returns : void
Async loadDevice
loadDevice()
Returns : any
Async ngOnInit
ngOnInit()
Returns : any

Properties

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
typesQuery$
Type : Observable<object>
Default value : this.device$.pipe( map(device => { const deviceTypeQuery = this.repository.getDeviceTypeQuery(RepositoryType.SOFTWARE, device); return this.repository.getSoftwareTypeQuery(device, deviceTypeQuery); }) )
<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>

results matching ""

    No results matching ""