GUI -- Table views auto refresh every two seconds while maintaining selected items.
Change-Id: Idbb27cf1977ba5b9410b1d75ce12971195291091
diff --git a/web/gui/src/main/webapp/app/view/app/app.html b/web/gui/src/main/webapp/app/view/app/app.html
index fa072b9..6f27443 100644
--- a/web/gui/src/main/webapp/app/view/app/app.html
+++ b/web/gui/src/main/webapp/app/view/app/app.html
@@ -5,7 +5,7 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
<div class="separator"></div>
<div id="app-install" icon icon-size="36" icon-id="plus" class="active"></div>
<div id="app-activate" icon icon-size="36" icon-id="play"></div>
@@ -25,7 +25,9 @@
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="state" class="table-icon" sortable></td>
@@ -45,9 +47,9 @@
</td>
</tr>
- <tr ng-repeat="app in tableData"
+ <tr ng-repeat="app in tableData track by app.id"
ng-click="selectCallback($event, app)"
- ng-class="{selected: app === sel}"
+ ng-class="{selected: app.id === selId}"
ng-repeat-done>
<td class="table-icon">
<div icon icon-id="{{app._iconid_state}}"></div>
diff --git a/web/gui/src/main/webapp/app/view/cluster/cluster.html b/web/gui/src/main/webapp/app/view/cluster/cluster.html
index 727974e..29c84b0 100644
--- a/web/gui/src/main/webapp/app/view/cluster/cluster.html
+++ b/web/gui/src/main/webapp/app/view/cluster/cluster.html
@@ -21,14 +21,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="_iconid_state" class="table-icon" sortable></td>
diff --git a/web/gui/src/main/webapp/app/view/device/device.html b/web/gui/src/main/webapp/app/view/device/device.html
index 2e0045e..0ff488d 100644
--- a/web/gui/src/main/webapp/app/view/device/device.html
+++ b/web/gui/src/main/webapp/app/view/device/device.html
@@ -5,14 +5,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="available" class="table-icon" sortable></td>
@@ -36,9 +38,9 @@
</td>
</tr>
- <tr ng-repeat="dev in tableData"
+ <tr ng-repeat="dev in tableData track by dev.id"
ng-click="selectCallback($event, dev)"
- ng-class="{selected: dev === sel}"
+ ng-class="{selected: dev.id === selId}"
ng-repeat-done>
<td class="table-icon">
<div icon icon-id="{{dev._iconid_available}}"></div>
diff --git a/web/gui/src/main/webapp/app/view/device/device.js b/web/gui/src/main/webapp/app/view/device/device.js
index 9fbbd8a..4178653 100644
--- a/web/gui/src/main/webapp/app/view/device/device.js
+++ b/web/gui/src/main/webapp/app/view/device/device.js
@@ -242,7 +242,7 @@
function selCb($event, row) {
selRow = angular.element($event.currentTarget);
- if ($scope.sel) {
+ if ($scope.selId) {
wss.sendEvent(detailsReq, { id: row.id });
} else {
detailsPanel.hide();
diff --git a/web/gui/src/main/webapp/app/view/flow/flow.html b/web/gui/src/main/webapp/app/view/flow/flow.html
index 70f73fe..88b15127 100644
--- a/web/gui/src/main/webapp/app/view/flow/flow.html
+++ b/web/gui/src/main/webapp/app/view/flow/flow.html
@@ -8,14 +8,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="id" col-width="180px" sortable>Flow ID </td>
diff --git a/web/gui/src/main/webapp/app/view/group/group.html b/web/gui/src/main/webapp/app/view/group/group.html
index 3bc28c7..e19d6e1 100644
--- a/web/gui/src/main/webapp/app/view/group/group.html
+++ b/web/gui/src/main/webapp/app/view/group/group.html
@@ -24,14 +24,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="id" sortable>Group ID </td>
diff --git a/web/gui/src/main/webapp/app/view/host/host.html b/web/gui/src/main/webapp/app/view/host/host.html
index a4f8c4f..8f83132 100644
--- a/web/gui/src/main/webapp/app/view/host/host.html
+++ b/web/gui/src/main/webapp/app/view/host/host.html
@@ -5,14 +5,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="type" class="table-icon" sortable></td>
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.html b/web/gui/src/main/webapp/app/view/intent/intent.html
index 63dc91a..8096cea 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.html
+++ b/web/gui/src/main/webapp/app/view/intent/intent.html
@@ -21,14 +21,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="appId" sortable>Application ID </td>
diff --git a/web/gui/src/main/webapp/app/view/link/link.html b/web/gui/src/main/webapp/app/view/link/link.html
index e644593..f984c61 100644
--- a/web/gui/src/main/webapp/app/view/link/link.html
+++ b/web/gui/src/main/webapp/app/view/link/link.html
@@ -21,14 +21,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="_iconid_state" class="table-icon" sortable></td>
diff --git a/web/gui/src/main/webapp/app/view/port/port.html b/web/gui/src/main/webapp/app/view/port/port.html
index b8d4322..54611f3 100644
--- a/web/gui/src/main/webapp/app/view/port/port.html
+++ b/web/gui/src/main/webapp/app/view/port/port.html
@@ -24,14 +24,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="id" col-width="60px" sortable>Port ID </td>
diff --git a/web/gui/src/main/webapp/app/view/settings/settings.html b/web/gui/src/main/webapp/app/view/settings/settings.html
index a7fcdce..6e7dba5 100644
--- a/web/gui/src/main/webapp/app/view/settings/settings.html
+++ b/web/gui/src/main/webapp/app/view/settings/settings.html
@@ -5,14 +5,16 @@
<div class="ctrl-btns">
<div class="refresh active"
icon icon-size="36" icon-id="refresh"
- ng-click="refresh()"></div>
+ ng-click="refresh(sortParams)"></div>
</div>
</div>
<div class="summary-list" onos-fixed-header>
<div class="table-header"
- onos-sortable-header sort-callback="sortCallback(requestParams)">
+ onos-sortable-header
+ sort-params="sortParams"
+ sort-callback="sortCallback(sortParams)">
<table>
<tr>
<td colId="component" sortable col-width="400px">Component </td>