operations/bulk-single-operations-list/single-operations-list.component.ts
AfterViewInit
OnChanges
selector | c8y-single-operations-list |
standalone | true |
imports |
StatusFilterModule
NgIf
C8yTranslatePipe
IconDirective
DataGridComponent
EmptyStateComponent
|
templateUrl | ./single-operations-list.component.html |
Properties |
Methods |
Inputs |
Outputs |
constructor(bulkOperationsService: BulkOperationsService)
|
||||||
Parameters :
|
bulkOperation |
Type : Partial<IOperationBulk>
|
readOnly |
Type : boolean
|
Default value : false
|
onRetryFailedOperations |
Type : EventEmitter<Partial<IOperationBulk>>
|
getFilterTypeOfSingleOperations |
getFilterTypeOfSingleOperations()
|
Returns :
any
|
Async ngAfterViewInit |
ngAfterViewInit()
|
Returns :
any
|
ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
Parameters :
Returns :
void
|
Async onDataSourceModifier | ||||||
onDataSourceModifier(dataSourceModifier: DataSourceModifier)
|
||||||
Parameters :
Returns :
Promise<ServerSideDataResult>
|
reload | ||||||
reload(option?: OperationStatusOption[])
|
||||||
Parameters :
Returns :
void
|
retryBulkOperation |
retryBulkOperation()
|
Returns :
void
|
Async retrySingleOperation | ||||
retrySingleOperation(singleOperation)
|
||||
Parameters :
Returns :
any
|
setStatusFilter | ||||||
setStatusFilter(emit)
|
||||||
Parameters :
Returns :
void
|
actions |
Type : ActionControl[]
|
Default value : [
{
type: 'retry',
icon: 'repeat',
label: gettext('Retry operation'),
text: gettext('Retry operation'),
callback: operation => {
this.retrySingleOperation(operation);
},
showIf: operation =>
!this.readOnly &&
operation.status.toString() === OPERATION_STATUS_OPTIONS_MAP.FAILED.status.toString()
}
]
|
columns |
Type : Column[]
|
Default value : [
new OperationStatusGridColumn(),
new DeviceGridColumn(),
new CreationTimeGridColumn(),
new FailureReasonGridColumn()
]
|
dataGrid |
Type : DataGridComponent
|
Decorators :
@ViewChild(DataGridComponent, {static: false})
|
displayOptions |
Type : Partial<DisplayOptions>
|
Default value : {
gridHeader: false
}
|
OPERATION_STATUS |
Type : object
|
Default value : { ...OperationStatus, ALL: gettext('ALL') }
|
OPERATION_STATUS_LABELS |
Default value : OPERATION_STATUS_LABELS
|
OPERATION_STATUS_OPTIONS_MAP |
Type : OperationStatusOptionsMapShared
|
Default value : OPERATION_STATUS_OPTIONS_MAP
|
pagination |
Type : Pagination
|
Default value : {
pageSize: 25,
currentPage: 1
}
|
serverSideDataCallback |
Type : ServerSideDataCallback
|
singleOperations |
Type : IResultList<IOperation>
|
statusFilter |
Type : StatusFilterComponent
|
Decorators :
@ViewChild(StatusFilterComponent, {static: false})
|
<ng-container
*ngIf="
bulkOperation.progress.failed ||
bulkOperation.progress.executing ||
bulkOperation.progress.pending ||
bulkOperation.progress.successful
"
>
<div
class="legend form-block p-t-16 m-b-0"
translate
>
Operations
</div>
<div class="d-flex a-i-center">
<div class="d-flex a-i-center p-b-8">
<span
class="m-r-4 text-medium"
translate
>
Filter by status
</span>
<c8y-status-filter
small
[options]="OPERATION_STATUS_OPTIONS_MAP"
(onFilterChanged)="reload($event)"
></c8y-status-filter>
</div>
<div
class="m-l-auto p-b-8"
*ngIf="!readOnly && bulkOperation.progress.failed > 0"
>
<button
class="btn btn-navbar"
title="{{ 'Retry failed operations' | translate }}"
(click)="retryBulkOperation()"
>
<i
class="m-r-4"
c8yIcon="repeat"
></i>
<span translate>Retry failed operations</span>
</button>
</div>
</div>
<c8y-data-grid
[actionControls]="actions"
[columns]="columns"
[displayOptions]="displayOptions"
[serverSideDataCallback]="serverSideDataCallback"
[pagination]="pagination"
>
<c8y-ui-empty-state
icon="search"
[title]="'No single operations of the selected status to display.' | translate"
[subtitle]="'Single operations will be displayed here' | translate"
horizontal
></c8y-ui-empty-state>
</c8y-data-grid>
</ng-container>