From: Elisha Oren Date: Mon, 21 Nov 2016 18:41:35 +0000 (+0200) Subject: UI: add UNI & IPVC tabs (work in-progress) X-Git-Tag: release/carbon~70 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=08df8c9cc13cb5e78c08b388839e6cb88395c42a;p=unimgr.git UI: add UNI & IPVC tabs (work in-progress) Change-Id: I55099737a84ad52896459c11b12e4536668b562e Signed-off-by: Elisha Oren --- diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/admin.controller.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/admin.controller.js index baa0a699..113eb176 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/admin.controller.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/admin.controller.js @@ -28,7 +28,7 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $scope.OpenTenantPortal = function(tenant) { $scope.currentTenent = tenant; - window.location = "#cpeui/tenant/" + tenant.name; + window.location = "#cpeui/tenant/" + tenant.name +"/"; }; $scope.DeleteTenant = function(tenantID) { diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.controller.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.controller.js index b747c79e..b4a92f00 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.controller.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.controller.js @@ -25,7 +25,7 @@ define([].concat(modules).concat(services).concat(directives).concat(controllers } $scope.tab = { - tenantData : mainTabIndexs["tenants"], + tenantData : 1, admin : 1 }; var selectedTab = mainTabIndexs[$state.params.tabName]; diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.module.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.module.js index d37e4d32..1bf1e32e 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.module.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/cpeui.module.js @@ -47,7 +47,7 @@ define([ 'angularAMD', 'app/routingConfig', 'app/core/core.services', }); $stateProvider.state('main.cpeui.tenant', { - url : '/tenant/:tenantid', + url : '/tenant/:tenantid/:tenantTabName', access : access.public, views : { 'cpeui' : { diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html index 11827d6b..4ee79769 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html @@ -38,10 +38,10 @@ {{advancedCollapsed ? 'Show' : 'Hide'}} Advanced Options
- {{obj.is_preserve_vlan ? "" : "Do Not"}} Preserve Vlan + {{obj.is_preserve_vlan ? "" : "Do Not"}} Preserve VLAN - +
Number is required!
diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html new file mode 100644 index 00000000..16f2ae98 --- /dev/null +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html @@ -0,0 +1,46 @@ + + +
+

Create IP-UNI (of UNI: {{params.uniid}})

+ + + + +
+
+
+ + +
+ + + + +
+
Number is required!
+
+
+ + + +
+
IP/Mask are required! (ex. 127.0.0.1/32)
+
+
+ + + +
+
Vlan is required when there are other ip-unis with vlans
+
+
+
+
+
+ + + Cancel + Create + +
+
\ No newline at end of file diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUniSubnet.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUniSubnet.tpl.html new file mode 100644 index 00000000..a98787fc --- /dev/null +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUniSubnet.tpl.html @@ -0,0 +1,41 @@ + + +
+

Add IP-UNI Subnet

+ + + + +
+
+
+ + +
+ + + + +
+
IP is required! (ex. 224.224.224.1)
+
+
+ + + +
+
IP/Mask is required! (ex. 127.0.0.1/32)
+
+
+
+
+
+ + + Cancel + + + Create + +
+
\ No newline at end of file diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html new file mode 100644 index 00000000..de444bda --- /dev/null +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html @@ -0,0 +1,73 @@ + + +
+

Create IPVC

+ + + + +
+
+
+ + +
+ + + + +
+
Number is required!
+
+
+ + +
+
+
+ + + Cancel + Create + +
+
\ No newline at end of file diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/EditVlans.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/EditVlans.tpl.html index aec3b4cc..5f9ebfdc 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/EditVlans.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/EditVlans.tpl.html @@ -1,7 +1,7 @@
-

Vlans

+

VLANs

diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkEvcUni.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkEvcUni.tpl.html index 71a5b72f..240b2a4e 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkEvcUni.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkEvcUni.tpl.html @@ -1,7 +1,7 @@
-

Update {{ params.evc['svc-id'] }} Uni

+

Update {{ params.svc['svc-id'] }} Uni

@@ -22,10 +22,10 @@ - {{ uni.prettyID }} + {{ uni.prettyID }} - + Root @@ -33,12 +33,12 @@ -
- Preserved Vlan: {{params.evc.evc['preserved-vlan']}} - +
+ Preserved VLAN: {{params.svc.evc['preserved-vlan']}} +
- -

VLans

+ +

VLANs

@@ -69,7 +69,7 @@ Cancel - + link diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkIpvcUni.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkIpvcUni.tpl.html new file mode 100644 index 00000000..d86ed4c3 --- /dev/null +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/LinkIpvcUni.tpl.html @@ -0,0 +1,48 @@ + + +
+

Update {{ params.svc['svc-id'] }} Uni

+ + + + +
+
+
+ + +
+ + + + + {{ ce.displayName }} + + + + + + {{ uni.prettyID }} + + + + + + {{ ipuni['ip-uni-id'] }} : {{ipuni['ip-address']}}{{ipuni.vlan ? (' (vlan: ' + ipuni.vlan+')') : ''}} + + + +
+ +
+ + + + Cancel + + + link + + + +
\ No newline at end of file diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.dialogs.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.dialogs.js index 2ed7d85c..14706860 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.dialogs.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.dialogs.js @@ -56,6 +56,12 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $mdDialog.show(confirm).then(callback_ok, callback_cancel); }; + svc.alert = function(title, content, callback_ok) { + var alert = $mdDialog.alert().title(title).textContent(content).ok( + 'Ok'); + $mdDialog.show(alert).then(callback_ok); + }; + return svc; }); diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js index 2daea7ba..b25a9aae 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js @@ -63,7 +63,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - + svc.addCeName = function(ce, new_name, callback) { $http({ method:'POST', @@ -73,11 +73,11 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { if (callback != undefined) { callback(); } - }, function errorCallback(response) { + }, function errorCallback(response) { console.log(response); $http({ method:'GET', - url:"/restconf/config/mef-topology:mef-topology/devices/device/" + ce['dev-id'] + url:"/restconf/config/mef-topology:mef-topology/devices/device/" + ce['dev-id'] }).then(function successCallback(response) { ce["device-name"] = response.data["device"][0]["device-name"]; }); @@ -167,7 +167,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { unis = response.data["unis"]["uni"]; if (unis != undefined){ for (i=0; i < unis.length; i++) { - if ((unis[i]["physical-layers"] != undefined) && (unis[i].device = unis[i]["physical-layers"].links != undefined)){ + if ((unis[i]["physical-layers"] != undefined) && (unis[i]["physical-layers"].links != undefined)){ unis[i].device = unis[i]["physical-layers"].links.link[0].device; } } @@ -206,9 +206,117 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }); }; - // EVCs + // IPVCs + svc.addIpvc = function(ipvc, tenant, callback) { +// var uni_json = getJsonUnis(evc.unis); +// preserved-vlan + var data = { + "mef-service" : { + "svc-id" : ipvc.id, + "svc-type" : 'eplan', + "tenant-id" : tenant, + "ipvc" : { + "ipvc-id" : ipvc.id, + "ipvc-type" : 'multipoint', +// "unis" : { +// "uni" : uni_json +// }, + } + } + }; + $http({ + method:'POST', + url:"/restconf/config/mef-services:mef-services/", + data:data + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + + svc.addIpUni = function(uniid, ipuni_id, ip_address, vlan, subnets, callback) { + var data = {"ip-uni":{ + "ip-uni-id": ipuni_id, + "ip-address": ip_address, + "subnets":{ + "subnet":subnets + } + }}; + if (vlan){ + data["ip-uni"].vlan = vlan; + } + $http({ + method:'POST', + url:"/restconf/config/mef-interfaces:mef-interfaces/unis/uni/"+uniid+"/ip-unis/", + data:data + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + + svc.addIpUniSubnet = function(uniid, ipuniid, subnet, gateway, + callback) { + var data = { + "subnet": + { + "subnet": subnet, + "gateway": gateway + } + + }; + $http( + { + method : 'POST', + url : "/restconf/config/mef-interfaces:mef-interfaces/unis/uni/"+uniid+"/ip-unis/ip-uni/"+ipuniid+"/subnets/", + data : data + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + + svc.deleteIpUniSubnet = function(uniid, ipuni_id, subnet, callback) { + + $http({ + method:'DELETE', + url:"/restconf/config/mef-interfaces:mef-interfaces/unis/uni/"+uniid+"/ip-unis/ip-uni/"+ipuni_id+"/subnets/subnet/"+subnet.replace("/","%2F")+"/" + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + svc.deleteIpUni = function(uniid, ipuni_id, callback) { + + $http({ + method:'DELETE', + url:"/restconf/config/mef-interfaces:mef-interfaces/unis/uni/"+uniid+"/ip-unis/ip-uni/"+ipuni_id+"/" + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + + svc.getIpUniSubnets = function(uniid, ipuni_id, callback) { + $http({ + method:'GET', + url:"/restconf/config/mef-interfaces:mef-interfaces/unis/uni/"+uniid+"/ip-unis/ip-uni/"+ipuni_id+"/subnets" + }).then(function successCallback(response) { + subnets = response.data["subnets"]["subnet"]; + if (callback != undefined) { + callback(subnets); + } + }); + }; - function getJsonUnis(unis) { + + // EVCs + function getJsonUnis(unis) { var uni_json = []; if (unis == undefined) { unis = []; @@ -216,7 +324,6 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { unis.forEach(function(i){uni_json.push({"uni-id":i});}); return uni_json; } - svc.addEvc = function(evc, evc_type, tenant, callback) { var uni_json = getJsonUnis(evc.unis); // preserved-vlan @@ -237,7 +344,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }, "admin-state-enabled" : true } - } + } }; if (evc.is_preserve_vlan) { data["mef-service"]["evc"]["preserved-vlan"] = evc.preserved_vlan; @@ -252,7 +359,6 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - svc.getServices = function(tenantid, callback) { var evcs; $http({ @@ -260,7 +366,6 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { url:"/restconf/config/mef-services:mef-services/" }).then(function successCallback(response) { evcs = response.data["mef-services"]["mef-service"]; // TODO try to filter on server side - if (evcs != undefined) { evcs = evcs.filter(function(evc){return evc["tenant-id"] == tenantid;}); for (i=0; i < evcs.length; i++) { @@ -282,15 +387,14 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }, function errorCallback(response) { console.log(response); }); - return evcs; }; - svc.getAllServices = function(callback) { + svc.getAllServices = function(callback) { $http({ method:'GET', url:"/restconf/config/mef-services:mef-services/" - }).then(function successCallback(response) { + }).then(function successCallback(response) { if (callback != undefined) { callback(response.data["mef-services"]["mef-service"]); } @@ -298,7 +402,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { console.log(response); }); }; - + svc.addTenantToService = function(svcId, tenantName, callbackSuccess, callbackFailure){ $http({ method:'POST', @@ -328,6 +432,40 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }); }; + svc.addIpvcUni = function(svcid, uni_id, ipuni_id, callback) { + var data = {"uni":{ + "uni-id":uni_id, + "ip-uni-id":ipuni_id + } + }; + $http({ + method:'PUT', + url:"/restconf/config/mef-services:mef-services/mef-service/" + svcid + "/ipvc/unis/uni/"+uni_id, + data: data + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }, function failureCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + + svc.deleteIpvcUni = function(svcid, uni_id, callback) { + $http({ + method:'DELETE', + url:"/restconf/config/mef-services:mef-services/mef-service/" + svcid + "/ipvc/unis/uni/" + uni_id + "/" + }).then(function successCallback(response) { + if (callback != undefined) { + callback(); + } + }); + }; + + + svc.addEvcUni = function(svcid, uni_id, role, vlans, callback) { var data = {"uni":{ "uni-id":uni_id, @@ -407,14 +545,14 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { svc.getNetworkNames = function(callback){ $http({ method:'GET', - url:"/restconf/config/neutron:neutron/networks/" + url:"/restconf/config/neutron:neutron/networks/" }).then(function successCallback(response) { - if (callback != undefined) { + if (callback != undefined) { callback(response.data.networks.network); } }); }; - + return svc; }); diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/static/cpeui-custom.css b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/static/cpeui-custom.css index d5a0f09d..2a57adbf 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/static/cpeui-custom.css +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/static/cpeui-custom.css @@ -126,6 +126,8 @@ MD-TOOLBAR:active { .inner-table { border: 1px solid; + margin-top: 0; + margin-bottom: 0; } .clickable { cursor: pointer; diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js index 53da2fbf..02f3b90f 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js @@ -2,7 +2,6 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { cpeui.register.controller('OpenTenantCtrl', function($scope, CpeuiSvc, CpeuiDialogs, $stateParams) { $scope.curTenant = $stateParams.tenantid; - $scope.unisTables = {}; $scope.unis = []; $scope.ces = []; @@ -10,14 +9,26 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $scope.cesDisplayNames = {}; $scope.unisMap = {}; $scope.networkNames = {}; + $scope.expandFlags = { + ipuni:{}, + tuni:{} + }; + var tabIndexs = { + "L2" : 1, + "L3" : 2, + "unis" : 3, + } + if (tabIndexs[$stateParams.tenantTabName]) { + $scope.tab.tenantData = tabIndexs[$stateParams.tenantTabName]; + } function init(){ $scope.updateUnis(function(unis){ CpeuiSvc.getCes(function(ces) { $scope.ces = ces.filter(function(item) { - - var filteredUnis = unis.filterByField('device', item["dev-id"]); + + var filteredUnis = unis.filterByField('device', item["dev-id"]); filteredUnis = filteredUnis.filterByField('prettyID', 'br-int', true); filteredUnis = filteredUnis.filter(function(i){return !(i.prettyID && i.prettyID.startsWith('tun'));}); @@ -29,8 +40,8 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $scope.updateEvcView(); }); }); - - CpeuiSvc.getNetworkNames(function(networks){ + + CpeuiSvc.getNetworkNames(function(networks){ networks.forEach(function(net){ $scope.networkNames[net.uuid] = net.name; }); @@ -53,25 +64,28 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $scope.updateEvcView = function() { CpeuiSvc.getServices($scope.curTenant, function(services) { - + $scope.evcs = services.filter(function(svc){ return svc.evc != undefined;}); $scope.ipvcs = services.filter(function(svc){ return svc.ipvc != undefined;}); - $scope.updateUnis(); - + console.log($scope.ipvcs); $scope.ipvcs.forEach(function(e){ - e.isTree = (e.ipvc['ipvc-type'] == 'rooted-multipoint'); + if (e.ipvc.unis != undefined && e.ipvc.unis.uni != undefined){ + e.ipvc.unis.uni.forEach(function(u){ + u.device = u['uni-id'].split(":")[u['uni-id'].split(":").length-2]; + u.prettyID = u['uni-id'].split(":")[u['uni-id'].split(":").length-1]; + }); + } }); - $scope.evcs.forEach(function(e){ e.isTree = (e.evc['evc-type'] == 'rooted-multipoint'); e.device2unis = {}; - if (e.evc.unis.uni != undefined){ + if (e.evc.unis != undefined && e.evc.unis.uni != undefined){ e.evc.unis.uni.forEach(function(u){ if (e.device2unis[$scope.unisMap[u['uni-id']].device] == undefined){ e.device2unis[$scope.unisMap[u['uni-id']].device] = []; } - u.prettyID = u['uni-id'].split(":")[u['uni-id'].split(":").length - 1]; + u.prettyID = u['uni-id'].split(":")[u['uni-id'].split(":").length - 1]; e.device2unis[$scope.unisMap[u['uni-id']].device].push(u); }); } @@ -112,6 +126,89 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { }); }, addEvcController); + $scope.ipvcDialog = new CpeuiDialogs.Dialog('AddIpvc', {}, function(obj) { + CpeuiSvc.addIpvc(obj, $scope.curTenant, function() { + $scope.updateEvcView(); + }); + }); + + $scope.linkIpvcUniDialog = new CpeuiDialogs.Dialog('LinkIpvcUni', {}, + function(obj) { + CpeuiSvc.addIpvcUni(obj.svc_id, obj.uni['uni-id'], obj.ip_uni, + function() { + $scope.updateEvcView(); + }); + }); + + var ipUniDialogController = function($scope, $mdDialog) { + $scope.hasVlans = false; + if ($scope.params.uni['ip-unis'] && $scope.params.uni['ip-unis']['ip-uni']) { + var ipunis = $scope.params.uni['ip-unis']['ip-uni']; + for (i = 0; i < ipunis.length; i++) { + if (ipunis[i].vlan){ + $scope.hasVlans = true; + } + } + } + }; + + $scope.ipUniDialog = new CpeuiDialogs.Dialog('AddIpUni', {}, function(obj) { + CpeuiSvc.addIpUni(obj['uni-id'], obj['ip-uni-id'], obj['ip-address'], obj.vlan, obj.subnets, function() { + $scope.unis.filterByField('uni-id',obj['uni-id'])[0]['ip-unis']['ip-uni'].push(obj); + }); + }, ipUniDialogController); + + $scope.openIpUniDialog = function(event,uni){ + if (uni['ip-unis'] && (uni['ip-unis']['ip-uni'] != undefined)){ + var ipunis = uni['ip-unis']['ip-uni']; + for (i = 0; i < ipunis.length; i++) { + if (!ipunis[i].vlan){ + CpeuiDialogs.alert("Error","You Can't have more then one ip-uni with no vlan. please remove the non-vlan ip-uni before adding new.") + return; + } + } + } + $scope.ipUniDialog.show(event,{'uniid':uni['uni-id'], uni:uni}) + } + + $scope.ipUniSubnetDialog = new CpeuiDialogs.Dialog('AddIpUniSubnet', {}, function(obj) { + CpeuiSvc.addIpUniSubnet(obj.uniid, obj.ipuniid, obj.subnet, obj.gateway, function() { + CpeuiSvc.getIpUniSubnets(obj.uniid, obj.ipuniid, function(subnets) { + $scope.unis.filterByField('uni-id',obj.uniid)[0]['ip-unis']['ip-uni'].filterByField('ip-uni-id',obj.ipuniid)[0].subnets = {subnet:subnets}; + }); + }); + }); + + $scope.deleteIpUni = function(uniid, ipuni_id) { + CpeuiDialogs.confirm(function() { + CpeuiSvc.deleteIpUni(uniid, ipuni_id, function() { + $scope.updateEvcView(); // TODO update unis only + }); + }); + }; + $scope.deleteIpvcUni = function(svc_id, uni_id) { + CpeuiDialogs.confirm(function() { + CpeuiSvc.deleteIpvcUni(svc_id, uni_id, function() { + $scope.updateEvcView(); + }); + }); + }; + $scope.getMefInterfaceIpvc = function(uni_id,ipuni_id){ + var uni = $scope.unis.filterByField('uni-id',uni_id)[0]; + if ((uni == undefined) || (uni['ip-unis'] == undefined) || (uni['ip-unis']['ip-uni'] == undefined)) { + return undefined; + } + return uni['ip-unis']['ip-uni'].filterByField('ip-uni-id',ipuni_id)[0]; + } + + $scope.deleteIpUniSubnet = function(uniid, ipuni_id, subnet) { + CpeuiDialogs.confirm(function() { + CpeuiSvc.deleteIpUniSubnet(uniid, ipuni_id, subnet, function() { + $scope.updateEvcView(); // TODO update unis only + }); + }); + }; + $scope.deleteEvc = function(svcid) { CpeuiDialogs.confirm(function() { CpeuiSvc.removeEvc(svcid, function() { @@ -143,17 +240,17 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { } $('#vlan_input').val(undefined); }; - + $scope.filterUsedUnis = function(evc){ - return function(u) { + return function(u) { if (u.prettyID == 'br-int') { return false; } if (u.prettyID && u.prettyID.startsWith('tun')) { return false; } - if (evc.evc.unis.uni == undefined){ - evc.evc.unis.uni = []; + if (evc.evc == undefined || evc.evc.unis.uni == undefined){ + return true; } return evc.evc.unis.uni.filterByField('uni-id',u['uni-id']).length == 0; }; @@ -202,7 +299,7 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { }; $scope.sortIpvc = function(ipvc) { return ipvc['ipvc-id']; - }; + }; init(); }); diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html index df5de4d5..3ef02036 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html @@ -3,25 +3,26 @@ -
+
EVCs Table
- + @@ -31,7 +32,7 @@ - + - - + + @@ -84,13 +85,12 @@
EVC IDEVC ID UNIs Network Name SVC Type
{{ item.evc['evc-id'] }}{{ item.evc['evc-id'] }} @@ -50,8 +51,8 @@ Device UNI RoleVlans (click to edit)VLANs (click to edit)
-
diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenantsTable.controller.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenantsTable.controller.js index 72775516..5c64d6d1 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenantsTable.controller.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenantsTable.controller.js @@ -25,7 +25,7 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $scope.OpenTenantPortal = function(tenant) { $scope.currentTenent = tenant; - window.location = "#cpeui/tenant/" + tenant.name; + window.location = "#cpeui/tenant/" + tenant.name + "/"; }; $scope.DeleteTenant = function(tenantID) { diff --git a/legato-api/src/main/yang/mef-services.yang b/legato-api/src/main/yang/mef-services.yang index d2e81221..a0b81fdb 100644 --- a/legato-api/src/main/yang/mef-services.yang +++ b/legato-api/src/main/yang/mef-services.yang @@ -76,6 +76,7 @@ module mef-services { container ipvc { container unis { list uni { + key "uni-id"; leaf uni-id { type leafref { path "/mef-interfaces:mef-interfaces/" +