Bri Prebilic Cole

ONOS-1935 - CORD-GUI -- Nav bar updated, skeleton bundle view created.

Change-Id: Ife6e6775274a35f2941208967665d2ac91f686b7
...@@ -20,14 +20,23 @@ ...@@ -20,14 +20,23 @@
20 list-style-type: none; 20 list-style-type: none;
21 width: 100%; 21 width: 100%;
22 margin-bottom: 2%; 22 margin-bottom: 2%;
23 - padding: 1% 0;
24 } 23 }
25 24
26 .nav li { 25 .nav li {
27 - 26 + background-color: lightgray;
27 + padding: 1% 0;
28 +}
29 +.nav li.selected {
30 + font-weight: bold;
31 + background-color: darkgray;
28 } 32 }
29 33
30 .nav a { 34 .nav a {
31 display: table-cell; 35 display: table-cell;
32 text-align: center; 36 text-align: center;
37 + text-decoration: none;
38 + color: black;
39 +}
40 +.nav a:visited {
41 + color: black;
33 } 42 }
......
1 +<div id="available" ng-controller="CordAvailable as ctrl">
2 + <h2>{{name}}</h2>
3 + <table>
4 + <tr ng-repeat="func in funcs">
5 + <td class="icon">icon of function</td>
6 + <td>{{func.name}}</td>
7 + <td class="desc">{{func.desc}}</td>
8 + </tr>
9 + </table>
10 + <button type="button">Apply</button>
11 +</div>
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 +div#bundle div.main-left {
18 + width: 62%;
19 +}
20 +div#bundle div.main-right {
21 + width: 38%;
22 +}
23 +
24 +#bundle table {
25 + width: 100%;
26 +}
27 +
28 +#bundle td {
29 + text-align: center;
30 +}
31 +#bundle td.icon {
32 + width: 50px;
33 + height: 50px;
34 +}
35 +#bundle td.desc {
36 + width: 50%;
37 + text-align: left;
38 +}
39 +
40 +#available button {
41 + float: right;
42 +}
...\ No newline at end of file ...\ No newline at end of file
1 <!-- Bundle page partial html --> 1 <!-- Bundle page partial html -->
2 -<div class="container"> 2 +<div id="bundle" class="container">
3 <nav></nav> 3 <nav></nav>
4 - <h2>Subscriber Bundles</h2> 4 + <div class="main-left">
5 + <h3>You are subscribed to the</h3>
6 + <h2>{{name}}</h2>
7 + <table>
8 + <tr ng-repeat="func in funcs">
9 + <td class="icon">icon of function</td>
10 + <td>{{func.name}}</td>
11 + <td class="desc">{{func.desc}}</td>
12 + <td>{{func.params.level && "Level: " + func.params.level}}</td>
13 + </tr>
14 + </table>
15 + </div>
16 + <div class="main-right">
17 + <h2>Available Bundles</h2>
18 + <div bundle-available></div>
19 + </div>
5 </div> 20 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17,13 +17,71 @@ ...@@ -17,13 +17,71 @@
17 (function () { 17 (function () {
18 'use strict'; 18 'use strict';
19 19
20 + var $log, $resource;
21 +
22 + var before = 'http://localhost:8080/rs/bundle/0',
23 + after = 'http://localhost:8080/rs/bundle/1';
24 +
25 + var basic = 'Basic Bundle',
26 + family = 'Family Bundle',
27 + current, which,
28 + avScope;
29 +
30 + function getAvailable(scope) {
31 + var AvailableData, resource;
32 +
33 + AvailableData = $resource(which);
34 + resource = AvailableData.get({},
35 + // success
36 + function () {
37 + scope.name = resource.bundle.name;
38 + scope.funcs = resource.bundle.functions;
39 + },
40 + // error
41 + function () {
42 + $log.error('Problem with resource', resource);
43 + });
44 + $log.debug('Resource received:', resource);
45 + }
46 +
20 angular.module('cordBundle', []) 47 angular.module('cordBundle', [])
21 - .controller('CordBundleCtrl', ['$log', '$scope', 48 + .controller('CordBundleCtrl', ['$log', '$scope', '$resource',
22 - function ($log, $scope) { 49 + function (_$log_, $scope, _$resource_) {
50 + var BundleData, resource;
23 $scope.page = 'bundle'; 51 $scope.page = 'bundle';
52 + $log = _$log_;
53 + $resource = _$resource_;
54 +
55 + BundleData = $resource(after);
56 + resource = BundleData.get({},
57 + // success
58 + function () {
59 + $scope.name = resource.bundle.name;
60 + current = $scope.name;
61 + $scope.funcs = resource.bundle.functions;
62 +
63 + which = (current === basic) ? after : before;
64 + getAvailable(avScope);
65 + },
66 + // error
67 + function () {
68 + $log.error('Problem with resource', resource);
69 + });
70 + $log.debug('Resource received:', resource);
24 71
25 $log.debug('Cord Bundle Ctrl has been created.'); 72 $log.debug('Cord Bundle Ctrl has been created.');
26 - }]); 73 + }])
74 +
75 + .controller('CordAvailable', ['$scope',
76 + function ($scope) {
77 + avScope = $scope;
78 +
79 + $log.debug('Cord Available Ctrl has been created.');
80 + }])
27 81
28 - // can have a directive here that uses templateUrl for editable and readonly 82 + .directive('bundleAvailable', function () {
83 + return {
84 + templateUrl: 'app/view/bundle/available.html'
85 + };
86 + });
29 }()); 87 }());
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
49 <script src="app/view/user/user.js"></script> 49 <script src="app/view/user/user.js"></script>
50 50
51 <script src="app/view/bundle/bundle.js"></script> 51 <script src="app/view/bundle/bundle.js"></script>
52 + <link rel="stylesheet" href="app/view/bundle/bundle.css">
53 +
52 </head> 54 </head>
53 <body ng-app="cordGui"> 55 <body ng-app="cordGui">
54 <div id="frame" ng-controller="CordCtrl as cordCtrl"></div> 56 <div id="frame" ng-controller="CordCtrl as cordCtrl"></div>
......