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/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();