File

protocol-lpwan/lpwan-set-connections.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(lpwanService: LpwanSetDeviceProtocolService, alertService: AlertService)
Parameters :
Name Type Optional
lpwanService LpwanSetDeviceProtocolService No
alertService AlertService No

Inputs

device
Type : IManagedObject

Methods

deviceReregister
deviceReregister()
Returns : any
Async ngOnInit
ngOnInit()
Returns : any
Async reload
reload()
Returns : any
setConnectionPipe
setConnectionPipe(filterStr: string)
Parameters :
Name Type Optional
filterStr string No
Returns : void
togglePopover
togglePopover(popoverCfrm)
Parameters :
Name Optional
popoverCfrm No
Returns : void

Properties

availableConnections
Type : IResultList<ActilityConnection | SigfoxConnection>
buttons
Type : PopoverConfirmButtons[]
Default value : [ { label: gettext('Cancel'), action: () => Promise.reject() }, { label: gettext('Re-register'), action: () => this.deviceReregister(), status: 'default' } ]
currentConnection
Type : ActilityConnection | SigfoxConnection
filterConnection
Default value : pipe()
loading
Type : boolean
newConnection
Type : ActilityConnection | SigfoxConnection
pattern
Type : string
Default value : ''
popoverConfirm
Type : PopoverConfirmComponent
Decorators :
@ViewChild(PopoverConfirmComponent, {static: true})
reRegisterMsg
Default value : gettext('To change provider connection, you need to re-register device first.')
<div class="col-md-6">
  <div class="form-group">
    <label translate>Current connection</label>
    <p class="form-control-static" *ngIf="!currentConnection">
      {{ 'Connection is not set. Select connection for this device' | translate }}
    </p>
    <p class="form-control-static" *ngIf="currentConnection">
      {{ currentConnection.name }}
    </p>
  </div>

  <c8y-form-group>
    <c8y-popover-confirm
      outsideClick="true"
      containerClass="lns-connection-popover"
      [message]="reRegisterMsg"
      [buttons]="buttons"
      [placement]="'bottom'"
    ></c8y-popover-confirm>
    <c8y-typeahead
      *ngIf="!loading"
      [(ngModel)]="newConnection"
      placeholder="{{ 'Select new connection' | translate }}"
      name="newConnection"
      (onSearch)="setConnectionPipe($event)"
      [allowFreeEntries]="false"
    >
      <c8y-li
        *c8yFor="let connection of availableConnections; loadMore: 'hidden'; pipe: filterConnection"
        class="p-l-8 p-r-8 c8y-list__item--link"
        (click)="togglePopover(popoverConfirm)"
      >
        <c8y-highlight [text]="connection.name" [pattern]="pattern"></c8y-highlight>
      </c8y-li>
    </c8y-typeahead>
    <c8y-messages
      ><c8y-message
        name="notExisting"
        [text]="'Select one of the connections.' | translate"
      ></c8y-message>
    </c8y-messages>
  </c8y-form-group>
</div>

results matching ""

    No results matching ""