protocol-lpwan/lpwan-set-connections.component.ts
selector | set-lns-connections |
templateUrl | ./lpwan-set-connections.component.html |
Properties |
Methods |
|
Inputs |
constructor(lpwanService: LpwanSetDeviceProtocolService, alertService: AlertService)
|
|||||||||
Parameters :
|
device |
Type : IManagedObject
|
deviceReregister |
deviceReregister()
|
Returns :
any
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
Async reload |
reload()
|
Returns :
any
|
setConnectionPipe | ||||||
setConnectionPipe(filterStr: string)
|
||||||
Parameters :
Returns :
void
|
togglePopover | ||||
togglePopover(popoverCfrm)
|
||||
Parameters :
Returns :
void
|
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>