updated diagnostic dashboard
diff --git a/views/ngXosViews/diagnostic/bower.json b/views/ngXosViews/diagnostic/bower.json
index edf419d..afb3524 100644
--- a/views/ngXosViews/diagnostic/bower.json
+++ b/views/ngXosViews/diagnostic/bower.json
@@ -26,7 +26,6 @@
"angular-ui-router": "~0.2.15",
"angular-cookies": "~1.4.7",
"angular-resource": "~1.4.7",
- "ng-lodash": "~0.3.0",
"bootstrap-css": "~3.3.6"
}
}
diff --git a/views/ngXosViews/diagnostic/src/js/chart_data_service.js b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
index ff2d31b..63923e8 100644
--- a/views/ngXosViews/diagnostic/src/js/chart_data_service.js
+++ b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
@@ -2,7 +2,7 @@
'use strict';
angular.module('xos.diagnostic')
- .service('ChartData', function($rootScope, $q, lodash, Tenant, Node, serviceTopologyConfig, Ceilometer, Instances) {
+ .service('ChartData', function($rootScope, $q, _, Tenant, Node, serviceTopologyConfig, Ceilometer, Instances) {
this.currentSubscriber = null;
this.currentServiceChain = null;
@@ -133,7 +133,7 @@
});
});
- lodash.forEach(instances, (instance) => {
+ _.forEach(instances, (instance) => {
computeNodes.map((node) => {
node.instances.map((d3instance) => {
if(d3instance.id === instance.id){
@@ -207,7 +207,7 @@
p = Tenant.queryVsgInstances(param[service.name]).$promise
.then((instances) => {
- return Ceilometer.getInstancesStats(lodash.uniq(instances));
+ return Ceilometer.getInstancesStats(_.uniq(instances));
});
}
diff --git a/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js b/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js
index 51ac0f7..6c85cdf 100644
--- a/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js
+++ b/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js
@@ -2,7 +2,7 @@
'use strict';
angular.module('xos.diagnostic')
- .service('LogicTopologyHelper', function($window, $log, $rootScope, lodash, serviceTopologyConfig, NodeDrawer, ChartData){
+ .service('LogicTopologyHelper', function($window, $log, $rootScope, _, serviceTopologyConfig, NodeDrawer, ChartData){
var diagonal, nodes, links, i = 0, svgWidth, svgHeight, layout;
@@ -21,18 +21,18 @@
let xPos = [];
- let totalElWidth = lodash.reduce(serviceTopologyConfig.elWidths, (el, val) => val + el, 0);
+ let totalElWidth = _.reduce(serviceTopologyConfig.elWidths, (el, val) => val + el, 0);
let remainingSpace = svgWidth - totalElWidth - (serviceTopologyConfig.widthMargin * 2);
let step = remainingSpace / (serviceTopologyConfig.elWidths.length - 1);
- lodash.forEach(serviceTopologyConfig.elWidths, (el, i) => {
+ _.forEach(serviceTopologyConfig.elWidths, (el, i) => {
// get half of the previous elements width
let previousElWidth = 0;
if(i !== 0){
- previousElWidth = lodash.reduce(serviceTopologyConfig.elWidths.slice(0, i), (el, val) => val + el, 0);
+ previousElWidth = _.reduce(serviceTopologyConfig.elWidths.slice(0, i), (el, val) => val + el, 0);
}
let elPos =
diff --git a/views/ngXosViews/diagnostic/src/js/main.js b/views/ngXosViews/diagnostic/src/js/main.js
index 73cd3d9..210606a 100644
--- a/views/ngXosViews/diagnostic/src/js/main.js
+++ b/views/ngXosViews/diagnostic/src/js/main.js
@@ -4,7 +4,6 @@
angular.module('xos.diagnostic', [
'ngResource',
'ngCookies',
- 'ngLodash',
'ngAnimate',
'ui.router',
'xos.helpers'
diff --git a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
index 514f114..a24483f 100644
--- a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
+++ b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
@@ -9,7 +9,7 @@
var instanceId = 0;
angular.module('xos.diagnostic')
- .service('NodeDrawer', function(d3, serviceTopologyConfig, RackHelper, lodash){
+ .service('NodeDrawer', function(d3, serviceTopologyConfig, RackHelper, _){
var _this = this;
@@ -245,7 +245,7 @@
const interestingMeters = ['memory', 'memory.usage', 'cpu_util'];
interestingMeters.forEach((m, i) => {
- const meter = lodash.find(docker.stats, {meter: m});
+ const meter = _.find(docker.stats, {meter: m});
// if there is no meter stats skip rendering
if(!angular.isDefined(meter)){
return;
@@ -294,7 +294,7 @@
interestingPortMeters.forEach((m, i) => {
- const meter = lodash.find(docker.port[p], {meter: m.meter});
+ const meter = _.find(docker.port[p], {meter: m.meter});
// if there is no meter stats skip rendering
if(!angular.isDefined(meter)){
return;
@@ -441,7 +441,7 @@
const interestingMeters = ['memory', 'memory.usage', 'cpu', 'cpu_util'];
interestingMeters.forEach((m, i) => {
- const meter = lodash.find(instance.stats, {meter: m});
+ const meter = _.find(instance.stats, {meter: m});
if(meter){
diff --git a/views/ngXosViews/diagnostic/src/js/rackHelper.js b/views/ngXosViews/diagnostic/src/js/rackHelper.js
index 17eb0db..af3eb30 100644
--- a/views/ngXosViews/diagnostic/src/js/rackHelper.js
+++ b/views/ngXosViews/diagnostic/src/js/rackHelper.js
@@ -1,6 +1,6 @@
(function () {
angular.module('xos.diagnostic')
- .service('RackHelper', function(serviceTopologyConfig, lodash){
+ .service('RackHelper', function(serviceTopologyConfig, _){
this.getComputeNodeLabelSize = () => {
return serviceTopologyConfig.computeNode.labelHeight + (serviceTopologyConfig.instance.margin * 2)
@@ -11,7 +11,7 @@
* They are placed in rows of 2 with 5px margin on each side.
*/
- this.getComputeNodeSize = lodash.memoize((instances) => {
+ this.getComputeNodeSize = _.memoize((instances) => {
const width = (serviceTopologyConfig.instance.margin * 3) + (serviceTopologyConfig.instance.width *2);
const rows = Math.round(instances.length / 2);
@@ -32,7 +32,7 @@
let width = 0;
let height = serviceTopologyConfig.computeNode.margin;
- lodash.forEach(nodes, (node) => {
+ _.forEach(nodes, (node) => {
let [nodeWidth, nodeHeight] = this.getComputeNodeSize(node.instances);
width = nodeWidth + (serviceTopologyConfig.computeNode.margin * 2);
@@ -69,7 +69,7 @@
const x = serviceTopologyConfig.computeNode.margin;
- let previousElEight = lodash.reduce(nodes.slice(0, position), (val, node) => {
+ let previousElEight = _.reduce(nodes.slice(0, position), (val, node) => {
return val + this.getComputeNodeSize(node.instances)[1]
}, 0);
diff --git a/views/ngXosViews/diagnostic/src/js/rest_services.js b/views/ngXosViews/diagnostic/src/js/rest_services.js
index 8f3992f..d8dfaf3 100644
--- a/views/ngXosViews/diagnostic/src/js/rest_services.js
+++ b/views/ngXosViews/diagnostic/src/js/rest_services.js
@@ -238,7 +238,7 @@
.service('SubscriberDevice', function($resource){
return $resource('/xoslib/rs/subscriber/:id/users/', {id: '@id'});
})
- .service('ServiceRelation', function($q, lodash, Services, Tenant, Slice, Instances){
+ .service('ServiceRelation', function($q, _, Services, Tenant, Slice, Instances){
// count the mas depth of an object
const depthOf = (obj) => {
@@ -256,13 +256,13 @@
// find all the relation defined for a given root
const findLevelRelation = (tenants, rootId) => {
- return lodash.filter(tenants, service => {
+ return _.filter(tenants, service => {
return service.subscriber_service === rootId;
});
};
const findSpecificInformation = (tenants, rootId) => {
- var tenants = lodash.filter(tenants, service => {
+ var tenants = _.filter(tenants, service => {
return service.provider_service === rootId && service.subscriber_tenant;
});
@@ -280,8 +280,8 @@
// find all the service defined by a given array of relations
const findLevelServices = (relations, services) => {
const levelServices = [];
- lodash.forEach(relations, (tenant) => {
- var service = lodash.find(services, {id: tenant.provider_service});
+ _.forEach(relations, (tenant) => {
+ var service = _.find(services, {id: tenant.provider_service});
levelServices.push(service);
});
return levelServices;
@@ -291,7 +291,7 @@
// build an array of unlinked services
// these are the services that should still placed in the tree
- var unlinkedServices = lodash.difference(services, [rootService]);
+ var unlinkedServices = _.difference(services, [rootService]);
// find all relations relative to this rootElement
const levelRelation = findLevelRelation(tenants, rootService.id);
@@ -299,7 +299,7 @@
const levelServices = findLevelServices(levelRelation, services);
// remove this item from the list (performance
- unlinkedServices = lodash.difference(unlinkedServices, levelServices);
+ unlinkedServices = _.difference(unlinkedServices, levelServices);
rootService.service_specific_attribute = findSpecificInformation(tenants, rootService.id);
@@ -316,12 +316,12 @@
children: []
};
- lodash.forEach(levelServices, (service) => {
+ _.forEach(levelServices, (service) => {
if(service.humanReadableName === 'service_ONOS_vBNG' || service.humanReadableName === 'service_ONOS_vOLT'){
// remove ONOSes from service chart
return;
}
- let tenant = lodash.find(tenants, {subscriber_tenant: rootTenant.id, provider_service: service.id});
+ let tenant = _.find(tenants, {subscriber_tenant: rootTenant.id, provider_service: service.id});
tree.children.push(buildLevel(tenants, unlinkedServices, service, tenant, rootService.humanReadableName));
});
@@ -342,8 +342,8 @@
// find the root service
// it is the one attached to subsriber_root
// as now we have only one root so this can work
- const rootTenant = lodash.find(tenants, {subscriber_root: subscriber.id});
- const rootService = lodash.find(services, {id: rootTenant.provider_service});
+ const rootTenant = _.find(tenants, {subscriber_root: subscriber.id});
+ const rootService = _.find(services, {id: rootTenant.provider_service});
const serviceTree = buildLevel(tenants, services, rootService, rootTenant);
@@ -372,9 +372,9 @@
service: currentService
};
- let tenant = lodash.find(tenants, {subscriber_service: currentService.id});
+ let tenant = _.find(tenants, {subscriber_service: currentService.id});
if(tenant){
- let next = lodash.find(services, {id: tenant.provider_service});
+ let next = _.find(services, {id: tenant.provider_service});
response.children = [buildChild(services, tenants, next)];
}
else {
@@ -390,7 +390,7 @@
return response;
}
- let baseService = lodash.find(services, {id: 3});
+ let baseService = _.find(services, {id: 3});
if(!angular.isDefined(baseService)){
console.error('Missing Base service!');
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js b/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
index bb7ba5d..c903b3b 100644
--- a/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
@@ -2,7 +2,7 @@
'use strict';
angular.module('xos.diagnostic')
- .service('ServiceTopologyHelper', function($rootScope, $window, $log, lodash, ServiceRelation, serviceTopologyConfig, d3){
+ .service('ServiceTopologyHelper', function($rootScope, $window, $log, _, ServiceRelation, serviceTopologyConfig, d3){
var _svg, _layout, _source, _el;