Merge branch 'master' of github.com:open-cloud/xos
diff --git a/views/ngXosViews/diagnostic/src/js/chart_data_service.js b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
index 6f57ef0..19825a1 100644
--- a/views/ngXosViews/diagnostic/src/js/chart_data_service.js
+++ b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
@@ -22,7 +22,7 @@
children: [
{
name: 'LAN-Side',
- subtitle: 'Virtual Networks',
+ subtitle: 'Virtual Network',
type: 'network',
children: [{
name: 'Subscriber',
diff --git a/views/ngXosViews/diagnostic/src/js/config.js b/views/ngXosViews/diagnostic/src/js/config.js
index 75b5fe7..ac0f989 100644
--- a/views/ngXosViews/diagnostic/src/js/config.js
+++ b/views/ngXosViews/diagnostic/src/js/config.js
@@ -3,7 +3,7 @@
angular.module('xos.diagnostic')
.constant('serviceTopologyConfig', {
- widthMargin: 20,
+ widthMargin: 60,
heightMargin: 30,
duration: 750,
elWidths: [20, 104, 105, 104, 20], //this is not true
diff --git a/views/ngXosViews/diagnostic/src/js/logicTopology.js b/views/ngXosViews/diagnostic/src/js/logicTopology.js
index 722328d..f88b80a 100644
--- a/views/ngXosViews/diagnostic/src/js/logicTopology.js
+++ b/views/ngXosViews/diagnostic/src/js/logicTopology.js
@@ -20,6 +20,8 @@
const handleSvg = (el) => {
+ d3.select($element[0]).select('svg').remove();
+
svg = d3.select(el)
.append('svg')
.style('width', `${el.clientWidth}px`)
@@ -59,7 +61,14 @@
.then((instances) => {
LogicTopologyHelper.updateTree(svg);
})
- })
+ });
+
+ d3.select(window)
+ .on('resize.logic', () => {
+ handleSvg($element[0]);
+ LogicTopologyHelper.setupTree(svg);
+ LogicTopologyHelper.updateTree(svg);
+ });
handleSvg($element[0]);
LogicTopologyHelper.setupTree(svg);
diff --git a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
index 229b629..6ac0342 100644
--- a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
+++ b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
@@ -41,7 +41,7 @@
nodes.each(function(n){
let currentNode = d3.select(this);
// cicle trouch node to add Tags and Public IP
- if(n.name === 'LAN' && angular.isDefined(n.subscriberTag)){
+ if(n.name === 'LAN-Side' && angular.isDefined(n.subscriberTag)){
currentNode.append('text')
.attr({
'text-anchor': 'middle',
@@ -57,7 +57,7 @@
.text(() => `S-Tag: ${n.subscriberTag.sTag}`);
}
- if(n.name === 'WAN' && angular.isDefined(n.subscriberIP)){
+ if(n.name === 'WAN-Side' && angular.isDefined(n.subscriberIP)){
currentNode.append('text')
.attr({
'text-anchor': 'middle',
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopology.js b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
index 925e7c0..832e6fa 100644
--- a/views/ngXosViews/diagnostic/src/js/serviceTopology.js
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
@@ -16,7 +16,7 @@
const el = $element[0];
d3.select(window)
- .on('resize', () => {
+ .on('resize.service', () => {
draw(this.serviceChain);
});
@@ -47,7 +47,7 @@
.style('height', `${el.clientHeight}px`)
const treeContainer = svg.append('g')
- .attr('transform', `translate(${serviceTopologyConfig.widthMargin * 4},${serviceTopologyConfig.heightMargin})`);
+ .attr('transform', `translate(${serviceTopologyConfig.widthMargin * 2},${serviceTopologyConfig.heightMargin})`);
root = tree;
root.x0 = height / 2;
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js b/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
index 3759017..61ec1e2 100644
--- a/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
@@ -10,10 +10,11 @@
// given a canvas, a layout and a data source, draw a tree layout
const updateTree = (svg, layout, source, el = _el) => {
-
if(el){
_el = el;
}
+
+ let targetWidth = _el.clientWidth - serviceTopologyConfig.widthMargin * 2;
//cache data
_svg = svg;
@@ -32,7 +33,7 @@
// Normalize for fixed-depth.
nodes.forEach(function(d) {
// position the child node horizontally
- const step = ((_el.clientWidth - (serviceTopologyConfig.widthMargin * 2)) / maxDepth);
+ const step = ((targetWidth - (serviceTopologyConfig.widthMargin * 2)) / (maxDepth - 1));
d.y = d.depth * step;
});
diff --git a/views/ngXosViews/diagnostic/src/js/subscriber-modal.js b/views/ngXosViews/diagnostic/src/js/subscriber-modal.js
index 47b6a8d..7870386 100644
--- a/views/ngXosViews/diagnostic/src/js/subscriber-modal.js
+++ b/views/ngXosViews/diagnostic/src/js/subscriber-modal.js
@@ -45,8 +45,8 @@
if(!this.subscriber){
return;
}
- this.subscriber.uplink_speed = parseInt(this.subscriber.uplink_speed, 10);
- this.subscriber.downlink_speed = parseInt(this.subscriber.downlink_speed, 10);
+ this.subscriber.uplink_speed = parseInt(this.subscriber.uplink_speed, 10) / 1000000000;
+ this.subscriber.downlink_speed = parseInt(this.subscriber.downlink_speed, 10) / 1000000000;
});
this.close = () => {
@@ -55,6 +55,10 @@
this.updateSubscriber = (subscriber) => {
+ this.subscriber.uplink_speed = this.subscriber.uplink_speed * 1000000000;
+ this.subscriber.downlink_speed = this.subscriber.downlink_speed * 1000000000;
+
+
Subscribers.update(subscriber).$promise
.then(() => {
this.success = 'Subscriber successfully updated!';
diff --git a/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html b/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html
index 7f87999..ffc039f 100644
--- a/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html
+++ b/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html
@@ -41,11 +41,17 @@
<div class="row">
<div class="col-xs-6">
<label>Uplink Speed</label>
- <input type="number" class="form-control" ng-model="vm.subscriber.uplink_speed"/>
+ <div class="input-group">
+ <input type="number" class="form-control" ng-model="vm.subscriber.uplink_speed"/>
+ <span class="input-group-addon">Gb</span>
+ </div>
</div>
<div class="col-xs-6">
<label>Downlink Speed</label>
- <input type="number" class="form-control" ng-model="vm.subscriber.downlink_speed"/>
+ <div class="input-group">
+ <input type="number" class="form-control" ng-model="vm.subscriber.downlink_speed"/>
+ <span class="input-group-addon">Gb</span>
+ </div>
</div>
</div>
<div class="row">
diff --git a/xos/configurations/acord/Makefile b/xos/configurations/acord/Makefile
index 5b03692..6d5a04f 100644
--- a/xos/configurations/acord/Makefile
+++ b/xos/configurations/acord/Makefile
@@ -1,11 +1,11 @@
SETUPDIR:=../setup
MYIP:=$(shell hostname -i)
-cloudlab: common_cloudlab cloudlab_ceilometer_custom_images acord
+cloudlab: common_cloudlab cloudlab_ceilometer_custom_images ceilometer_cloudlab_cord_plugins acord
-devstack: upgrade_pkgs common_devstack devstack_net_fix devstack_images acord
+devstack: upgrade_pkgs common_devstack devstack_net_fix devstack_images ceilometer_devstack_cord_plugins acord
-cord: ceilometer_dashboard
+cord:
sudo MYIP=$(MYIP) docker-compose up -d
bash ../common/wait_for_xos.sh
sudo MYIP=$(MYIP) docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/fixtures.yaml
@@ -25,11 +25,33 @@
common_devstack:
make -C ../common -f Makefile.devstack
-ceilometer_dashboard:
- #NOTE: The below dashboard install scripts assume
- #clouldlab openstack environment created using "OpenStack" profile
- #bash install_xos_ceilometer_dashboard.sh
- #bash install_ceilometer_patch.sh
+ceilometer_cloudlab_cord_plugins:
+ if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
+ git clone https://github.com/srikanthvavila/ceilometer-plugins.git
+ sudo cp -r ceilometer-plugins/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
+ sudo cp -r ceilometer-plugins/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
+ sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
+ sudo cp ceilometer-plugins/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
+ sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
+ echo "Restarting ceilometer-agent-notification"
+ sudo service ceilometer-agent-notification restart
+ echo "Restarting ceilometer-agent-central"
+ sudo service ceilometer-agent-central restart
+
+ceilometer_devstack_cord_plugins:
+ if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
+ git clone https://github.com/srikanthvavila/ceilometer-plugins.git
+ sudo cp -r ceilometer-plugins/network/ext_services /opt/stack/ceilometer/ceilometer/network/
+ sudo cp ceilometer-plugins/entry_points.txt /opt/stack/ceilometer/ceilometer*egg-info/
+ sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
+ echo "Remember to restart ceilometer-anotification ceilometer-acentral screens"
+
+ceilometer_pub_sub:
+ if [ -d ./pub-sub ]; then rm -fr ./pub-sub; fi
+ git clone https://github.com/srikanthvavila/pub-sub.git
+ echo "Starting Ceilometer PUB/SUB service...Ensure zookeeper and kafka services are launched (if required)"
+ cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
+ cd ../..
stop:
sudo MYIP=$(MYIP) docker-compose stop
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord/Makefile
index 56990a2..9fee5f8 100644
--- a/xos/configurations/cord/Makefile
+++ b/xos/configurations/cord/Makefile
@@ -5,7 +5,7 @@
devstack: upgrade_pkgs common_devstack devstack_net_fix cord
-cord: ceilometer_dashboard virtualbng_json vtn_network_cfg_json
+cord: virtualbng_json vtn_network_cfg_json
sudo MYIP=$(MYIP) docker-compose up -d
bash ../common/wait_for_xos.sh
sudo MYIP=$(MYIP) docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/fixtures.yaml
@@ -23,14 +23,28 @@
common_devstack:
make -C ../common -f Makefile.devstack
-acord: cloudlab_ceilometer_custom_images ceilometer_dashboard
+acord: cloudlab_ceilometer_custom_images ceilometer_cloudlab_cord_plugins
sudo MYIP=$(MYIP) docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord/ceilometer.yaml
-ceilometer_dashboard:
- #NOTE: The below dashboard install scripts assume
- #clouldlab openstack environment created using "OpenStack" profile
- #bash install_xos_ceilometer_dashboard.sh
- bash install_ceilometer_patch.sh
+ceilometer_cloudlab_cord_plugins:
+ if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
+ git clone https://github.com/srikanthvavila/ceilometer-plugins.git
+ sudo cp -r ceilometer-plugins/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
+ sudo cp -r ceilometer-plugins/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
+ sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
+ sudo cp ceilometer-plugins/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
+ sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
+ echo "Restarting ceilometer-agent-notification"
+ sudo service ceilometer-agent-notification restart
+ echo "Restarting ceilometer-agent-central"
+ sudo service ceilometer-agent-central restart
+
+ceilometer_pub_sub:
+ if [ -d ./pub-sub ]; then rm -fr ./pub-sub; fi
+ git clone https://github.com/srikanthvavila/pub-sub.git
+ echo "Starting Ceilometer PUB/SUB service...Ensure zookeeper and kafka services are launched (if required)"
+ cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
+ cd ../..
virtualbng_json:
export SETUPDIR=$(SETUPDIR); bash make-virtualbng-json.sh
diff --git a/xos/configurations/cord/ceilometer_pub_sub.tar.gz b/xos/configurations/cord/ceilometer_pub_sub.tar.gz
deleted file mode 100644
index eb88a2b..0000000
--- a/xos/configurations/cord/ceilometer_pub_sub.tar.gz
+++ /dev/null
Binary files differ
diff --git a/xos/configurations/cord/install_ceilometer_patch.sh b/xos/configurations/cord/install_ceilometer_patch.sh
deleted file mode 100755
index 77aa05b..0000000
--- a/xos/configurations/cord/install_ceilometer_patch.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-if [ -d /usr/lib/python2.7/dist-packages/ceilometer/network/ext_services ]; then
- echo "Seems VCPE notification listeners are already enabled in ceilometer... so exiting gracefully..."
- exit 0
-fi
-echo "Verifying if all the required files are present"
-if [ ! -f openstack_ceilometer_patch.tar.gz ] || [ ! -f ceilometer_pub_sub.tar.gz ];
-then
- echo "File openstack_ceilometer_patch.tar.gz or ceilometer_pub_sub.tar.gz not found"
- exit 1
-fi
-echo "Copying the ceilometer patch files to /usr/lib/python2.7/dist-packages/ceilometer"
-tar -xzf openstack_ceilometer_patch.tar.gz
-sudo mv ceilometer/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
-sudo mv ceilometer/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
-sudo mv /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/orig_init.orig_py
-sudo mv ceilometer/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
-sudo mv ceilometer-2015.1.1.egg-info/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
-sudo mv pipeline.yaml /etc/ceilometer/
-echo "Restarting ceilometer-agent-notification"
-sudo service ceilometer-agent-notification restart
-echo "Restarting ceilometer-agent-central"
-sudo service ceilometer-agent-central restart
-tar -xzf ceilometer_pub_sub.tar.gz
-echo "Starting Ceilometer PUB/SUB service"
-cd ceilometer_pub_sub
-python sub_main.py &
diff --git a/xos/configurations/cord/openstack_ceilometer_patch.tar.gz b/xos/configurations/cord/openstack_ceilometer_patch.tar.gz
deleted file mode 100644
index 2c4f02c..0000000
--- a/xos/configurations/cord/openstack_ceilometer_patch.tar.gz
+++ /dev/null
Binary files differ
diff --git a/xos/core/xoslib/methods/ceilometerview.py b/xos/core/xoslib/methods/ceilometerview.py
index 9e46aa7..0fb94c4 100644
--- a/xos/core/xoslib/methods/ceilometerview.py
+++ b/xos/core/xoslib/methods/ceilometerview.py
@@ -919,43 +919,43 @@
# to info that I am able to obtain from Ceilometer meters, hopefully
# some day it will be supported all.
return datastructures.SortedDict([
- ('vcpe', {
- 'type': _("VCPE"),
+ ('vsg', {
+ 'type': _("VSG"),
'label': '',
- 'description': _("Existence of vcpe instance"),
+ 'description': _("Existence of vsg instance"),
}),
- ('vcpe.dns.cache.size', {
- 'type': _("VCPE"),
+ ('vsg.dns.cache.size', {
+ 'type': _("VSG"),
'label': '',
'description': _("Number of entries in DNS cache"),
}),
- ('vcpe.dns.total_instered_entries', {
- 'type': _("VCPE"),
+ ('vsg.dns.total_instered_entries', {
+ 'type': _("VSG"),
'label': '',
'description': _("Total number of inserted entries into the cache"),
}),
- ('vcpe.dns.replaced_unexpired_entries', {
- 'type': _("VCPE"),
+ ('vsg.dns.replaced_unexpired_entries', {
+ 'type': _("VSG"),
'label': '',
'description': _("Unexpired entries that were thrown out of cache"),
}),
- ('vcpe.dns.queries_answered_locally', {
- 'type': _("VCPE"),
+ ('vsg.dns.queries_answered_locally', {
+ 'type': _("VSG"),
'label': '',
'description': _("Number of cache hits"),
}),
- ('vcpe.dns.queries_forwarded', {
- 'type': _("VCPE"),
+ ('vsg.dns.queries_forwarded', {
+ 'type': _("VSG"),
'label': '',
'description': _("Number of cache misses"),
}),
- ('vcpe.dns.server.queries_sent', {
- 'type': _("VCPE"),
+ ('vsg.dns.server.queries_sent', {
+ 'type': _("VSG"),
'label': '',
'description': _("For each upstream server, the number of queries sent"),
}),
- ('vcpe.dns.server.queries_failed', {
- 'type': _("VCPE"),
+ ('vsg.dns.server.queries_failed', {
+ 'type': _("VSG"),
'label': '',
'description': _("For each upstream server, the number of queries failed"),
}),
@@ -1165,7 +1165,7 @@
services = {
_('Nova'): meters.list_nova(),
_('Neutron'): meters.list_neutron(),
- _('VCPE'): meters.list_vcpe(),
+ _('VSG'): meters.list_vcpe(),
_('VOLT'): meters.list_volt(),
_('SDN'): meters.list_sdn(),
}
@@ -1236,7 +1236,7 @@
services = {
_('Nova'): meters.list_nova(),
_('Neutron'): meters.list_neutron(),
- _('VCPE'): meters.list_vcpe(),
+ _('VSG'): meters.list_vcpe(),
_('VOLT'): meters.list_volt(),
_('SDN'): meters.list_sdn(),
}
@@ -1394,7 +1394,7 @@
services = {
_('Nova'): meters.list_nova(except_meters=exclude_nova_meters_info),
_('Neutron'): meters.list_neutron(except_meters=exclude_neutron_meters_info),
- _('VCPE'): meters.list_vcpe(),
+ _('VSG'): meters.list_vcpe(),
_('VOLT'): meters.list_volt(),
_('SDN'): meters.list_sdn(),
}
diff --git a/xos/core/xoslib/static/js/xosDiagnostic.js b/xos/core/xoslib/static/js/xosDiagnostic.js
index 73cc41a..e89d7d5 100644
--- a/xos/core/xoslib/static/js/xosDiagnostic.js
+++ b/xos/core/xoslib/static/js/xosDiagnostic.js
@@ -18,7 +18,7 @@
angular.module("xos.diagnostic").run(["$templateCache", function($templateCache) {$templateCache.put("templates/diagnostic.tpl.html","<div class=\"container-fluid\">\n <div ng-hide=\"vm.error && vm.loader\" style=\"height: 900px\">\n <div class=\"onethird-height\">\n <div class=\"well\">\n Services Graph\n </div>\n <div class=\"well pull-right\" ng-click=\"vm.reloadGlobalScope()\" ng-show=\"vm.selectedSubscriber\">\n Reset subscriber\n </div>\n <service-topology service-chain=\"vm.serviceChain\"></service-topology>\n </div>\n <div class=\"twothird-height\">\n <div class=\"well\">\n Logical Resources\n </div>\n <logic-topology ng-if=\"vm.subscribers\" subscribers=\"vm.subscribers\" selected=\"vm.selectedSubscriber\"></logic-topology>\n </div>\n </div>\n <div class=\"row\" ng-if=\"vm.error\">\n <div class=\"col-xs-12\">\n <div class=\"alert alert-danger\">\n {{vm.error}}\n </div>\n </div>\n </div>\n <div class=\"row\" ng-if=\"vm.loader\">\n <div class=\"col-xs-12\">\n <div class=\"loader\">Loading</div>\n </div>\n </div>\n</div>");
$templateCache.put("templates/logicTopology.tpl.html","<select-subscriber-modal open=\"vm.openSelectSubscriberModal\" subscribers=\"vm.subscribers\"></select-subscriber-modal>\n<subscriber-status-modal open=\"vm.openSubscriberStatusModal\" subscriber=\"vm.currentSubscriber\"></subscriber-status-modal>\n<div class=\"instances-stats animate\" ng-hide=\"vm.hideInstanceStats\">\n <div class=\"row\">\n <div class=\"col-sm-3 col-sm-offset-8\">\n <div class=\"panel panel-primary\" ng-repeat=\"instance in vm.selectedInstances\">\n <div class=\"panel-heading\">\n {{instance.humanReadableName}}\n </div>\n <ul class=\"list-group\">\n <li class=\"list-group-item\">Backend Status: {{instance.backend_status}}</li>\n <li class=\"list-group-item\">IP Address: {{instance.ip}}</li>\n </ul>\n <ul class=\"list-group\">\n <li class=\"list-group-item\" ng-repeat=\"stat in instance.stats\">\n <span class=\"badge\">{{stat.value}}</span>\n {{stat.meter}}\n </li>\n </ul>\n </div>\n </div> \n </div>\n </div>\n</div>");
$templateCache.put("templates/select-subscriber-modal.tpl.html","<div class=\"modal fade\" ng-class=\"{in: vm.open}\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog modal-sm\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button ng-click=\"vm.close()\" type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\">Select a subscriber:</h4>\n </div>\n <div class=\"modal-body\">\n <select class=\"form-control\" ng-options=\"s as s.humanReadableName for s in vm.subscribers\" ng-model=\"vm.selected\"></select>\n </div>\n <div class=\"modal-footer\">\n <button ng-click=\"vm.close()\" type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n <button ng-click=\"vm.select(vm.selected)\" type=\"button\" class=\"btn btn-primary\">Select</button>\n </div>\n </div><!-- /.modal-content -->\n </div><!-- /.modal-dialog -->\n</div><!-- /.modal -->");
-$templateCache.put("templates/subscriber-status-modal.tpl.html","<div class=\"modal fade\" ng-class=\"{in: vm.open}\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog modal-sm\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button ng-click=\"vm.close()\" type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\">Manage subscriber:</h4>\n </div>\n <form name=\"vm.subscriber-detail\">\n <div class=\"modal-body\">\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <label>Status</label>\n </div>\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'enabled\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'enabled\' ,\'btn-default\': vm.subscriber.status !== \'enabled\'}\"\n >Enabled</a>\n </div>\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'suspended\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'suspended\' ,\'btn-default\': vm.subscriber.status !== \'suspended\'}\"\n >Suspended</a>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'delinquent\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'delinquent\' ,\'btn-default\': vm.subscriber.status !== \'delinquent\'}\"\n >Delinquent <br> payment</a>\n </div>\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'copyrightviolation\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'copyrightviolation\' ,\'btn-default\': vm.subscriber.status !== \'copyrightviolation\'}\"\n >Copyright <br> violation</a>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-6\">\n <label>Uplink Speed</label>\n <input type=\"number\" class=\"form-control\" ng-model=\"vm.subscriber.uplink_speed\"/>\n </div>\n <div class=\"col-xs-6\">\n <label>Downlink Speed</label>\n <input type=\"number\" class=\"form-control\" ng-model=\"vm.subscriber.downlink_speed\"/>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-6\">\n <label>Enable Uverse</label>\n </div>\n <div class=\"col-xs-6\">\n <a \n ng-click=\"vm.subscriber.enable_uverse = !vm.subscriber.enable_uverse\" \n ng-class=\"{\'btn-success\': vm.subscriber.enable_uverse, \'btn-danger\': !vm.subscriber.enable_uverse}\"\n class=\"btn btn-block\">\n <span ng-show=\"vm.subscriber.enable_uverse === true\">Enabled</span>\n <span ng-show=\"vm.subscriber.enable_uverse !== true\">Disabled</span>\n </a>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\" ng-show=\"vm.success || vm.formError\">\n <div class=\"alert alert-success\" ng-show=\"vm.success\">\n {{vm.success}}\n </div>\n <div class=\"alert alert-danger\" ng-show=\"vm.formError\">\n {{vm.formError}}\n </div>\n </div>\n <div class=\"modal-footer\">\n <button ng-click=\"vm.close()\" type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n <button ng-click=\"vm.updateSubscriber(vm.subscriber)\" type=\"button\" class=\"btn btn-primary\">Save</button>\n </div>\n </form>\n </div><!-- /.modal-content -->\n </div><!-- /.modal-dialog -->\n</div><!-- /.modal -->");}]);
+$templateCache.put("templates/subscriber-status-modal.tpl.html","<div class=\"modal fade\" ng-class=\"{in: vm.open}\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog modal-sm\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button ng-click=\"vm.close()\" type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\">Manage subscriber:</h4>\n </div>\n <form name=\"vm.subscriber-detail\">\n <div class=\"modal-body\">\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <label>Status</label>\n </div>\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'enabled\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'enabled\' ,\'btn-default\': vm.subscriber.status !== \'enabled\'}\"\n >Enabled</a>\n </div>\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'suspended\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'suspended\' ,\'btn-default\': vm.subscriber.status !== \'suspended\'}\"\n >Suspended</a>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'delinquent\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'delinquent\' ,\'btn-default\': vm.subscriber.status !== \'delinquent\'}\"\n >Delinquent <br> payment</a>\n </div>\n <div class=\"col-xs-6\">\n <a ng-click=\"vm.subscriber.status = \'copyrightviolation\'\"\n class=\"btn btn-block\"\n ng-class=\"{\'btn-primary\': vm.subscriber.status === \'copyrightviolation\' ,\'btn-default\': vm.subscriber.status !== \'copyrightviolation\'}\"\n >Copyright <br> violation</a>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-6\">\n <label>Uplink Speed</label>\n <div class=\"input-group\">\n <input type=\"number\" class=\"form-control\" ng-model=\"vm.subscriber.uplink_speed\"/>\n <span class=\"input-group-addon\">Gb</span>\n </div>\n </div>\n <div class=\"col-xs-6\">\n <label>Downlink Speed</label>\n <div class=\"input-group\">\n <input type=\"number\" class=\"form-control\" ng-model=\"vm.subscriber.downlink_speed\"/>\n <span class=\"input-group-addon\">Gb</span>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-6\">\n <label>Enable Uverse</label>\n </div>\n <div class=\"col-xs-6\">\n <a \n ng-click=\"vm.subscriber.enable_uverse = !vm.subscriber.enable_uverse\" \n ng-class=\"{\'btn-success\': vm.subscriber.enable_uverse, \'btn-danger\': !vm.subscriber.enable_uverse}\"\n class=\"btn btn-block\">\n <span ng-show=\"vm.subscriber.enable_uverse === true\">Enabled</span>\n <span ng-show=\"vm.subscriber.enable_uverse !== true\">Disabled</span>\n </a>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\" ng-show=\"vm.success || vm.formError\">\n <div class=\"alert alert-success\" ng-show=\"vm.success\">\n {{vm.success}}\n </div>\n <div class=\"alert alert-danger\" ng-show=\"vm.formError\">\n {{vm.formError}}\n </div>\n </div>\n <div class=\"modal-footer\">\n <button ng-click=\"vm.close()\" type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n <button ng-click=\"vm.updateSubscriber(vm.subscriber)\" type=\"button\" class=\"btn btn-primary\">Save</button>\n </div>\n </form>\n </div><!-- /.modal-content -->\n </div><!-- /.modal-dialog -->\n</div><!-- /.modal -->");}]);
'use strict';
(function () {
@@ -72,8 +72,8 @@
if (!_this2.subscriber) {
return;
}
- _this2.subscriber.uplink_speed = parseInt(_this2.subscriber.uplink_speed, 10);
- _this2.subscriber.downlink_speed = parseInt(_this2.subscriber.downlink_speed, 10);
+ _this2.subscriber.uplink_speed = parseInt(_this2.subscriber.uplink_speed, 10) / 1000000000;
+ _this2.subscriber.downlink_speed = parseInt(_this2.subscriber.downlink_speed, 10) / 1000000000;
});
this.close = function () {
@@ -82,6 +82,9 @@
this.updateSubscriber = function (subscriber) {
+ _this2.subscriber.uplink_speed = _this2.subscriber.uplink_speed * 1000000000;
+ _this2.subscriber.downlink_speed = _this2.subscriber.downlink_speed * 1000000000;
+
Subscribers.update(subscriber).$promise.then(function () {
_this2.success = 'Subscriber successfully updated!';
})['catch'](function (e) {
@@ -115,6 +118,8 @@
_el = el;
}
+ var targetWidth = _el.clientWidth - serviceTopologyConfig.widthMargin * 2;
+
//cache data
_svg = svg;
_layout = layout;
@@ -133,7 +138,7 @@
// Normalize for fixed-depth.
nodes.forEach(function (d) {
// position the child node horizontally
- var step = (_el.clientWidth - serviceTopologyConfig.widthMargin * 2) / maxDepth;
+ var step = (targetWidth - serviceTopologyConfig.widthMargin * 2) / (maxDepth - 1);
d.y = d.depth * step;
});
@@ -283,7 +288,7 @@
var el = $element[0];
- d3.select(window).on('resize', function () {
+ d3.select(window).on('resize.service', function () {
draw(_this.serviceChain);
});
@@ -308,7 +313,7 @@
svg = d3.select($element[0]).append('svg').style('width', el.clientWidth + 'px').style('height', el.clientHeight + 'px');
- var treeContainer = svg.append('g').attr('transform', 'translate(' + serviceTopologyConfig.widthMargin * 4 + ',' + serviceTopologyConfig.heightMargin + ')');
+ var treeContainer = svg.append('g').attr('transform', 'translate(' + serviceTopologyConfig.widthMargin * 2 + ',' + serviceTopologyConfig.heightMargin + ')');
root = tree;
root.x0 = height / 2;
@@ -902,7 +907,7 @@
nodes.each(function (n) {
var currentNode = d3.select(this);
// cicle trouch node to add Tags and Public IP
- if (n.name === 'LAN' && angular.isDefined(n.subscriberTag)) {
+ if (n.name === 'LAN-Side' && angular.isDefined(n.subscriberTag)) {
currentNode.append('text').attr({
'text-anchor': 'middle',
y: 40
@@ -918,7 +923,7 @@
});
}
- if (n.name === 'WAN' && angular.isDefined(n.subscriberIP)) {
+ if (n.name === 'WAN-Side' && angular.isDefined(n.subscriberIP)) {
currentNode.append('text').attr({
'text-anchor': 'middle',
y: 40
@@ -1516,6 +1521,8 @@
var handleSvg = function handleSvg(el) {
+ d3.select($element[0]).select('svg').remove();
+
svg = d3.select(el).append('svg').style('width', el.clientWidth + 'px').style('height', el.clientHeight + 'px');
};
@@ -1553,6 +1560,12 @@
});
});
+ d3.select(window).on('resize.logic', function () {
+ handleSvg($element[0]);
+ LogicTopologyHelper.setupTree(svg);
+ LogicTopologyHelper.updateTree(svg);
+ });
+
handleSvg($element[0]);
LogicTopologyHelper.setupTree(svg);
@@ -1661,7 +1674,7 @@
'use strict';
angular.module('xos.diagnostic').constant('serviceTopologyConfig', {
- widthMargin: 20,
+ widthMargin: 60,
heightMargin: 30,
duration: 750,
elWidths: [20, 104, 105, 104, 20], //this is not true
@@ -1730,7 +1743,7 @@
computeNodes: [],
children: [{
name: 'LAN-Side',
- subtitle: 'Virtual Networks',
+ subtitle: 'Virtual Network',
type: 'network',
children: [{
name: 'Subscriber',
diff --git a/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml b/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml
index 66deed5..f575664 100644
--- a/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml
+++ b/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml
@@ -245,6 +245,10 @@
copy: src=/opt/xos/synchronizers/vcpe/files/etc/service/ dest=/var/container_volumes/{{ container_name }}/etc/service/ owner=root group=root
when: status != "enabled"
+ - name: make webserver script executable
+ file: path=/var/container_volumes/{{ container_name }}/etc/service/message/run mode=0755
+ when: status != "enabled"
+
- name: generate the message page
template: src=/opt/xos/synchronizers/vcpe/templates/message.html.j2 dest=/var/container_volumes/{{ container_name }}/etc/service/message/message.html owner=root group=root mode=0644
when: status != "enabled"