Bri Prebilic Cole

GUI -- Refresh button has been moved to TableBuilderService to be part of every …

…tabular view automatically.

Change-Id: I2de0ae9161573a2c44320dcd07111938a89ba5e2
......@@ -21,7 +21,7 @@
'use strict';
// injected refs
var $log, fs, wss;
var $log, fs, wss, ts;
// example params to buildTable:
// {
......@@ -61,6 +61,12 @@
}
o.scope.selectCallback = selCb;
function refresh() {
$log.debug('Refreshing ' + root + ' page');
ts.resetSortIcons();
sortCb();
}
o.scope.refresh = refresh;
handlers[resp] = respCb;
wss.bindHandlers(handlers);
......@@ -75,12 +81,13 @@
angular.module('onosWidget')
.factory('TableBuilderService',
['$log', 'FnService', 'WebSocketService',
['$log', 'FnService', 'WebSocketService', 'TableService',
function (_$log_, _fs_, _wss_) {
function (_$log_, _fs_, _wss_, _ts_) {
$log = _$log_;
fs = _fs_;
wss = _wss_;
ts = _ts_;
return {
buildTable: buildTable
......
......@@ -25,9 +25,9 @@
angular.module('ovApp', [])
.controller('OvAppCtrl',
['$log', '$scope', 'TableService', 'TableBuilderService', 'WebSocketService',
['$log', '$scope', 'TableBuilderService', 'WebSocketService',
function ($log, $scope, ts, tbs, wss) {
function ($log, $scope, tbs, wss) {
function selCb($event, row) {
selRow = angular.element($event.currentTarget);
selection = row;
......@@ -45,12 +45,6 @@
document.getElementById('file').dispatchEvent(evt);
});
$scope.refresh = function () {
$log.debug('Refreshing application page');
ts.resetSortIcons();
$scope.sortCallback();
};
document.getElementById('app-form-response').onload = function () {
document.getElementById('app-form').reset();
$scope.refresh();
......
......@@ -23,20 +23,14 @@
angular.module('ovCluster', [])
.controller('OvClusterCtrl',
['$log', '$scope', 'TableService', 'TableBuilderService',
['$log', '$scope', 'TableBuilderService',
function ($log, $scope, ts, tbs) {
function ($log, $scope, tbs) {
tbs.buildTable({
scope: $scope,
tag: 'cluster'
});
$scope.refresh = function () {
$log.debug('Refreshing cluster nodes page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvClusterCtrl has been created');
}]);
}());
......
......@@ -222,12 +222,12 @@
angular.module('ovDevice', [])
.controller('OvDeviceCtrl',
['$log', '$scope', 'TableService', 'TableBuilderService', 'FnService',
['$log', '$scope', 'TableBuilderService', 'FnService',
'MastService', 'PanelService', 'WebSocketService', 'IconService',
'ButtonService', 'NavService', 'TooltipService',
function (_$log_, _$scope_,
ts, tbs, _fs_, _mast_, _ps_, _wss_, _is_, _bns_, _ns_, _ttip_) {
tbs, _fs_, _mast_, _ps_, _wss_, _is_, _bns_, _ns_, _ttip_) {
$log = _$log_;
$scope = _$scope_;
fs = _fs_;
......@@ -260,12 +260,6 @@
tag: 'device',
selCb: selCb
});
$scope.refresh = function () {
$log.debug('Refreshing devices page');
ts.resetSortIcons();
$scope.sortCallback();
};
createDetailsPane();
// details panel handlers
......
......@@ -22,20 +22,19 @@
'use strict';
// injected references
var $log, $scope, $location, fs, ts, tbs;
var $log, $scope, $location, fs, tbs;
angular.module('ovFlow', [])
.controller('OvFlowCtrl',
['$log', '$scope', '$location',
'FnService', 'TableService', 'TableBuilderService',
'FnService', 'TableBuilderService',
function (_$log_, _$scope_, _$location_, _fs_, _ts_, _tbs_) {
function (_$log_, _$scope_, _$location_, _fs_, _tbs_) {
var params;
$log = _$log_;
$scope = _$scope_;
$location = _$location_;
fs = _fs_;
ts = _ts_;
tbs = _tbs_;
params = $location.search();
......@@ -49,12 +48,6 @@
query: params
});
$scope.refresh = function () {
$log.debug('Refreshing flows page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvFlowCtrl has been created');
}]);
}());
......
......@@ -22,20 +22,19 @@
'use strict';
// injected references
var $log, $scope, $location, fs, ts, tbs;
var $log, $scope, $location, fs, tbs;
angular.module('ovGroup', [])
.controller('OvGroupCtrl',
['$log', '$scope', '$location',
'FnService', 'TableService', 'TableBuilderService',
'FnService', 'TableBuilderService',
function (_$log_, _$scope_, _$location_, _fs_, _ts_, _tbs_) {
function (_$log_, _$scope_, _$location_, _fs_, _tbs_) {
var params;
$log = _$log_;
$scope = _$scope_;
$location = _$location_;
fs = _fs_;
ts = _ts_;
tbs = _tbs_;
params = $location.search();
......@@ -49,12 +48,6 @@
query: params
});
$scope.refresh = function () {
$log.debug('Refreshing groups page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvGroupCtrl has been created');
}]);
}());
......
......@@ -23,20 +23,14 @@
angular.module('ovHost', [])
.controller('OvHostCtrl',
['$log', '$scope', 'TableService', 'TableBuilderService',
['$log', '$scope', 'TableBuilderService',
function ($log, $scope, ts, tbs) {
function ($log, $scope, tbs) {
tbs.buildTable({
scope: $scope,
tag: 'host'
});
$scope.refresh = function () {
$log.debug('Refreshing hosts page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvHostCtrl has been created');
}]);
}());
......
......@@ -23,20 +23,14 @@
angular.module('ovIntent', [])
.controller('OvIntentCtrl',
['$log', '$scope', 'TableService', 'TableBuilderService',
['$log', '$scope', 'TableBuilderService',
function ($log, $scope, ts, tbs) {
function ($log, $scope, tbs) {
tbs.buildTable({
scope: $scope,
tag: 'intent'
});
$scope.refresh = function () {
$log.debug('Refreshing intents page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvIntentCtrl has been created');
}]);
}());
......
......@@ -23,20 +23,14 @@
angular.module('ovLink', [])
.controller('OvLinkCtrl',
['$log', '$scope', 'TableService', 'TableBuilderService',
['$log', '$scope', 'TableBuilderService',
function ($log, $scope, ts, tbs) {
function ($log, $scope, tbs) {
tbs.buildTable({
scope: $scope,
tag: 'link'
});
$scope.refresh = function () {
$log.debug('Refreshing links page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvLinkCtrl has been created');
}]);
}());
......
......@@ -22,20 +22,18 @@
'use strict';
// injected references
var $log, $scope, $location, fs, ts, tbs;
var $log, $scope, $location, fs, tbs;
angular.module('ovPort', [])
.controller('OvPortCtrl',
['$log', '$scope', '$location',
'FnService', 'TableService', 'TableBuilderService',
['$log', '$scope', '$location', 'FnService', 'TableBuilderService',
function (_$log_, _$scope_, _$location_, _fs_, _ts_, _tbs_) {
function (_$log_, _$scope_, _$location_, _fs_, _tbs_) {
var params;
$log = _$log_;
$scope = _$scope_;
$location = _$location_;
fs = _fs_;
ts = _ts_;
tbs = _tbs_;
params = $location.search();
......@@ -49,12 +47,6 @@
query: params
});
$scope.refresh = function () {
$log.debug('Refreshing ports page');
ts.resetSortIcons();
$scope.sortCallback();
};
$log.log('OvPortCtrl has been created');
}]);
}());
......