File

sub-assets/assign-devices/assign-devices.component.ts

Metadata

selector c8y-assign-devices
templateUrl ./assign-devices.component.html

Index

Properties
Methods
Inputs
Outputs
HostListeners

Constructor

constructor(alert: AlertService, subAssetsService: SubAssetsService, inventoryService: InventoryService)
Parameters :
Name Type Optional
alert AlertService No
subAssetsService SubAssetsService No
inventoryService InventoryService No

Inputs

currentGroupId

Type : string

refresh

Type : EventEmitter

Default value : new EventEmitter<any>()

Outputs

onCancel $event Type: EventEmitter
onShowChildDevices $event Type: EventEmitter
selectedDevice $event Type: EventEmitter

HostListeners

document:keydown.enter
Arguments : '$event'
document:keydown.enter(event: KeyboardEvent)
document:keydown.escape
Arguments : '$event'
document:keydown.escape(event: KeyboardEvent)

Methods

Async assignDevices
assignDevices()
Returns : any
Async ngOnInit
ngOnInit()
Returns : any
onSelected
onSelected(selectedDevicesIDs: string[])
Parameters :
Name Type Optional
selectedDevicesIDs string[] No
Returns : void
selectChildren
selectChildren(asset: IManagedObject)
Parameters :
Name Type Optional
asset IManagedObject No
Returns : void
setActionControls
setActionControls(showChildren: boolean)
Parameters :
Name Type Optional
showChildren boolean No
Returns : void
setNotIncludedInGroupQuery
setNotIncludedInGroupQuery()
Returns : void

Properties

actionControls
actionControls: ActionControl[]
Type : ActionControl[]
Default value : []
baseQuery
baseQuery: any
Type : any
canAssignDevice
canAssignDevice: boolean
Type : boolean
Default value : false
deviceQueryStringOutput
deviceQueryStringOutput: string
Type : string
Readonly isSelectable
isSelectable:
Default value : true
pagination
pagination: Pagination
Type : Pagination
Default value : { pageSize: 20, currentPage: 1 }
pendingStatus
pendingStatus: boolean
Type : boolean
Default value : false
selected
selected: string[]
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>

result-matching ""

    No results matching ""