File

protocol-opcua/opcua-auto-apply-settings.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Accessors

Constructor

constructor(inventoryService: InventoryService)
Parameters :
Name Type Optional
inventoryService InventoryService No

Inputs

model
Type : IManagedObject

Methods

add
add()
Returns : void
filterItems
filterItems(filterText)
Parameters :
Name Optional
filterText No
Returns : void
isChecked
isChecked(item)
Parameters :
Name Optional
item No
Returns : any
Async ngOnInit
ngOnInit()
Returns : any
onChangeNodeId
onChangeNodeId(event)
Parameters :
Name Optional
event No
Returns : void
onChangeShowBrowsePath
onChangeShowBrowsePath(event)
Parameters :
Name Optional
event No
Returns : void
onChangeShowServerFragment
onChangeShowServerFragment(event)
Parameters :
Name Optional
event No
Returns : void
onChangeShowServerIds
onChangeShowServerIds(event)
Parameters :
Name Optional
event No
Returns : void
onSelect
onSelect(selected, item)
Parameters :
Name Optional
selected No
item No
Returns : void
remove
remove(index)
Parameters :
Name Optional
index No
Returns : void
serverIdsSelected
serverIdsSelected(items: IManagedObject[])
Parameters :
Name Type Optional
items IManagedObject[] No
Returns : void
trackByFn
trackByFn(index: any, item: any)
Parameters :
Name Type Optional
index any No
item any No
Returns : any
updateConstraints
updateConstraints(items)
Parameters :
Name Optional
items No
Returns : void

Properties

checked
Type : object
Default value : {}
constraints
Type : AutoApplyConstraints
Default value : { browsePathMatchesRegex: '', matchesNodeIds: [], serverObjectHasFragment: '', matchesServerIds: [] }
filteredList
Type : IManagedObject[]
Default value : []
opcuaServers
Type : IManagedObject[]
Default value : []
placeholderSelectServerIds
Type : string
Default value : gettext('Select server IDs from list')
selectedItems
Type : IManagedObject[]
Default value : []
showBrowsePath
Type : boolean
showRootNodes
Type : boolean
showServerFragment
Type : boolean
showServerIds
Type : boolean
Readonly sizeToShowFilter
Type : number
Default value : 5
updateSelectedItem
Type : EventEmitter<boolean>
Default value : new EventEmitter()

Accessors

