GUI -- Buttons added to topo and device views that navigate to new flows table view.
Change-Id: Ibea4415d3c1fc717e609aebcd2205d0bba01c96d
diff --git a/web/gui/src/main/webapp/app/fw/nav/nav.js b/web/gui/src/main/webapp/app/fw/nav/nav.js
index ad85d90..36ef599 100644
--- a/web/gui/src/main/webapp/app/fw/nav/nav.js
+++ b/web/gui/src/main/webapp/app/fw/nav/nav.js
@@ -21,7 +21,7 @@
'use strict';
// injected dependencies
- var $log;
+ var $log, $location, $window, fs;
// internal state
var navShown = false;
@@ -52,9 +52,29 @@
return false;
}
+ function navTo(path, params) {
+ var url;
+ if (!path) {
+ $log.warn('Not a valid navigation path');
+ return null;
+ }
+ $location.url('/' + path);
+
+ if (fs.isO(params)) {
+ $location.search(params);
+ } else if (params !== undefined) {
+ $log.warn('Query params not an object', params);
+ }
+
+ url = $location.absUrl();
+ $log.log('Navigating to ', url);
+ $window.location.href = url;
+ }
+
angular.module('onosNav', [])
- .controller('NavCtrl', [
- '$log', function (_$log_) {
+ .controller('NavCtrl', ['$log',
+
+ function (_$log_) {
var self = this;
$log = _$log_;
@@ -62,15 +82,22 @@
$log.log('NavCtrl has been created');
}
])
- .factory('NavService', ['$log', function (_$log_) {
- $log = _$log_;
+ .factory('NavService',
+ ['$log', '$location', '$window', 'FnService',
- return {
- showNav: showNav,
- hideNav: hideNav,
- toggleNav: toggleNav,
- hideIfShown: hideIfShown
- };
+ function (_$log_, _$location_, _$window_, _fs_) {
+ $log = _$log_;
+ $location = _$location_;
+ $window = _$window_;
+ fs = _fs_;
+
+ return {
+ showNav: showNav,
+ hideNav: hideNav,
+ toggleNav: toggleNav,
+ hideIfShown: hideIfShown,
+ navTo: navTo
+ };
}]);
}());
diff --git a/web/gui/src/main/webapp/app/fw/widget/tooltip.js b/web/gui/src/main/webapp/app/fw/widget/tooltip.js
index 163a01d..d08393c 100644
--- a/web/gui/src/main/webapp/app/fw/widget/tooltip.js
+++ b/web/gui/src/main/webapp/app/fw/widget/tooltip.js
@@ -22,11 +22,11 @@
'use strict';
// injected references
- var $log, $timeout, fs;
+ var $log, fs;
// constants
var hoverHeight = 35,
- hoverDelay = 500,
+ hoverDelay = 100,
exitDelay = 100;
// internal state
@@ -104,19 +104,23 @@
}
}
- angular.module('onosWidget')
- .factory('TooltipService', ['$log', '$timeout', 'FnService',
+ function resetTooltip() {
+ tooltip.style('display', 'none').text('');
+ }
- function (_$log_, _$timeout_, _fs_) {
+ angular.module('onosWidget')
+ .factory('TooltipService', ['$log', 'FnService',
+
+ function (_$log_, _fs_) {
$log = _$log_;
- $timeout = _$timeout_;
fs = _fs_;
init();
return {
showTooltip: showTooltip,
- cancelTooltip: cancelTooltip
+ cancelTooltip: cancelTooltip,
+ resetTooltip: resetTooltip
};
}]);
}());