blob: db86b573dba952521c6e6e5d115c80976f92dddc [file] [log] [blame]
<!--
~ Copyright 2019-present Open Networking Foundation
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!-- Port partial HTML -->
<div id="ov-roadm-port">
<!--<onos-loading [theme]="'light'" [running]="loadingIconShown"></onos-loading>-->
<div class="tabular-header">
<h2>
Ports for Optical Device {{devId}} ({{tableData.length}} Total)
</h2>
<div class="ctrl-btns">
<div class="refresh" (click)="toggleRefresh()">
<!-- See icon.theme.css for the defintions of the classes active and refresh-->
<onos-icon classes="{{ autoRefresh?'active refresh':'refresh' }}" iconId="refresh" iconSize="42" toolTip="{{ autoRefreshTip }}"></onos-icon>
</div>
<div class="separator"></div>
<div routerLink="/roadm-gui" [queryParams]="{ devId: devId }" routerLinkActive="active">
<onos-icon classes="{{ devId ? 'active-rect':undefined }}" iconId="deviceTable" iconSize="42" toolTip="{{deviceTip}}"></onos-icon>
</div>
<!--<div routerLink="/flow" [queryParams]="{ devId: devId }" routerLinkActive="active">-->
<!--<onos-icon classes="{{ devId ? 'active-rect' :undefined}}" iconId="flowTable" iconSize="42" toolTip="{{ flowTip }}"></onos-icon>-->
<!--</div>-->
<div>
<onos-icon classes="{{ devId ? 'current-view' :undefined}}" iconId="portTable" iconSize="42"></onos-icon>
</div>
</div>
<div class="search">
<input id="searchinput" [(ngModel)]="tableDataFilter.queryStr" type="search" #search placeholder="Search" />
<select [(ngModel)]="tableDataFilter.queryBy">
<option value="" disabled>Search By</option>
<option value="$">All Fields</option>
<option value="id">Port ID</option>
<option value="name">Pkts Received</option>
<option value="type">Pkts Sent</option>
<option value="enabled">Bytes Received</option>
<option value="grid">Bytes Sent</option>
<option value="hasTargetPower">Pkts RX Dropped</option>
</select>
</div>
</div>
<div class="summary-list" onosTableResize>
<div class="table-header">
<table>
<tr>
<td colId="id">Port ID</td>
<td colId="reversePort">Reverse Port</td>
<td colId="name">Name</td>
<td colId="type">Type</td>
<td colId="enabled">Enabled</td>
<td colId="minFreq">Min Freq (THz)</td>
<td colId="maxFreq">Max Freq (THz)</td>
<td colId="grid">Grid (GHz)</td>
<td colId="modulation">Modulation</td>
<td colId="powerRange">Power Range (dBm)</td>
<td colId="currentPower">Current Power (dBm)</td>
<td colId="targetPower">Target Power (dBm)</td>
<td colId="hasTargetPower">Has Target Power</td>
<td colId="serviceState">Service State</td>
</tr>
</table>
</div>
<div class="table-body">
<table>
<tr class="table-body" *ngIf="tableData.length === 0" class="no-data">
<td colspan="9">{{annots.noRowsMsg}}</td>
</tr>
<tr *ngFor="let port of tableData | filter : tableDataFilter" (click)="selectCallback($event, port)" [ngClass]="{selected: port.id === selId, 'data-change': isChanged(port.id)}">
<td>{{port.id}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.reversePort}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.name}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.type}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.enabled}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.type=='OCH'?port.minFreq:""}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.type=='OCH'?port.maxFreq:""}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.type=='OCH'?port.grid:""}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">
<form [formGroup]="modulationForm" (ngSubmit)="submitModulation(devId, port.id)" *ngIf="port.type=='OCH'">
<select [(ngModel)]="port.modulation" formControlName="newModulation">
<option value="dp_qpsk">qpsk</option>
<option value="dp_16qam">16qam</option>
</select>
<button type="submit">Submit</button>
</form>
</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.powerRange}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.currentPower | number: '1.2-2'}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">
<form [formGroup]="powerForm" (ngSubmit)="submitPower(devId, port.id)" *ngIf="port.type=='OCH'">
<input type="number" step="any" style="width:50px" value="{{port.targetPower | number: '1.2-2'}}" formControlName="newPower" required>
<button type="submit">Submit</button>
</form>
</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.hasTargetPower}}</td>
<td [ngClass]="(isDelta() ? 'delta' : '')">{{port.serviceState}}</td>
</tr>
</table>
</div>
</div>
</div>