ecosystem/application-plugins/plugin-list.component.ts
selector | c8y-plugin-list |
templateUrl | ./plugin-list.component.html |
Properties |
Methods |
|
Inputs |
Outputs |
constructor(ecosystemService: EcosystemService, bsModalService: BsModalService, pluginsService: PluginsService, alertService: AlertService, translateService: TranslateService, gainsightService: GainsightService, humanizeAppNamePipe: HumanizeAppNamePipe)
|
||||||||||||||||||||||||
Parameters :
|
emptyListText |
Type : string
|
Default value : ''
|
hideSource |
Type : boolean
|
Default value : false
|
installable |
Type : boolean
|
Default value : false
|
Shows the install button for each plugin separately. Currently used in package-details view. |
package |
Type : IApplication
|
plugins$ |
Type : Observable<ApplicationPlugin[]>
|
selectable |
Type : boolean
|
selectedItems |
Type : EventEmitter<ApplicationPlugin[]>
|
Async installPlugin | ||||||
installPlugin(plugin: ApplicationPlugin)
|
||||||
Parameters :
Returns :
any
|
Async uninstallPlugin | ||||||
uninstallPlugin(plugin: ApplicationPlugin)
|
||||||
Parameters :
Returns :
any
|
updateSelectedItems | |||||||||
updateSelectedItems(selected: boolean, plugin: ApplicationPlugin)
|
|||||||||
Parameters :
Returns :
void
|
appsDisabled |
Type : Set<>
|
Default value : new Set<IApplication['id']>()
|
CURRENT_LOCATION |
Default value : location.href
|
remotePlugins$ |
Type : BehaviorSubject<ApplicationRemotePlugins>
|
Default value : new BehaviorSubject({})
|
selectedPlugins |
Type : literal type
|
Default value : {}
|
updatingPluginId |
Type : Record<UpdateType | string>
|
Default value : { install: '', uninstall: '' }
|
<c8y-list-group class="bg-inherit">
<ng-container *ngIf="(plugins$ | async)?.length !== 0; else emptyList">
<ng-container *ngFor="let plugin of plugins$ | async">
<c8y-li [ngClass]="{ disabled: plugin.installed }" class="bg-inherit">
<c8y-plugin-list-item
(isItemSelected)="updateSelectedItems($event, plugin)"
[plugin]="plugin"
[selectable]="selectable"
[hideSource]="hideSource"
class="d-flex"
></c8y-plugin-list-item>
<div class="p-l-40 m-t-4">
<button
*ngIf="installable"
(click)="uninstallPlugin(plugin)"
[ngClass]="{ 'btn-pending': plugin.id === updatingPluginId.uninstall }"
[disabled]="updatingPluginId.uninstall && plugin.id !== updatingPluginId.uninstall"
class="btn btn-danger btn-sm m-l-4"
title="{{ 'Uninstall plugin' | translate }}"
data-cy="plugin-list--uninstall-plugin-button"
translate
>
Uninstall plugin
</button>
<button
*ngIf="installable"
(click)="installPlugin(plugin)"
[ngClass]="{ 'btn-pending': plugin.id === updatingPluginId.install }"
[disabled]="updatingPluginId.install && plugin.id !== updatingPluginId.install"
class="btn btn-default btn-sm m-l-8"
title="{{ 'Install plugin' | translate }}"
data-cy="plugin-list--install-plugin-button"
translate
>
Install plugin
</button>
</div>
</c8y-li>
</ng-container>
</ng-container>
</c8y-list-group>
<ng-template #emptyList>
<div class="c8y-empty-state text-left" *ngIf="emptyListText">
<h1 c8yIcon="plugin"></h1>
<p>
{{ emptyListText | translate }}
</p>
</div>
</ng-template>