GUI -- WIP - VeilService
Change-Id: I56ff07f712e43f404e5ef5b8da2ba8cfa62102ff
Showing
3 changed files
with
127 additions
and
1 deletions
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/* | ||
| 18 | + ONOS GUI -- Veil Service -- CSS file | ||
| 19 | + */ | ||
| 20 | + | ||
| 21 | +#veil { | ||
| 22 | + z-index: 5000; | ||
| 23 | + display: none; | ||
| 24 | + position: absolute; | ||
| 25 | + top: 0; | ||
| 26 | + left: 0; | ||
| 27 | + padding: 60px; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +.light #veil { | ||
| 31 | + background-color: rgba(0,0,0,0.75); | ||
| 32 | +} | ||
| 33 | +.dark #veil { | ||
| 34 | + background-color: rgba(255,255,255,0.5); | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +#veil p { | ||
| 38 | + display: block; | ||
| 39 | + margin: 8px 20px; | ||
| 40 | + font-size: 14pt; | ||
| 41 | + font-style: italic; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +.light #veil p { | ||
| 45 | + color: #ddd; | ||
| 46 | +} | ||
| 47 | +.dark #veil p { | ||
| 48 | + color: #404040; | ||
| 49 | +} |
web/gui/src/main/webapp/app/fw/layer/veil.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/* | ||
| 18 | + ONOS GUI -- Layer -- Veil Service | ||
| 19 | + | ||
| 20 | + Provides a mechanism to display an overlaying div with information. | ||
| 21 | + Used mainly for web socket connection interruption. | ||
| 22 | + */ | ||
| 23 | +(function () { | ||
| 24 | + 'use strict'; | ||
| 25 | + | ||
| 26 | + // injected references | ||
| 27 | + var $log, fs; | ||
| 28 | + | ||
| 29 | + var veil, svg; | ||
| 30 | + | ||
| 31 | + function show(msg) { | ||
| 32 | + veil.selectAll('p').remove(); | ||
| 33 | + | ||
| 34 | + //veil.data(msg).enter().append('p').text(function (d) { return d; }); | ||
| 35 | + | ||
| 36 | + msg.forEach(function (line) { | ||
| 37 | + veil.insert('p').text(line); | ||
| 38 | + }); | ||
| 39 | + | ||
| 40 | + veil.style('display', 'block'); | ||
| 41 | + | ||
| 42 | + // TODO: disable key bindings | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + function hide() { | ||
| 46 | + veil.style('display', 'none'); | ||
| 47 | + // TODO: re-enable key bindings | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + angular.module('onosLayer') | ||
| 51 | + .factory('VeilService', ['$log', 'FnService', 'GlyphService', | ||
| 52 | + function (_$log_, _fs_, gs) { | ||
| 53 | + $log = _$log_; | ||
| 54 | + fs = _fs_; | ||
| 55 | + | ||
| 56 | + veil = d3.select('#veil'); | ||
| 57 | + | ||
| 58 | + svg = veil.append('svg').attr({ | ||
| 59 | + width: 500, | ||
| 60 | + height: 500, | ||
| 61 | + viewBox: '0 0 500 500' | ||
| 62 | + }); | ||
| 63 | + | ||
| 64 | + gs.addGlyph(svg, 'bird', 400); | ||
| 65 | + | ||
| 66 | + return { | ||
| 67 | + show: show, | ||
| 68 | + hide: hide | ||
| 69 | + }; | ||
| 70 | + }]); | ||
| 71 | + | ||
| 72 | +}()); |
| ... | @@ -61,6 +61,7 @@ | ... | @@ -61,6 +61,7 @@ |
| 61 | <script src="fw/layer/layer.js"></script> | 61 | <script src="fw/layer/layer.js"></script> |
| 62 | <script src="fw/layer/panel.js"></script> | 62 | <script src="fw/layer/panel.js"></script> |
| 63 | <script src="fw/layer/flash.js"></script> | 63 | <script src="fw/layer/flash.js"></script> |
| 64 | + <script src="fw/layer/veil.js"></script> | ||
| 64 | 65 | ||
| 65 | <!-- Framework and library stylesheets included here --> | 66 | <!-- Framework and library stylesheets included here --> |
| 66 | <!-- TODO: use a single catenated-minified file here --> | 67 | <!-- TODO: use a single catenated-minified file here --> |
| ... | @@ -71,6 +72,7 @@ | ... | @@ -71,6 +72,7 @@ |
| 71 | <link rel="stylesheet" href="fw/svg/icon.css"> | 72 | <link rel="stylesheet" href="fw/svg/icon.css"> |
| 72 | <link rel="stylesheet" href="fw/layer/panel.css"> | 73 | <link rel="stylesheet" href="fw/layer/panel.css"> |
| 73 | <link rel="stylesheet" href="fw/layer/flash.css"> | 74 | <link rel="stylesheet" href="fw/layer/flash.css"> |
| 75 | + <link rel="stylesheet" href="fw/layer/veil.css"> | ||
| 74 | <link rel="stylesheet" href="fw/nav/nav.css"> | 76 | <link rel="stylesheet" href="fw/nav/nav.css"> |
| 75 | 77 | ||
| 76 | <!-- This is where contributed javascript will get injected --> | 78 | <!-- This is where contributed javascript will get injected --> |
| ... | @@ -107,7 +109,10 @@ | ... | @@ -107,7 +109,10 @@ |
| 107 | <div id="alerts"></div> | 109 | <div id="alerts"></div> |
| 108 | <div id="flash"></div> | 110 | <div id="flash"></div> |
| 109 | <div id="quickhelp"></div> | 111 | <div id="quickhelp"></div> |
| 110 | - <div id="deathmask"></div> | 112 | + <div id="veil" |
| 113 | + resize | ||
| 114 | + ng-style="resizeWithOffset(0, 0)" | ||
| 115 | + ></div> | ||
| 111 | </div> | 116 | </div> |
| 112 | </body> | 117 | </body> |
| 113 | </html> | 118 | </html> | ... | ... |
-
Please register or login to post a comment