ecosystem/application-plugins/application-plugins.component.ts
OnInit
OnDestroy
selector | c8y-app-plugins |
templateUrl | ./application-plugins.component.html |
constructor(activatedRoute: ActivatedRoute, ecosystemService: EcosystemService, bsModalService: BsModalService, pluginsService: PluginsService, alertService: AlertService, gainsightService: GainsightService)
|
|||||||||||||||||||||
Parameters :
|
appId |
Type : string | number
|
Async cleanupOrphanedPlugins | ||||||
cleanupOrphanedPlugins(plugins: ApplicationPlugin[])
|
||||||
Parameters :
Returns :
any
|
getActionControls |
getActionControls()
|
Returns :
ActionControl[]
|
getBulkActionControls |
getBulkActionControls()
|
Returns :
BulkActionControl[]
|
Async installPlugins |
installPlugins()
|
Returns :
any
|
Async loadData |
loadData()
|
Returns :
any
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
refresh |
refresh()
|
Returns :
void
|
Async removePlugins | ||||||
removePlugins(plugins: string[])
|
||||||
Parameters :
Returns :
any
|
Async resetToDefault |
resetToDefault()
|
Returns :
any
|
Async updatePlugin | ||||||||||||||||
updatePlugin(app: IApplication, plugin: ApplicationPlugin, downgrade)
|
||||||||||||||||
Parameters :
Returns :
any
|
actionControls |
Type : ActionControl[]
|
Default value : this.getActionControls()
|
allAvailablePlugins$ |
Type : BehaviorSubject<ApplicationPlugin[]>
|
Default value : new BehaviorSubject([])
|
app |
Type : IApplication
|
bulkActionControls |
Type : BulkActionControl[]
|
Default value : this.getBulkActionControls()
|
columns |
Type : Column[]
|
Default value : [
{
name: 'name',
header: gettext('Plugin name'),
path: 'name',
filterable: true
},
{
name: 'Version',
header: gettext('Version'),
path: 'version',
filterable: false
},
{
name: 'Tag',
header: gettext('Tag`noun`'),
path: 'installedViaTag',
filterable: false,
cellRendererComponent: LabelCellRendererComponent
},
{
name: 'description',
header: gettext('Description'),
path: 'description',
filterable: false,
cellCSSClassName: 'small'
},
{
name: 'contextPath',
header: gettext('Source'),
path: 'contextPath',
filterable: false,
cellRendererComponent: LabelCellRendererComponent
},
{
name: 'scope',
header: gettext('Scope'),
path: 'scope',
filterable: false,
visible: false,
cellRendererComponent: LabelCellRendererComponent
},
{
name: 'status',
header: gettext('Status'),
path: 'status',
filterable: false,
cellRendererComponent: OrphanedStatusCellRendererComponent
}
]
|
CURRENT_LOCATION |
Default value : location.href
|
dataGrid |
Type : DataGridComponent
|
Decorators :
@ViewChild(DataGridComponent, {static: false})
|
displayOptions |
Type : DisplayOptions
|
Default value : {
bordered: false,
striped: true,
filter: true,
gridHeader: true,
hover: true
}
|
headerActionControls |
Type : HeaderActionControl[]
|
Default value : []
|
isLoading |
Type : boolean
|
loadingItemsLabel |
Type : string
|
Default value : gettext('Loading packages…')
|
loadMoreItemsLabel |
Type : string
|
Default value : gettext('Load more packages')
|
noDataMessage |
Default value : gettext('No plugins installed.')
|
noDataSubtitle |
Default value : gettext("This application doesn't have any plugin. Click below to install.")
|
noResultsMessage |
Default value : gettext('No plugins to display.')
|
noResultsSubtitle |
Default value : gettext('Refine your search terms or check your spelling.')
|
orphanedPlugins$ |
Default value : this.installedPlugins$.pipe(
map(plugins => plugins.filter(p => p.status === ApplicationPluginStatus.ORPHANED))
)
|
pagination |
Type : Pagination
|
Default value : {
pageSize: 10,
currentPage: 1
}
|
PRODUCT_EXPERIENCE |
Default value : PRODUCT_EXPERIENCE_ECOSYSTEM
|
remotePlugins$ |
Type : BehaviorSubject<ApplicationRemotePlugins>
|
Default value : new BehaviorSubject({})
|
selfPlugins$ |
Type : BehaviorSubject<ApplicationPlugin[]>
|
Default value : new BehaviorSubject([])
|
title |
Type : string
|
Default value : gettext('Installed plugins')
|
<c8y-title>{{ app | humanizeAppName | async }}</c8y-title>
<c8y-breadcrumb>
<c8y-breadcrumb-item
[icon]="'c8y-atom'"
[label]="'Ecosystem' | translate"
></c8y-breadcrumb-item>
<c8y-breadcrumb-item
[icon]="'c8y-modules'"
[label]="'Applications' | translate"
[path]="'ecosystem/application/applications'"
></c8y-breadcrumb-item>
<c8y-breadcrumb-item [label]="app | humanizeAppName | async"></c8y-breadcrumb-item>
<c8y-breadcrumb-item [label]="'Plugins' | translate"></c8y-breadcrumb-item>
</c8y-breadcrumb>
<c8y-action-bar-item
[placement]="'right'"
*ngIf="!(isStandard$ | async)"
>
<button
class="btn btn-link"
title="{{ 'Reset to default plugins' | translate }}"
[ngClass]="{ 'btn-pending': isLoading }"
(click)="resetToDefault()"
>
<i c8yIcon="undo"></i>
{{ 'Reset to default' | translate }}
</button>
</c8y-action-bar-item>
<c8y-action-bar-item [placement]="'right'">
<button
class="btn btn-link"
title="{{ 'Install plugins' | translate }}"
(click)="installPlugins()"
[ngClass]="{ 'btn-pending': isLoading }"
>
<i c8yIcon="plus-circle"></i>
{{ 'Install plugins' | translate }}
</button>
</c8y-action-bar-item>
<ng-container *ngIf="orphanedPlugins$ | async as orphanedPlugins">
<c8y-action-bar-item
*ngIf="orphanedPlugins?.length"
[placement]="'right'"
>
<button
class="btn btn-link"
title="{{ 'Clean up orphaned plugins' | translate }}"
(click)="cleanupOrphanedPlugins(orphanedPlugins)"
[ngClass]="{ 'btn-pending': isLoading }"
>
<i c8yIcon="erase"></i>
{{ 'Clean up orphaned plugins' | translate }}
</button>
</c8y-action-bar-item>
</ng-container>
<div class="content-fullpage d-flex d-col border-top">
<c8y-data-grid
class="d-contents"
[title]="title"
[loadMoreItemsLabel]="loadMoreItemsLabel"
[loadingItemsLabel]="loadingItemsLabel"
[displayOptions]="displayOptions"
[columns]="columns"
[rows]="installedPlugins$ | async"
[pagination]="pagination"
[selectable]="true"
[actionControls]="actionControls"
[bulkActionControls]="bulkActionControls"
[headerActionControls]="headerActionControls"
(onReload)="refresh()"
>
<c8y-ui-empty-state
[icon]="stats?.size > 0 ? 'search' : 'plugin'"
[title]="stats?.size > 0 ? (noResultsMessage | translate) : (noDataMessage | translate)"
[subtitle]="stats?.size > 0 ? (noResultsSubtitle | translate) : (noDataSubtitle | translate)"
*emptyStateContext="let stats"
[horizontal]="stats?.size > 0"
>
<p *ngIf="stats?.size === 0">
<button
class="btn btn-primary btn-sm"
title="{{ 'Install plugins' | translate }}"
(click)="installPlugins()"
[ngClass]="{ 'btn-pending': isLoading }"
translate
>
Install plugins
</button>
</p>
</c8y-ui-empty-state>
</c8y-data-grid>
</div>