Fixed customer care label position
diff --git a/views/ngXosViews/diagnostic/env/onlab_pod.js b/views/ngXosViews/diagnostic/env/onlab_pod.js
index 413bd04..42211be 100644
--- a/views/ngXosViews/diagnostic/env/onlab_pod.js
+++ b/views/ngXosViews/diagnostic/env/onlab_pod.js
@@ -8,6 +8,6 @@
module.exports = {
host: 'http://10.90.0.132/',
- xoscsrftoken: 'bDZaZNRDU6BwUanvjfcGfKJHohG3mlqb',
- xossessionid: '3nww58wgrlscs7boy2xzw11tji8ywal5'
+ xoscsrftoken: 'JmfZETFs72GiVGxIJkCPSrybZvTtJLwF',
+ xossessionid: 'jmf3z9wat049cmrh91ppg37pn4yj3830'
};
diff --git a/views/ngXosViews/diagnostic/src/js/chart_data_service.js b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
index 19825a1..5d65b2b 100644
--- a/views/ngXosViews/diagnostic/src/js/chart_data_service.js
+++ b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
@@ -203,8 +203,7 @@
p = Tenant.queryVsgInstances(param[service.name]).$promise
.then((instances) => {
-
- return Ceilometer.getInstancesStats(instances);
+ return Ceilometer.getInstancesStats(lodash.uniq(instances));
});
}
diff --git a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
index 6ac0342..29972fb 100644
--- a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
+++ b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
@@ -315,19 +315,65 @@
// NOTE this should be dinamically positioned
// base on the number of element present
+
+ // fake the position
+ let translation = {
+ 'mysite_vsg-1': '200, -120',
+ 'mysite_vsg-2': '-300, 30',
+ 'mysite_vsg-3': '-300, -250',
+ };
+
const statsContainer = container.append('g')
.attr({
- transform: `translate(200, -120)`,
+ transform: `translate(${translation[instance.humanReadableName]})`,
class: 'stats-container'
+ })
+ .on('click', function(d) {
+ // toggling visisbility
+ d.fade = !d.fade;
+ let opacity;
+ if(d.fade){
+ opacity = 0.1;
+ }
+ else{
+ opacity = 1;
+ }
+
+ d3.select(this)
+ .transition()
+ .duration(serviceTopologyConfig.duration)
+ .attr({
+ opacity: opacity
+ })
});
-
- statsContainer.append('line')
- .attr({
+ let lines = {
+ 'mysite_vsg-1': {
x1: -160,
y1: 120,
x2: 0,
y2: 50,
+ },
+ 'mysite_vsg-2': {
+ x1: 250,
+ y1: 50,
+ x2: 300,
+ y2: -10
+ },
+ 'mysite_vsg-3': {
+ x1: 250,
+ y1: 50,
+ x2: 300,
+ y2: 270
+ }
+ }
+
+ statsContainer.append('line')
+ .attr({
+ x1: d => lines[d.humanReadableName].x1,
+ y1: d => lines[d.humanReadableName].y1,
+ x2: d => lines[d.humanReadableName].x2,
+ y2: d => lines[d.humanReadableName].y2,
stroke: 'black',
opacity: 0
})
@@ -345,7 +391,7 @@
statsHeight += serviceTopologyConfig.container.height + (serviceTopologyConfig.container.margin * 2)
}
- statsContainer.append('rect')
+ const statsVignette = statsContainer.append('rect')
.attr({
width: statsWidth,
height: statsHeight,
@@ -357,6 +403,7 @@
opacity: 1
});
+
// add instance info
statsContainer.append('text')
.attr({
@@ -387,22 +434,27 @@
})
// add stats
- const interestingMeters = ['memory', 'memory.usage', 'cpu', 'vcpus'];
+ const interestingMeters = ['memory', 'memory.usage', 'cpu', 'cpu_util'];
interestingMeters.forEach((m, i) => {
const meter = lodash.find(instance.stats, {meter: m});
- statsContainer.append('text')
- .attr({
- y: 55 + (i * 15),
- x: serviceTopologyConfig.instance.margin,
- opacity: 0
- })
- .text(`${meter.description}: ${Math.round(meter.value)} ${meter.unit}`)
- .transition()
- .duration(serviceTopologyConfig.duration)
- .attr({
- opacity: 1
- });
+
+ if(meter){
+
+ statsContainer.append('text')
+ .attr({
+ y: 55 + (i * 15),
+ x: serviceTopologyConfig.instance.margin,
+ opacity: 0
+ })
+ .text(`${meter.description}: ${Math.round(meter.value)} ${meter.unit}`)
+ .transition()
+ .duration(serviceTopologyConfig.duration)
+ .attr({
+ opacity: 1
+ });
+ }
+
});
if(instance.container){
@@ -471,10 +523,10 @@
}
});
- instanceContainer
- .on('click', function(d){
- console.log(`Draw vignette with stats for instance: ${d.name}`);
- });
+ // instanceContainer
+ // .on('click', function(d){
+ // console.log(`Draw vignette with stats for instance: ${d.name}`);
+ // });
};
this.addPhisical = (nodes) => {
diff --git a/xos/core/static/observer_status.js b/xos/core/static/observer_status.js
index cb4fb5b..c6cc570 100644
--- a/xos/core/static/observer_status.js
+++ b/xos/core/static/observer_status.js
@@ -11,6 +11,7 @@
icon = "/static/img/green-cloud.gif";
} else {
tooltip = "observer is offline";
+ // icon = "/static/img/red-cloud.gif";
icon = "/static/img/green-cloud.gif";
}
diff --git a/xos/core/xoslib/static/js/xosDiagnostic.js b/xos/core/xoslib/static/js/xosDiagnostic.js
index 48ddac4..f36c8ed 100644
--- a/xos/core/xoslib/static/js/xosDiagnostic.js
+++ b/xos/core/xoslib/static/js/xosDiagnostic.js
@@ -1155,16 +1155,66 @@
// NOTE this should be dinamically positioned
// base on the number of element present
+
+ // fake the position
+ var translation = {
+ 'mysite_vsg-1': '200, -120',
+ 'mysite_vsg-2': '-300, 30',
+ 'mysite_vsg-3': '-300, -250'
+ };
+
var statsContainer = container.append('g').attr({
- transform: 'translate(200, -120)',
+ transform: 'translate(' + translation[instance.humanReadableName] + ')',
'class': 'stats-container'
+ }).on('click', function (d) {
+ // toggling visisbility
+ d.fade = !d.fade;
+ var opacity = undefined;
+ if (d.fade) {
+ opacity = 0.1;
+ } else {
+ opacity = 1;
+ }
+
+ d3.select(this).transition().duration(serviceTopologyConfig.duration).attr({
+ opacity: opacity
+ });
});
+ var lines = {
+ 'mysite_vsg-1': {
+ x1: -160,
+ y1: 120,
+ x2: 0,
+ y2: 50
+ },
+ 'mysite_vsg-2': {
+ x1: 250,
+ y1: 50,
+ x2: 300,
+ y2: -10
+ },
+ 'mysite_vsg-3': {
+ x1: 250,
+ y1: 50,
+ x2: 300,
+ y2: 270
+ }
+ };
+
statsContainer.append('line').attr({
- x1: -160,
- y1: 120,
- x2: 0,
- y2: 50,
+ x1: function x1(d) {
+ return lines[d.humanReadableName].x1;
+ },
+ y1: function y1(d) {
+ return lines[d.humanReadableName].y1;
+ },
+ x2: function x2(d) {
+ return lines[d.humanReadableName].x2;
+ },
+ y2: function y2(d) {
+ return lines[d.humanReadableName].y2;
+ },
stroke: 'black',
opacity: 0
}).transition().duration(serviceTopologyConfig.duration).attr({
@@ -1179,7 +1229,7 @@
statsHeight += serviceTopologyConfig.container.height + serviceTopologyConfig.container.margin * 2;
}
- statsContainer.append('rect').attr({
+ var statsVignette = statsContainer.append('rect').attr({
width: statsWidth,
height: statsHeight,
opacity: 0
@@ -1207,17 +1257,21 @@
});
// add stats
- var interestingMeters = ['memory', 'memory.usage', 'cpu', 'vcpus'];
+ var interestingMeters = ['memory', 'memory.usage', 'cpu', 'cpu_util'];
interestingMeters.forEach(function (m, i) {
var meter = lodash.find(instance.stats, { meter: m });
- statsContainer.append('text').attr({
- y: 55 + i * 15,
- x: serviceTopologyConfig.instance.margin,
- opacity: 0
- }).text(meter.description + ': ' + Math.round(meter.value) + ' ' + meter.unit).transition().duration(serviceTopologyConfig.duration).attr({
- opacity: 1
- });
+
+ if (meter) {
+
+ statsContainer.append('text').attr({
+ y: 55 + i * 15,
+ x: serviceTopologyConfig.instance.margin,
+ opacity: 0
+ }).text(meter.description + ': ' + Math.round(meter.value) + ' ' + meter.unit).transition().duration(serviceTopologyConfig.duration).attr({
+ opacity: 1
+ });
+ }
});
if (instance.container) {
@@ -1282,9 +1336,10 @@
}
});
- instanceContainer.on('click', function (d) {
- console.log('Draw vignette with stats for instance: ' + d.name);
- });
+ // instanceContainer
+ // .on('click', function(d){
+ // console.log(`Draw vignette with stats for instance: ${d.name}`);
+ // });
};
this.addPhisical = function (nodes) {
@@ -1923,8 +1978,7 @@
};
p = Tenant.queryVsgInstances(param[service.name]).$promise.then(function (instances) {
-
- return Ceilometer.getInstancesStats(instances);
+ return Ceilometer.getInstancesStats(lodash.uniq(instances));
});
}
diff --git a/xos/synchronizers/vcpe/files/etc/service/message/run b/xos/synchronizers/vcpe/files/etc/service/message/run
index 59c2759..2f3b563 100755
--- a/xos/synchronizers/vcpe/files/etc/service/message/run
+++ b/xos/synchronizers/vcpe/files/etc/service/message/run
@@ -1,15 +1,20 @@
#!/usr/bin/python
import BaseHTTPServer
+
+
class HTTPHandlerOne(BaseHTTPServer.BaseHTTPRequestHandler):
- def do_GET(self):
- with open('./message.html', 'r') as msgfile:
- message = msgfile.read()
- self.wfile.write(message)
+ def do_GET(self):
+ # with open('./message.html', 'r') as msgfile:
+ with open('../../../../templates/message.html.j2', 'r') as msgfile:
+ message = msgfile.read()
+ self.wfile.write(message)
+
def run(server_class=BaseHTTPServer.HTTPServer,
handler_class=BaseHTTPServer.BaseHTTPRequestHandler):
- server_address = ('192.168.0.1', 8000)
+ # server_address = ('192.168.0.1', 8000)
+ server_address = ('127.0.0.1', 8000)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()