File
Implements
Index
Properties
|
|
Methods
|
|
Inputs
|
|
Outputs
|
|
device
|
Type : IManagedObject
|
deviceSoftwareChanges
|
Type : DeviceSoftwareChange[]
|
deviceSoftwareChangesInProgress
|
Type : boolean
|
deviceSoftwareChangesOperation
|
Type : IOperation
|
Methods
attachVersions
|
attachVersions(softwareList: IManagedObject[])
|
Parameters :
Name |
Type |
Optional |
softwareList |
IManagedObject[]
|
No
|
Returns : {}
|
displaySoftwareSelectModal
|
displaySoftwareSelectModal(initialStateOverrides)
|
Parameters :
Name |
Optional |
initialStateOverrides |
No
|
Returns : { resultEmitter: any; choiceEmitter: any; updateInstallableList$: any; }
|
getInstallableSoftwareListWithVersions$
|
getInstallableSoftwareListWithVersions$(searchTerm$: BehaviorSubject)
|
Parameters :
Name |
Type |
Optional |
searchTerm$ |
BehaviorSubject<FilterCriteria>
|
No
|
|
getSingleSoftwareWithVersions$
|
getSingleSoftwareWithVersions$(software: DeviceSoftware)
|
|
installSoftware
|
installSoftware()
|
|
ngOnDestroy
|
ngOnDestroy()
|
|
removeSoftware
|
removeSoftware(softwareToRemove)
|
Parameters :
Name |
Optional |
softwareToRemove |
No
|
|
updateSoftware
|
updateSoftware(softwareToUpdate)
|
Parameters :
Name |
Optional |
softwareToUpdate |
No
|
|
alreadyInstalledMessage
|
Default value : gettext(
'{{ name }} (v. {{ version }}) is already installed on this device'
)
|
alreadyInstalledWarningTemplate
|
Type : TemplateRef<any>
|
Decorators :
@ViewChild('alreadyInstalledWarning', {static: true})
|
filterCriteria$
|
Type : Observable<FilterCriteria>
|
loadingTemplate
|
Type : TemplateRef<any>
|
Decorators :
@ViewChild('loading', {static: true})
|
PRODUCT_EXPERIENCE
|
Default value : PRODUCT_EXPERIENCE
|
showFilter
|
Type : boolean
|
Default value : false
|
softwareTypeFilter$
|
Type : BehaviorSubject<string>
|
Default value : new BehaviorSubject('')
|
softwareTypeTemplate
|
Type : TemplateRef<any>
|
Decorators :
@ViewChild('softwareType', {static: true})
|
supportsSoftwareOperations
|
Type : boolean
|
Default value : false
|
textFilter$
|
Type : BehaviorSubject<string>
|
Default value : new BehaviorSubject('')
|
<div class="d-flex d-col flex-grow">
<div class="card-header large-padding separator sticky-top">
<div class="card-title" translate>Installed software</div>
</div>
<div class="flex-grow">
<fieldset
id="operation-block"
*ngIf="deviceSoftwareChangesOperation"
class="card-block large-padding bg-level-2 p-0"
>
<c8y-operation-details [operation]="deviceSoftwareChangesOperation"></c8y-operation-details>
</fieldset>
<fieldset class="card-block large-padding overflow-visible separator-bottom" *ngIf="showFilter">
<div class="row">
<div class="col-xs-6">
<div class="input-group input-group-search">
<label for="filter" class="sr-only">
{{ 'Filter installed software…' | translate }}
</label>
<input
class="form-control"
type="search"
title="{{ 'Filter installed software…' | translate }}"
id="filter"
placeholder="{{ 'Filter installed software…' | translate }}"
[ngModel]="textFilter$ | async"
(ngModelChange)="textFilter$.next($event)"
/>
<span class="input-group-addon">
<i c8yIcon="search" *ngIf="(textFilter$ | async).length === 0"></i>
<i
class="text-muted"
c8yIcon="times"
*ngIf="(textFilter$ | async).length > 0"
(click)="textFilter$.next('')"
></i>
</span>
<span for="filter" class="sr-only" translate>Filter installed software…</span>
</div>
</div>
<div class="col-xs-6">
<c8y-software-type
[required]="false"
[emitResultsOnly]="true"
[showBtnInNotFoundMessage]="false"
[allowFreeEntries]="false"
[placeholder]="'Filter by software type…' | translate"
[showClearSelectionOption]="true"
(onSelectSoftware)="softwareTypeFilter$.next($event?.softwareType)"
></c8y-software-type>
</div>
</div>
</fieldset>
<fieldset
id="software-list"
class="flex-grow inner-scroll"
[disabled]="deviceSoftwareChangesInProgress"
>
<!-- NOT EMPTY STATE -->
<c8y-device-software-list
[device]="device"
[filterCriteria$]="filterCriteria$"
[softwareList]="softwareList"
[deviceSoftwareChanges]="deviceSoftwareChanges"
(update)="updateSoftware($event)"
(remove)="removeSoftware($event)"
(onListEmpty)="showFilter = !$event"
class="d-block p-l-16 p-r-16"
container="body"
>
<!-- EMPTY STATE -->
<div class="c8y-empty-state text-center">
<div class="h1 c8y-icon c8y-icon-tools c8y-icon-duocolor"></div>
<p>
<strong translate>No software installed.</strong>
<br />
<small translate>Click below to install software into this device.</small>
</p>
</div>
<!-- NO SEARCH RESULTS STATE -->
<div class="c8y-empty-state c8y-no-results-state text-center">
<div class="h1 c8y-icon c8y-icon-tools c8y-icon-duocolor"></div>
<p>
<strong translate>No software matches your filter criteria.</strong>
<br />
<small translate>Try changing your search criteria.</small>
</p>
</div>
</c8y-device-software-list>
</fieldset>
</div>
<!-- INSTALL SOFTWARE-->
<div
class="card-footer large-padding separator sticky-bottom d-flex j-c-between bg-level-0"
[ngClass]="{ 'visible-sm visible-xs': !supportsSoftwareOperations }"
>
<button
*ngIf="supportsSoftwareOperations"
class="btn btn-default"
title="{{ 'Install software' | translate }}"
(click)="installSoftware()"
[disabled]="deviceSoftwareChangesInProgress"
c8yProductExperience
[actionName]="PRODUCT_EXPERIENCE.SOFTWARE.EVENTS.DEVICE_TAB"
[actionData]="{
component: PRODUCT_EXPERIENCE.SOFTWARE.COMPONENTS.DEVICE_SOFTWARE_LIST,
action: PRODUCT_EXPERIENCE.SOFTWARE.ACTIONS.OPEN_INSTALL_SOFTWARE
}"
>
<i c8yIcon="plus-circle"></i>
{{ 'Install software' | translate }}
</button>
<button
(click)="showSoftwareChanges.emit()"
class="btn btn-clean text-primary visible-sm visible-xs"
[title]="'Show "Software changes"' | translate"
>
<span translate>Show "Software changes"</span>
<i c8yIcon="chevron-right"></i>
</button>
</div>
</div>
<ng-template #alreadyInstalledWarning let-item let-option="option">
<i
c8yIcon="warning"
class="text-warning a-s-center"
[tooltip]="
alreadyInstalledMessage
| translate: { name: item.body[0].value, version: option.body[0].value }
"
></i>
</ng-template>
<ng-template #loading>
<div class="p-relative d-flex m-l-auto">
<i class="icon-spin" c8yIcon="circle-o-notch"></i>
</div>
</ng-template>
<ng-template #softwareType>
<c8y-software-type
additionalFilter
[required]="false"
[placeholder]="'Filter by software type…' | translate"
(onSelectSoftware)="search({ softwareType: $event?.softwareType })"
[emitResultsOnly]="true"
[showBtnInNotFoundMessage]="false"
[allowFreeEntries]="false"
[showClearSelectionOption]="true"
></c8y-software-type>
</ng-template>