sub-assets/assign-devices/assign-devices.component.ts
selector | c8y-assign-devices |
templateUrl | ./assign-devices.component.html |
Properties |
Methods |
Inputs |
Outputs |
HostListeners |
constructor(alert: AlertService, subAssetsService: SubAssetsService, inventoryService: InventoryService)
|
||||||||||||
Parameters :
|
currentGroupId
|
Type : |
refresh
|
Type :
Default value : |
onCancel
|
$event Type: EventEmitter
|
onShowChildDevices
|
$event Type: EventEmitter
|
selectedDevice
|
$event Type: EventEmitter
|
document:keydown.enter |
Arguments : '$event'
|
document:keydown.enter(event: KeyboardEvent)
|
document:keydown.escape |
Arguments : '$event'
|
document:keydown.escape(event: KeyboardEvent)
|
Async assignDevices |
assignDevices()
|
Returns :
any
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
onSelected | ||||||
onSelected(selectedDevicesIDs: string[])
|
||||||
Parameters :
Returns :
void
|
selectChildren | ||||||
selectChildren(asset: IManagedObject)
|
||||||
Parameters :
Returns :
void
|
setActionControls | ||||||
setActionControls(showChildren: boolean)
|
||||||
Parameters :
Returns :
void
|
setNotIncludedInGroupQuery |
setNotIncludedInGroupQuery()
|
Returns :
void
|
actionControls |
actionControls:
|
Type : ActionControl[]
|
Default value : []
|
baseQuery |
baseQuery:
|
Type : any
|
canAssignDevice |
canAssignDevice:
|
Type : boolean
|
Default value : false
|
deviceQueryStringOutput |
deviceQueryStringOutput:
|
Type : string
|
Readonly isSelectable |
isSelectable:
|
Default value : true
|
pagination |
pagination:
|
Type : Pagination
|
Default value : { pageSize: 20, currentPage: 1 }
|
pendingStatus |
pendingStatus:
|
Type : boolean
|
Default value : false
|
selected |
selected:
|
Type : string[]
|
Default value : []
|
<div class="card-block flex-no-shrink separator-bottom col-xs-12 large-padding p-t-24 p-b-24">
<div class="row">
<div class="col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
<h4 class="text-center text-medium">
{{ 'Assign devices' | translate }}
</h4>
</div>
</div>
</div>
<c8y-device-grid
[title]="'Select target devices' | translate"
[actionControls]="actionControls"
[infiniteScroll]="'auto'"
[selectable]="isSelectable"
[pagination]="pagination"
(itemsSelect)="onSelected($event)"
[refresh]="refresh"
[baseQuery]="baseQuery"
(onChildDevices)="setActionControls($event)"
[showChildDevices]="{ show: true, value: false }"
class="flex-grow col-xs-12 no-gutter"
>
<div class="c8y-empty-state">
<h1 c8yIcon="search"></h1>
<div>
<p>
<strong>{{ 'No matching devices.' | translate }}</strong>
</p>
<small>{{ 'Refine your search terms' | translate }}</small>
</div>
</div>
</c8y-device-grid>
<div class="text-center card-footer p-24 separator">
<button
(click)="onCancel.emit()"
type="button"
class="btn btn-default"
title="{{ 'Cancel' | translate }}"
>
<span>{{ 'Cancel' | translate }}</span>
</button>
<button
(click)="assignDevices()"
type="button"
class="btn btn-primary"
[ngClass]="{ 'btn-pending': pendingStatus }"
title="{{ 'Assign' | translate }}"
[disabled]="selected.length === 0 || !canAssignDevice"
>
<span>{{ 'Assign' | translate }}</span>
</button>
</div>