ONOS-1783 - GUI -- Refresh buttons for tabular views added. Minor table.js refactor.

Change-Id: Iee6c65fa8477b367e40a556c3c820ca454601a5f
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.css b/web/gui/src/main/webapp/app/view/intent/intent.css
index 4aac0bb..4f9ea8a 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.css
+++ b/web/gui/src/main/webapp/app/view/intent/intent.css
@@ -18,6 +18,14 @@
  ONOS GUI -- Intent View -- CSS file
  */
 
+#ov-intent h2 {
+    display: inline-block;
+}
+
+#ov-intent div.ctrl-btns {
+    width: 45px;
+}
+
 .light #ov-intent tr:nth-child(6n + 2),
 .light #ov-intent tr:nth-child(6n + 3),
 .light #ov-intent tr:nth-child(6n + 4) {
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 cc48a7c..09c7f2b 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.html
+++ b/web/gui/src/main/webapp/app/view/intent/intent.html
@@ -18,6 +18,11 @@
 <div id="ov-intent">
     <div class="tabular-header">
         <h2>Intents ({{ctrl.tableData.length}} total)</h2>
+        <div class="ctrl-btns">
+            <div class="refresh active"
+                 icon icon-size="36" icon-id="crown"
+                 ng-click="refresh()"></div>
+        </div>
     </div>
     <table class="summary-list"
            onos-fixed-header
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.js b/web/gui/src/main/webapp/app/view/intent/intent.js
index 16f9fb8..4e23aec 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.js
+++ b/web/gui/src/main/webapp/app/view/intent/intent.js
@@ -23,15 +23,21 @@
 
     angular.module('ovIntent', [])
         .controller('OvIntentCtrl',
-        ['$log', '$scope', 'TableBuilderService',
+        ['$log', '$scope', 'TableService', 'TableBuilderService',
 
-            function ($log, $scope, tbs) {
+            function ($log, $scope, ts, tbs) {
                 tbs.buildTable({
                     self: this,
                     scope: $scope,
                     tag: 'intent'
                 });
 
+                $scope.refresh = function () {
+                    $log.debug('Refreshing intents page');
+                    ts.resetSortIcons();
+                    $scope.sortCallback();
+                };
+
                 $log.log('OvIntentCtrl has been created');
             }]);
 }());