ecosystem/application-plugins/install-plugin.component.ts
OnInit
selector | c8y-install-plugin |
templateUrl | ./install-plugin.component.html |
Properties |
Methods |
Inputs |
constructor(bsModalRef: BsModalRef, modal: ModalService, ecosystemService: EcosystemService)
|
||||||||||||
Parameters :
|
plugins$ |
Type : BehaviorSubject<ApplicationPlugin[]>
|
cancel |
cancel()
|
Returns :
void
|
install |
install()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
filteredPlugins$ |
Type : Observable<ApplicationPlugin[]>
|
Default value : new BehaviorSubject([])
|
filterTerm$ |
Type : BehaviorSubject<string>
|
Default value : new BehaviorSubject('')
|
onlyLatestPluginVersion |
Default value : true
|
result |
Type : Promise<ApplicationPlugin[]>
|
Default value : new Promise((resolve, reject) => {
this._install = resolve;
this._cancel = reject;
})
|
selectedPlugins |
Type : ApplicationPlugin[]
|
Default value : []
|
<div class="viewport-modal">
<div class="modal-header dialog-header">
<i [c8yIcon]="'plugin'"></i>
<div id="modal-title" class="modal-title h4" translate>Available plugins</div>
</div>
<div class="p-t-8 p-16 text-center separator-bottom flex-no-shrink">
<p class="text-medium m-b-8" translate>Select the compatible plugins to install</p>
<label class="c8y-switch">
<input type="checkbox" [(ngModel)]="onlyLatestPluginVersion" />
<span></span>
<span translate>Only latest version of plugins</span>
</label>
<c8y-filter (onSearch)="this.filterTerm$.next($event)"></c8y-filter>
</div>
<div class="modal-inner-scroll" id="modal-body">
<c8y-plugin-list
(selectedItems)="selectedPlugins = $event"
[emptyListText]="'No plugins available' | translate"
[plugins$]="filteredPlugins$ | onlyLatestPluginVersion: !onlyLatestPluginVersion"
[selectable]="true"
class="m-t-16"
></c8y-plugin-list>
</div>
<div class="modal-footer">
<button
(click)="cancel()"
class="btn btn-default"
title="{{ 'Cancel' | translate }}"
data-cy="install-plugin--cancel-button"
type="button"
>
{{ 'Cancel' | translate }}
</button>
<button
(click)="install()"
[disabled]="selectedPlugins.length === 0"
class="btn btn-primary"
title="{{ 'Install' | translate }}"
data-cy="install-plugin--install-button"
type="button"
>
{{ 'Install' | translate }}
<span class="badge" *ngIf="selectedPlugins.length as length">{{ length }}</span>
</button>
</div>
</div>