Steven Burrows
Committed by Gerrit Code Review

Used the onosAuth global variable to get the username rather than the websocket service.

Change-Id: I9a13733635d526ad68e03691186247b91b7b2301
...@@ -77,26 +77,101 @@ html[data-platform='iPad'] #mast { ...@@ -77,26 +77,101 @@ html[data-platform='iPad'] #mast {
77 77
78 #mast-right { 78 #mast-right {
79 display: inline-block; 79 display: inline-block;
80 - padding-top: 8px;
81 - padding-right: 16px;
82 float: right; 80 float: right;
83 - /*border: 1px solid red;*/ 81 + position: relative;
82 + top: -4px;
83 + padding-right: 15px;
84 + line-height: 44px;
84 } 85 }
85 86
86 -#mast-right a { 87 +.light #mast-right a {
87 - font-size: 12pt; 88 + color: #369;
88 - font-style: normal; 89 +}
89 - font-weight: bold; 90 +
91 +.dark #mast-right a {
92 + color: #eee;
93 +}
94 +
95 +.light #mast nav {
96 + color: #369;
97 +}
98 +
99 +.dark #mast nav {
100 + color: #eee;
101 +}
102 +
103 +/*
104 + MAST HEAD DROPDOWN MENU
105 +*/
106 +
107 +#mast .dropdown-parent {
108 + position: relative;
109 +}
110 +
111 +#mast .dropdown-parent i.dropdown-icon {
112 + display: inline-block;
113 + height: 7px;
114 + width: 9px;
115 + margin-left: 10px;
116 + background: url('/onos/ui/data/img/dropdown-icon.png') no-repeat;
117 +}
118 +
119 +#mast .dropdown {
120 + position: absolute;
121 + top: 44px;
122 + right: 0;
123 + display: none;
124 + min-width: 100px;
125 + border-top: 1px solid #999;
126 + line-height: 16px;
127 + z-index: 1000;
128 +}
129 +
130 +#mast .dropdown a {
90 text-decoration: none; 131 text-decoration: none;
132 + font-size: 14px;
133 + display: block;
134 + padding: 8px 16px 6px 12px;
91 } 135 }
92 136
93 -.light #mast-right a { 137 +#mast .dropdown-parent:hover .dropdown {
138 + display: block;
139 +}
140 +
141 +#mast .dropdown-parent:hover i.dropdown-icon {
142 + background-position-x: -14px
143 +}
144 +
145 +html[data-platform='iPad'] #mast .dropdown {
146 + top: 57px;
147 +}
148 +
149 +/* Theme styles for drop down menu */
150 +
151 +.light #mast .dropdown {
152 + background-color: #bbb;
153 + box-shadow: 0 2px 8px #777;
154 +}
155 +
156 +.dark #mast .dropdown {
157 + background-color: #444;
158 + box-shadow: 0 2px 8px #111;
159 +}
160 +
161 +.light #mast .dropdown a {
94 color: #369; 162 color: #369;
163 + border-bottom: solid #ccc 1px;
95 } 164 }
96 -.dark #mast-right a { 165 +
166 +.dark #mast .dropdown a {
97 color: #eee; 167 color: #eee;
168 + border-bottom: solid #333 1px;
98 } 169 }
99 170
100 -#mast-right a:hover { 171 +.light #mast .dropdown a:hover {
101 - color: #CE5650; 172 + background-color: #ddd;
173 +}
174 +
175 +.dark #mast .dropdown a:hover {
176 + background-color: #777;
102 } 177 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -3,4 +3,16 @@ ...@@ -3,4 +3,16 @@
3 ng-click="mastCtrl.toggleNav()"></div> 3 ng-click="mastCtrl.toggleNav()"></div>
4 <img class="logo" src="data/img/onos-logo.png"> 4 <img class="logo" src="data/img/onos-logo.png">
5 <span class="title">Open Network Operating System</span> 5 <span class="title">Open Network Operating System</span>
6 -<div id="mast-right"><a href="rs/logout">logout</a></div> 6 +<div id="mast-right">
7 +
8 + <nav>
9 + <div class="dropdown-parent">
10 + <a class="user-menu__name">{{user}} <i class="dropdown-icon"></i></a>
11 +
12 + <div class="dropdown">
13 + <a href="rs/logout">Logout</a>
14 + </div>
15 + </div>
16 + </nav>
17 +
18 +</div>
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
33 }; 33 };
34 34
35 angular.module('onosMast', ['onosNav']) 35 angular.module('onosMast', ['onosNav'])
36 - .controller('MastCtrl', ['$log', '$window', 'NavService', 36 + .controller('MastCtrl', ['$log', '$scope', '$window', 'WebSocketService', 'NavService',
37 - 'DialogService', 'WebSocketService', 37 + 'DialogService',
38 38
39 - function (_$log_, $window, ns, ds, wss) { 39 + function (_$log_, $scope, $window, wss, ns, ds) {
40 var self = this; 40 var self = this;
41 41
42 $log = _$log_; 42 $log = _$log_;
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
79 ns.toggleNav(); 79 ns.toggleNav();
80 }; 80 };
81 81
82 + $scope.user = onosAuth || '(no one)';
83 +
82 $log.log('MastCtrl has been created'); 84 $log.log('MastCtrl has been created');
83 }]) 85 }])
84 86
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
57 } 57 }
58 }; 58 };
59 59
60 +
60 // ========================== 61 // ==========================
61 // === Web socket callbacks 62 // === Web socket callbacks
62 63
......