[ONOS-3526]Web UI - Provide a 'Navigate to help page' link or button
Change-Id: I5260e625bb8890b31606dc31b43d4df84bd7eaf4
diff --git a/web/gui/src/main/webapp/app/fw/mast/mast.css b/web/gui/src/main/webapp/app/fw/mast/mast.css
index 4b8131e..3470f18 100644
--- a/web/gui/src/main/webapp/app/fw/mast/mast.css
+++ b/web/gui/src/main/webapp/app/fw/mast/mast.css
@@ -52,13 +52,18 @@
line-height: 44px;
}
-
/*
MAST HEAD DROPDOWN MENU
*/
+#mast-right div.ctrl-btns {
+ position: relative;
+ float: right;
+}
+
#mast .dropdown-parent {
position: relative;
+ float: right;
}
#mast .dropdown-parent i.dropdown-icon {
diff --git a/web/gui/src/main/webapp/app/fw/mast/mast.html b/web/gui/src/main/webapp/app/fw/mast/mast.html
index ddcc048..592f0c8 100644
--- a/web/gui/src/main/webapp/app/fw/mast/mast.html
+++ b/web/gui/src/main/webapp/app/fw/mast/mast.html
@@ -3,15 +3,19 @@
ng-click="mastCtrl.toggleNav()"></div>
<img class="logo" src="data/img/masthead-logo-mojo.png">
<div id="mast-right">
-
<nav>
<div class="dropdown-parent">
<a class="clickable user-menu__name">{{user}} <i class="dropdown-icon"></i></a>
-
<div class="dropdown">
<a href="rs/logout">logout</a>
</div>
</div>
+ <div class="ctrl-btns">
+ <div class="active clickable"
+ icon icon-size="42" icon-id="query"
+ tooltip tt-msg="helpTip"
+ ng-click="directTo()"></div>
+ </div>
</nav>
</div>
diff --git a/web/gui/src/main/webapp/app/fw/mast/mast.js b/web/gui/src/main/webapp/app/fw/mast/mast.js
index d43987d..4d8b5fa 100644
--- a/web/gui/src/main/webapp/app/fw/mast/mast.js
+++ b/web/gui/src/main/webapp/app/fw/mast/mast.js
@@ -33,10 +33,10 @@
angular.module('onosMast', ['onosNav'])
.controller('MastCtrl',
- ['$log', '$scope', '$window', 'WebSocketService', 'NavService',
+ ['$log', '$scope', '$location', '$window', 'WebSocketService', 'NavService',
'DialogService',
- function ($log, $scope, $window, wss, ns, ds) {
+ function ($log, $scope, $location, $window, wss, ns, ds) {
var self = this;
function triggerRefresh(action) {
@@ -86,6 +86,14 @@
// onosAuth is a global set via the index.html generated source
$scope.user = onosAuth || '(no one)';
+ $scope.helpTip = 'Show help page for current view';
+
+ $scope.directTo = function () {
+ var curId = $location.path().replace('/', ''),
+ viewMap = $scope.onos['viewMap'],
+ helpUrl = viewMap[curId];
+ $window.open(helpUrl);
+ };
$log.log('MastCtrl has been created');
}])