model
getmodel()
setmodel(model)
Parameters :
Name Optional
model No
Returns : void
<div class="row">
  <div class="col-md-4">
    <p translate>
      Specifying auto-apply constraints allows you to limit the scope where the device protocols are
      applied, for example by specifying a set of possible servers or node IDs.
    </p>
    <p translate>
      If no constraints are set, device protocols are applied at any fitting location on the OPC UA
      server.
    </p>
  </div>

  <div class="col-md-6">
    <ul class="list-group" style="box-shadow: none;">
      <!-- Limit device type to a set of servers -->
      <li class="list-group-item">
        <label
          title="{{ 'Limit device protocol to a set of servers' | translate }}"
          class="c8y-checkbox"
        >
          <input
            type="checkbox"
            [checked]="
              constraints.matchesServerIds !== null && constraints.matchesServerIds.length > 0
            "
            (change)="onChangeShowServerIds($event)"
          />
          <span></span>
          <span class="m-l-8">
            {{ 'Limit device protocol to a set of servers' | translate }}
          </span>
        </label>
        <div
          class="collapse"
          [collapse]="
            (!showServerIds &&
              (constraints.matchesServerIds !== null && constraints.matchesServerIds.length < 1)) ||
            (!showServerIds && constraints.matchesServerIds === null)
          "
        >
          <c8y-form-group>
            <c8y-select
              [items]="opcuaServers"
              [selected]="selectedItems"
              [placeholder]="placeholderSelectServerIds"
              (onChange)="serverIdsSelected($event)"
              [updateItems]="updateSelectedItem"
            >
            
              <c8y-li *ngIf="opcuaServers.length > sizeToShowFilter" class="sticky-top">
                <c8y-filter [icon]="'search'"  (onSearch)="filterItems($event)"></c8y-filter>
              </c8y-li>
              <c8y-li *ngIf="filteredList && filteredList.length === 0">
                <c8y-li-body> 
                  <div class="c8y-empty-state text-left">
                  <p>{{ 'No items to display.' | translate }}</p>
                </div>
                </c8y-li-body>
              </c8y-li>
              <c8y-li *ngFor="let item of filteredList">
                <c8y-li-checkbox
                  [selected]="isChecked(item)"
                  (onSelect)="onSelect($event, item)"
                ></c8y-li-checkbox>
                <c8y-li-body>{{ item.name | translate }}<br>
                  <span class="text-label-small m-r-4" translate>ID</span> <small>{{ item.id }}</small>
                </c8y-li-body>
              </c8y-li>
            </c8y-select>
          </c8y-form-group>
        </div>
      </li>
      <!-- Limit device type scope in the address space -->
      <li class="list-group-item">
        <label
          title="{{ 'Limit device protocol scope in the address space' | translate }}"
          class="c8y-checkbox"
        >
          <input
            type="checkbox"
            [checked]="
              constraints.browsePathMatchesRegex !== null &&
              constraints.browsePathMatchesRegex.length > 0
            "
            (change)="onChangeShowBrowsePath($event)"
          />
          <span></span>
          <span class="m-l-8">
            {{ 'Limit device protocol scope in the address space' | translate }}
          </span>
        </label>
        <div
          class="collapse"
          [isAnimated]="true"
          [collapse]="
            (!showBrowsePath &&
              constraints.browsePathMatchesRegex !== null &&
              constraints.browsePathMatchesRegex.length < 1) ||
            (!showBrowsePath && constraints.browsePathMatchesRegex === null)
          "
        >
          <c8y-form-group class="m-t-8 m-b-8">
            <input
              name="browsePath"
              type="text"
              class="form-control"
              placeholder="{{ 'e.g.' | translate }} /objects/devices/.*"
              [(ngModel)]="constraints.browsePathMatchesRegex"
              ngDefaultControl
            />
          </c8y-form-group>
        </div>
      </li>
      <!-- Limit device type to servers with a certain fragment-->
      <li class="list-group-item">
        <label
          title="{{ 'Limit device protocol to servers with a certain fragment' | translate }}"
          class="c8y-checkbox"
        >
          <input
            type="checkbox"
            [checked]="constraints.serverObjectHasFragment !== null && constraints.serverObjectHasFragment.length > 0"
            (change)="onChangeShowServerFragment($event)"
          />
          <span></span>
          <span class="m-l-8">
            {{ 'Limit device protocol to servers with a certain fragment' | translate }}
          </span>
        </label>
        <div
          class="collapse"
          [isAnimated]="true"
          [collapse]="(!showServerFragment && constraints.serverObjectHasFragment !== null && constraints.serverObjectHasFragment.length < 1) || (!showServerFragment && constraints.serverObjectHasFragment === null)"
        >
          <c8y-form-group class="m-t-8 m-b-8">
            <input
              name="serverFragment"
              type="text"
              class="form-control"
              placeholder="{{ 'e.g.' | translate }} c8y_SomeServerMarker"
              [(ngModel)]="constraints.serverObjectHasFragment"
              ngDefaultControl
            />
          </c8y-form-group>
        </div>
      </li>
      <!-- Limit device type to a specific root node ID -->
      <li class="list-group-item">
        <label
          title="{{ 'Limit device protocol to specific root nodes ID' | translate }}"
          class="c8y-checkbox"
        >
          <input
            type="checkbox"
            [checked]="constraints.matchesNodeIds !== null && constraints.matchesNodeIds.length > 0"
            (change)="onChangeNodeId($event)"
          />
          <span></span>
          <span class="m-l-8">
            {{ 'Limit device protocol to specific root nodes ID' | translate }}
          </span>
        </label>
        <div
          class="collapse"
          [isAnimated]="true"
          [collapse]="(!showRootNodes && constraints.matchesNodeIds !== null && constraints.matchesNodeIds.length < 1) || ( !showRootNodes && constraints.matchesNodeIds === null)"
        >
            <ul c8yInputGroupListContainer class="list-unstyled p-t-16">
              <li
                class="m-b-8"
                *ngFor="let item of constraints.matchesNodeIds; let i = index; trackBy: trackByFn"
              >
                <c8y-input-group-list [index]="i" (onAdd)="add()" (onRemove)="remove($event)">
                  <c8y-form-group class="form-group--tooltip-validation">
                    <input
                      type="text"
                      class="form-control"
                      placeholder="{{ 'e.g.' | translate }} nodeId"
                      [(ngModel)]="constraints.matchesNodeIds[i]"
                      [required]="true"
                    />
                  </c8y-form-group>
                </c8y-input-group-list>
              </li>
            </ul> 
        </div>
      </li>
    </ul>
  </div>
</div>

results matching ""

    No results matching ""