Skip to content

Commit d769770

Browse files
author
ogozman
authored
Merge pull request #10 from openbaton/develop
Develop
2 parents e7b8ff5 + 7411ff2 commit d769770

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4132
-1461
lines changed

src/main/java/org/project/openbaton/nfvo/gui/WebConfig.java renamed to src/main/java/org/openbaton/nfvo/gui/WebConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.project.openbaton.nfvo.gui;
1+
package org.openbaton.nfvo.gui;
22

33
import org.springframework.stereotype.Controller;
44

src/main/resources/static/descriptors/vnfd/vnfd.json

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,27 @@
33
"version":"0.1",
44
"name":"dummy1",
55
"type":"server",
6-
"endpoint":"dummy",
6+
"endpoint":"generic",
77
"vdu":[
88
{
99
"vm_image":[
1010
"ubuntu-14.04-server-cloudimg-amd64-disk1"
1111
],
12-
"computation_requirement":"",
13-
"virtual_memory_resource_element":"1024",
14-
"virtual_network_bandwidth_resource":"1000000",
12+
"scale_in_out":2,
1513
"lifecycle_event":[
1614
],
17-
"vimInstanceName":"vim-instance",
18-
"vdu_constraint":"",
19-
"high_availability":"ACTIVE_PASSIVE",
20-
"scale_in_out":3,
2115
"vnfc":[
2216
{
2317
"connection_point":[
2418
{
19+
"floatingIp":"random",
2520
"virtual_link_reference":"private"
2621
}
2722
]
2823
}
2924
],
30-
"monitoring_parameter":[
31-
"cpu_utilization"
25+
"vimInstanceName":[
26+
"vim-instance"
3227
]
3328
}
3429
],
@@ -49,32 +44,9 @@
4944
],
5045
"deployment_flavour":[
5146
{
52-
"df_constraint":[
53-
"constraint1",
54-
"constraint2"
55-
],
56-
"costituent_vdu":[],
5747
"flavour_key":"m1.small"
58-
},{
59-
"df_constraint":[
60-
"constraint3",
61-
"constraint4"
62-
],
63-
"costituent_vdu":[],
64-
"flavour_key":"m1.nano"
65-
6648
}
6749
],
6850
"auto_scale_policy":[
69-
],
70-
"manifest_file":"",
71-
"requires":[
72-
"nfvo:ip-en5",
73-
"database:ipB",
74-
"database:ipC",
75-
"database:ipD"
76-
],
77-
"provides":[
78-
"ip"
7951
]
8052
}

