services/services-device-tab/services-device-tab.component.ts
selector | c8y-services-device-tab |
templateUrl | services-device-tab.component.html |
Properties |
Methods |
constructor(route: ActivatedRoute, inventoryService: InventoryService, gridService: DeviceGridService, statusOptionsService: StatusOptionsService)
|
|||||||||||||||
Parameters :
|
Async onDataSourceModifier | ||||||
onDataSourceModifier(dataSourceModifier: DataSourceModifier)
|
||||||
Parameters :
Returns :
Promise<ServerSideDataResult>
|
trackByName | |||||||||
trackByName(_index, column: DeviceGridColumn)
|
|||||||||
Parameters :
Returns :
string
|
columns |
Type : DeviceGridColumn[]
|
Default value : [
new StatusGridColumn(this.statusOptionsService),
new ServiceNameGridColumn(),
new ServiceTypeGridColumn(),
new LastUpdatedDateGridColumn()
]
|
deviceId |
Type : string | number
|
Default value : this.route.snapshot.parent.data.contextData.id
|
pagination |
Type : object
|
Default value : {
pageSize: 50,
currentPage: 1
}
|
refresh$ |
Type : EventEmitter<void>
|
Default value : new EventEmitter()
|
serverSideDataCallback |
Type : any
|
sizeRequest |
Type : Promise<number>
|
sizeRequestDone |
Default value : false
|
<div class="content-fullpage">
<c8y-data-grid
[title]="'Services' | translate"
[refresh]="refresh$"
[actionControls]="[]"
[pagination]="pagination"
[columns]="columns"
[infiniteScroll]="'auto'"
[serverSideDataCallback]="serverSideDataCallback"
>
<div class="c8y-empty-state">
<ng-container *ngIf="!sizeRequestDone">
<c8y-loading></c8y-loading>
</ng-container>
<ng-container *ngIf="sizeRequestDone">
<ng-container *ngIf="(sizeRequest | async) === 0; else noResults">
<div class="text-center">
<h1 class="c8y-icon-duocolor" c8yIcon="c8y-tools"></h1>
<h3 translate>No services to display.</h3>
</div>
</ng-container>
<ng-template #noResults>
<h1 c8yIcon="search"></h1>
<div>
<p>
<strong>{{ 'No results to display.' | translate }}</strong>
</p>
<small>{{ 'Refine your search terms or check your spelling.' | translate }}</small>
</div>
</ng-template>
</ng-container>
</div>
<ng-container *ngFor="let column of columns; trackBy: trackByName">
<c8y-column [name]="column.name"></c8y-column>
</ng-container>
</c8y-data-grid>
</div>