File

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

Implements

OnInit

Metadata

selector set-device-protocol
templateUrl ./lpwan-set-device-protocol.component.html

Index

Properties
Methods

Constructor

constructor(lpwanService: LpwanSetDeviceProtocolService, alertService: AlertService, router: Router, inventoryService: InventoryService)
Parameters :
Name Type Optional
lpwanService LpwanSetDeviceProtocolService No
alertService AlertService No
router Router No
inventoryService InventoryService No

Methods

Async apply
apply(selectedProtocol)
Parameters :
Name Optional
selectedProtocol No
Returns : any
Async loadDevice
loadDevice()
Returns : any
Async ngOnInit
ngOnInit()
Returns : any
Async refreshCache
refreshCache()
Returns : any
Async reload
reload()
Returns : any

Properties

availableProtocols
availableProtocols: IResultList<IManagedObject>
Type : IResultList<IManagedObject>
currentProtocol
currentProtocol: IManagedObject
Type : IManagedObject
device
device: IManagedObject
Type : IManagedObject
filterCurrentProtocol
filterCurrentProtocol:
Default value : pipe( map((protocols: IManagedObject[]) => protocols.filter(protocol => !this.currentProtocol || this.currentProtocol.id !== protocol.id) ) )
loading
loading: boolean
Type : boolean
lpwanSetDeviceProtocolForm
lpwanSetDeviceProtocolForm: any
Type : any
Decorators :
@ViewChild('lpwanSetDeviceProtocolForm', {static: undefined})
newProtocol
newProtocol: IManagedObject
Type : IManagedObject
<form #lpwanSetDeviceProtocolForm="ngForm" class="row">
  <div class="col-md-6">
    <div class="card">
      <div class="card-header separator">
        <h4 class="card-title">
          {{ 'LPWAN device protocol' | translate }}
        </h4>
      </div>
      <div *ngIf="loading" class="card-block">
        <div class="p-relative" style="min-height: 40px; min-width: 55px;">
          <div class="spinner">
            <div class="rect1"></div>
            <div class="rect2"></div>
            <div class="rect3"></div>
            <div class="rect4"></div>
          </div>
        </div>
        <span translate>Loading</span>
      </div>
      <div *ngIf="!loading">
        <div class="card-block">
          <div class="form-group">
            <label translate>Current device protocol</label>
            <p class="form-control-static" *ngIf="!currentProtocol">
              {{ device.type }}
            </p>
            <p class="form-control-static" *ngIf="currentProtocol">
              {{ currentProtocol.name }}
            </p>
          </div>
          <div class="form-group">
            <label translate>New device protocol</label>
            <div class="c8y-select-wrapper">
              <select class="form-control" [(ngModel)]="newProtocol" name="newProtocol" required>
                <option *ngIf="!newProtocol" [ngValue]="null">
                  {{ 'Select device protocol' | translate }}
                </option>
                <option
                  *c8yFor="let protocol of availableProtocols; pipe: filterCurrentProtocol"
                  [ngValue]="protocol"
                >
                  {{ protocol.name }}
                </option>
              </select>
            </div>
          </div>
        </div>
        <div class="card-footer separator">
          <button
            title="{{ 'Apply' | translate }}"
            class="btn btn-primary"
            (click)="apply(newProtocol)"
            [disabled]="!lpwanSetDeviceProtocolForm.dirty"
          >
            {{ 'Apply' | translate }}
          </button>
        </div>
      </div>
    </div>
  </div>
</form>
‌

result-matching ""

    No results matching ""