src/main/resources/static/dist/css/openbaton.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,4 +799,11 @@ h4 > a, h4 > a:hover {
799799
.upload-drop-zone.drop {
800800
color: #222;
801801
border-color: #222;
802+
}
803+
804+
.dl-table dd{
805+
margin-left: 60px;
806+
}
807+
.dl-table dt{
808+
margin-left: -60px;
802809
}

src/main/resources/static/js/app.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
angular.module('app', ['ngRoute', 'ngSanitize', 'ui.bootstrap', 'ngCookies'])
2-
.config(function ($routeProvider) {
1+
angular.module('app', ['ngRoute', 'ngSanitize', 'ui.bootstrap', 'ngCookies', 'angular-clipboard'])
2+
.config(function ($routeProvider, $locationProvider) {
33

44
$routeProvider.
55
when('/login', {
@@ -10,6 +10,18 @@ angular.module('app', ['ngRoute', 'ngSanitize', 'ui.bootstrap', 'ngCookies'])
1010
templateUrl: 'pages/contents.html',
1111
controller: 'IndexCtrl'
1212
}).
13+
when('/projects', {
14+
templateUrl: 'pages/projects.html',
15+
controller: 'ProjectCtrl'
16+
}).
17+
when('/users', {
18+
templateUrl: 'pages/users/users.html',
19+
controller: 'UserCtrl'
20+
}).
21+
when('/users/:userId', {
22+
templateUrl: 'pages/users/userinfo.html',
23+
controller: 'UserCtrl'
24+
}).
1325
when('/packages', {
1426
templateUrl: 'pages/packages/packages.html',
1527
controller: 'PackageCtrl'
@@ -18,6 +30,14 @@ angular.module('app', ['ngRoute', 'ngSanitize', 'ui.bootstrap', 'ngCookies'])
1830
templateUrl: 'pages/packages/packageinfo.html',
1931
controller: 'PackageCtrl'
2032
}).
33+
when('/events/:eventId', {
34+
templateUrl: 'pages/events/eventinfo.html',
35+
controller: 'EventCtrl'
36+
}).
37+
when('/events', {
38+
templateUrl: 'pages/events/events.html',
39+
controller: 'EventCtrl'
40+
}).
2141
when('/nsdescriptors', {
2242
templateUrl: 'pages/nsdescriptors/nsdescriptors.html',
2343
controller: 'NsdCtrl'
@@ -53,6 +73,10 @@ angular.module('app', ['ngRoute', 'ngSanitize', 'ui.bootstrap', 'ngCookies'])
5373
.when('/nsrecords/:nsrecordId/vnfrecords/:vnfrecordId/vdus/:vduId', {
5474
templateUrl: 'pages/nsrecords/vdu.html',
5575
controller: 'NsrCtrl'
76+
})
77+
.when('/nsrecords/:nsrecordId/vnfrecords/:vnfrecordId/vdus/:vduId/vnfci/:vnfciId', {
78+
templateUrl: 'pages/nsrecords/vnfci.html',
79+
controller: 'NsrCtrl'
5680
}).
5781
when('/nsdescriptors/:nsdescriptorId/vnfdependencies/:vnfdependencyId', {
5882
templateUrl: 'pages/nsdescriptors/vnfdependency.html',
@@ -117,7 +141,7 @@ angular.module('app', ['ngRoute', 'ngSanitize', 'ui.bootstrap', 'ngCookies'])
117141
otherwise({
118142
// redirectTo: '/'
119143
});
120-
144+
$locationProvider.html5Mode(false);
121145
});
122146

123147
/**
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
var app = angular.module('app');
2+
app.controller('EventCtrl', function ($scope, serviceAPI, $routeParams, http, $cookieStore, AuthService) {
3+
4+
var url = $cookieStore.get('URL') + "/api/v1/events/";
5+
6+
$scope.alerts = [];
7+
$scope.closeAlert = function (index) {
8+
$scope.alerts.splice(index, 1);
9+
};
10+
11+
loadTable();
12+
13+
$scope.eventObj = {
14+
'name': 'event_name',
15+
'networkServiceId': '',
16+
'virtualNetworkFunctionId': '',
17+
'type': 'REST',
18+
'endpoint': 'localhost:8081/events',
19+
'event': 'INSTANTIATE_FINISH'
20+
};
21+
22+
/* -- multiple delete functions Start -- */
23+
24+
$scope.multipleDeleteReq = function(){
25+
var ids = [];
26+
angular.forEach($scope.selection.ids, function (value, k) {
27+
if (value) {
28+
ids.push(k);
29+
}
30+
});
31+
//console.log(ids);
32+
http.post(url + 'multipledelete', ids)
33+
.success(function (response) {
34+
showOk('Event: ' + ids.toString() + ' deleted.');
35+
loadTable();
36+
})
37+
.error(function (response, status) {
38+
showError(response, status);
39+
});
40+
41+
};
42+
43+
$scope.main = {checkbox: false};
44+
$scope.$watch('main', function (newValue, oldValue) {
45+
////console.log(newValue.checkbox);
46+
////console.log($scope.selection.ids);
47+
angular.forEach($scope.selection.ids, function (value, k) {
48+
$scope.selection.ids[k] = newValue.checkbox;
49+
});
50+
//console.log($scope.selection.ids);
51+
}, true);
52+
53+
$scope.$watch('selection', function (newValue, oldValue) {
54+
//console.log(newValue);
55+
var keepGoing = true;
56+
angular.forEach($scope.selection.ids, function (value, k) {
57+
if (keepGoing) {
58+
if ($scope.selection.ids[k]) {
59+
$scope.multipleDelete = false;
60+
keepGoing = false;
61+
}
62+
else {
63+
$scope.multipleDelete = true;
64+
}
65+
}
66+
67+
});
68+
if (keepGoing)
69+
$scope.mainCheckbox = false;
70+
}, true);
71+
72+
$scope.multipleDelete = true;
73+
74+
$scope.selection = {};
75+
$scope.selection.ids = {};
76+
/* -- multiple delete functions END -- */
77+
78+
79+
$scope.types = ['REST', 'RABBIT', 'JMS'];
80+
$scope.deleteEvent = function (data) {
81+
http.delete(url + data.id)
82+
.success(function (response) {
83+
showOk('Event: ' + data.name + ' deleted.');
84+
loadTable();
85+
})
86+
.error(function (response, status) {
87+
showError(response, status);
88+
});
89+
};
90+
91+
$scope.closeAlert = function (index) {
92+
$scope.alerts.splice(index, 1);
93+
};
94+
95+
96+
$scope.save = function () {
97+
//console.log($scope.eventObj);
98+
http.post(url, $scope.eventObj)
99+
.success(function (response) {
100+
showOk('Event: ' + $scope.eventObj.name + ' saved.');
101+
loadTable();
102+
})
103+
.error(function (response, status) {
104+
showError(response, status);
105+
});
106+
};
107+
function loadTable() {
108+
if (!angular.isUndefined($routeParams.eventId))
109+
http.get(url + $routeParams.eventId)
110+
.success(function (response, status) {
111+
//console.log(response);
112+
$scope.event = response;
113+
$scope.eventJSON = JSON.stringify(response, undefined, 4);
114+
115+
}).error(function (data, status) {
116+
showError(data, status);
117+
});
118+
else {
119+
http.get(url)
120+
.success(function (response) {
121+
$scope.events = response;
122+
//console.log(response);
123+
})
124+
.error(function (data, status) {
125+
showError(data, status);
126+
});
127+
128+
http.get(url + '/actions')
129+
.success(function (response) {
130+
$scope.actions = response;
131+
})
132+
.error(function (data, status) {
133+
showError(data, status);
134+
});
135+
}
136+
137+
}
138+
139+
function showError(data, status) {
140+
$scope.alerts.push({
141+
type: 'danger',
142+
msg: 'ERROR: <strong>HTTP status</strong>: ' + status + ' response <strong>data</strong> : ' + JSON.stringify(data)
143+
});
144+
$('.modal').modal('hide');
145+
if (status === 401) {
146+
//console.log(status + ' Status unauthorized')
147+
AuthService.logout();
148+
}
149+
}
150+
151+
function showOk(msg) {
152+
$scope.alerts.push({type: 'success', msg: msg});
153+
loadTable();
154+
$('.modal').modal('hide');
155+
}
156+
157+
});
158+
159+
160+

0 commit comments

Comments
 (0)