Skip to content

Commit

Permalink
Merge "Related-Bug:#1670560 Global Controller Dashboard UI Changes"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Apr 3, 2017
2 parents 283d679 + 054e537 commit 46525cd
Show file tree
Hide file tree
Showing 19 changed files with 1,012 additions and 44 deletions.
4 changes: 3 additions & 1 deletion webroot/common/ui/js/controller.app.js
Expand Up @@ -88,6 +88,7 @@ function getControllerAppPaths (ctBaseDir, ctBuildDir,env) {
'dbnode-scatterchart-view': ctWebDir + '/monitor/infrastructure/common/ui/js/views/DatabaseNodeScatterChartView',
'analyticsnode-scatterchart-view': ctWebDir + '/monitor/infrastructure/common/ui/js/views/AnalyticsNodeScatterChartView',
'vrouter-dashboard-view': ctWebDir + '/monitor/infrastructure/dashboard/ui/js/views/VRouterDashboardView',
'global-controller-viewconfig': ctWebDir + '/monitor/infrastructure/globalcontroller/ui/js/globalController.viewconfig',
'monitor-infra-viewconfig': ctWebDir + '/monitor/infrastructure/common/ui/js/monitor.infra.viewconfig',
'monitor-infra-parsers': ctWebDir + '/monitor/infrastructure/common/ui/js/utils/monitor.infra.parsers',
'monitor-infra-utils': ctWebDir + '/monitor/infrastructure/common/ui/js/utils/monitor.infra.utils',
Expand Down Expand Up @@ -124,7 +125,8 @@ function getControllerAppPaths (ctBaseDir, ctBuildDir,env) {
'controlnode-viewconfig': ctWebDir + '/monitor/infrastructure/controlnode/ui/js/controlnode.viewconfig',
'databasenode-viewconfig': ctWebDir + '/monitor/infrastructure/databasenode/ui/js/databasenode.viewconfig',
'vrouter-viewconfig': ctWebDir + '/monitor/infrastructure/vrouter/ui/js/vrouter.viewconfig',
'monitor-infra-viewconfig': ctWebDir + '/monitor/infrastructure/common/ui/js/monitor.infra.viewconfig'
'monitor-infra-viewconfig': ctWebDir + '/monitor/infrastructure/common/ui/js/monitor.infra.viewconfig',
'global-controller-viewconfig': ctWebDir + '/monitor/infrastructure/globalcontroller/ui/js/globalController.viewconfig'
}
}
};
Expand Down
1 change: 1 addition & 0 deletions webroot/common/ui/js/controller.constants.js
Expand Up @@ -193,6 +193,7 @@ define([
this.UCID_INSTANCE_CPU_MEMORY_LIST = this.UCID_PREFIX_MN_LISTS + "{0}:{1}:cpu-memory";

this.UCID_NODE_CPU_MEMORY_LIST = 'node_details' + "{0}:cpu-memory";
this.GLOBAL_CONTROLLER_NODESCOUNT = "global_controller_nodescnt";

this.GRAPH_DIR_LR = "LR";
this.GRAPH_DIR_TB = "TB";
Expand Down
22 changes: 22 additions & 0 deletions webroot/common/ui/js/controller.labels.js
Expand Up @@ -202,6 +202,28 @@ define([
this.MONITOR_INSTANCE_VIEW_ID = "monitor-instance-view";
this.MONITOR_FLOW_LIST_ID = "monitor-flow-list";
this.MONITOR_FLOWS_PAGE_ID = "monitor-flows-page";
//GLOBALCONTROLLER
this.GLOBAL_CONTROLER_LIST_VIEW_SECTION_ID = "global-controller-listview-sectionid";
this.GLOBAL_CONTROLLER_PREFIX_ID = "globalcontroller_prefix_id";
this.GLOBAL_CONTROLLER_REGION_BAR_SECTION_ID = "GLOBAL_CONTROLLER_REGION_BAR_SECTION_ID";
this.GLOBAL_CONTROLLER_REGION_SECTION_ID = "GLOBAL_CONTROLLER_REGION_SECTION_ID";
this.GLOBAL_CONTROLLER_CHARTVIEW_CPU_MAX = "globalcontroller_chartview_cpu_max";
this.GLOBAL_CONTROLLER_CHARTVIEW_CPU_MAX_SECTION = "globalcontroller_chartview_cpu_max_section";
this.GLOBAL_CONTROLLER_CHARTVIEW_MEMORY_MAX = "globalcontroller_chartview_memory_max";
this.GLOBAL_CONTROLLER_CHARTVIEW_MEMORY_MAX_SECTION = "globalcontroller_chartview_memory_max_section";
this.GLOBAL_CONTROLLER_CHARTVIEW_DISK_USAGE= "globalcontroller_chartview_disk_usage";
this.GLOBAL_CONTROLLER_CHARTVIEW_DISK_USAGE_SECTION= "globalcontroller_chartview_disk_usage_section";
this.GLOBALCONTROLLER_REGIONS_SUMMARY_URL =
'/api/tenant/networking/global-controller-overview?reqRegion=';
this.GLOBAL_CONTROLLER_CHARTS_URL = "/api/qe/query/?reqRegion=";
this.GLOBAL_CONTROLLER_SYSTEM_CPU_TITLE= "System CPU across all nodes (%)";
this.GLOBAL_CONTROLLER_SYSTEM_MAX_CPU_UTILIZATION= "Max CPU Utilization";
this.GLOBAL_CONTROLLER_SYSTEM_MEMORY_TITLE= "System Memory across all nodes";
this.GLOBAL_CONTROLLER_SYSTEM_MAX_MEMORY_UTILIZATION= "Max Memory Utilization";
this.GLOBAL_CONTROLLER_BANDWIDTH_IN_TITLE= "Bandwidth across all vRouters";
this.GLOBAL_CONTROLLER_SYSTEM_MAX_BANDWIDTH_IN= "Max Bandwidth In";
this.GLOBAL_CONTROLLER_DISK_USAGE_TITLE= "Disk Usage across all nodes";
this.GLOBAL_CONTROLLER_SYSTEM_CPU_UTILIZATION= "Max Disk Utilization";

this.DOMAINS_BREADCRUMB_DROPDOWN = "domains-breadcrumb-dropdown";
this.SASET_BREADCRUMB_DROPDOWN = "service-appliance-set-breadcrumb-dropdown";
Expand Down
79 changes: 79 additions & 0 deletions webroot/menu.xml
Expand Up @@ -48,6 +48,11 @@ and need to add the iconClass tag wherever we need to show some icons
<hash>mon_infra_dashboard</hash>
<label>Dashboard</label>
<searchStrings>Infrastructure Dashboard</searchStrings>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>.</rootDir>
Expand All @@ -68,6 +73,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item optional="true">
<hash>mon_infra_mx</hash>
<label>MX Visualisation</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infra/mx/ui</rootDir>
Expand All @@ -80,6 +90,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item optional="true">
<hash>mon_infra_underlay</hash>
<label>Physical Topology</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infrastructure/underlay/ui</rootDir>
Expand All @@ -92,6 +107,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item>
<hash>mon_infra_control</hash>
<label>Control Nodes</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infrastructure/controlnode/ui</rootDir>
Expand All @@ -105,6 +125,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item>
<hash>mon_infra_vrouter</hash>
<label>Virtual Routers</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infrastructure/vrouter/ui</rootDir>
Expand All @@ -118,6 +143,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item>
<hash>mon_infra_analytics</hash>
<label>Analytics Nodes</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infrastructure/analyticsnode/ui</rootDir>
Expand All @@ -131,6 +161,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item>
<hash>mon_infra_config</hash>
<label>Config Nodes</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infrastructure/confignode/ui</rootDir>
Expand All @@ -144,6 +179,11 @@ and need to add the iconClass tag wherever we need to show some icons
<item>
<hash>mon_infra_database</hash>
<label>Database Nodes</label>
<access>
<roles>
<role>cloudAdmin</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/infrastructure/databasenode/ui</rootDir>
Expand All @@ -157,9 +197,44 @@ and need to add the iconClass tag wherever we need to show some icons
</item>
</items>
</item>
<item>
<name>cgcinfrastrure</name>
<label>Infrastructure</label>
<iconClass>menu-icon fa fa-puzzle-piece</iconClass>
<access>
<orchModels>
<model>openstack</model>
<model>cloudstack</model>
</orchModels>
<roles>
<role>globalController</role>
</roles>
</access>
<items>
<item>
<label>Regions</label>
<hash>mon_gc_globalcontroller</hash>
<resources>
<resource>
<rootDir>/monitor/infrastructure/globalcontroller/ui</rootDir>
<js>globalControllerDashboard.main.js</js>
<class>globalControllerDashbaordLoader</class>
<function>renderCGCView</function>
</resource>
</resources>
<searchStrings>GlobalController, All regions</searchStrings>
</item>
</items>
</item>
<item>
<label>Networking</label>
<iconClass>menu-icon fa fa-sitemap</iconClass>
<access>
<roles>
<role>cloudAdmin</role>
<role>member</role>
</roles>
</access>
<resources>
<resource>
<rootDir>/monitor/networking/ui</rootDir>
Expand Down Expand Up @@ -244,6 +319,10 @@ and need to add the iconClass tag wherever we need to show some icons
<model>openstack</model>
<model>cloudstack</model>
</orchModels>
<roles>
<role>cloudAdmin</role>
<role>member</role>
</roles>
</access>
<items>
<item>
Expand Down
Expand Up @@ -55,7 +55,24 @@ define(['contrail-list-model'], function(ContrailListModel) {
'webServerInfo;sessionTimeout', 3600000)
}
};
return ContrailListModel(listModelConfig);
var globalcontrollerlistModelConfig = {
remote : {
ajaxConfig : {
url:monitorInfraConstants.monitorInfraUrls.VROUTER_CACHED_SUMMARY + '?forceRefresh',
timeout : 300000
},
dataParser : monitorInfraParsers.parsevRoutersDashboardData,
},
vlRemoteConfig: vlRemoteConfig,
cacheConfig : {}
};
//Use the globalcontroller modelconfig if the cgcEnabled is true
if(globalObj.webServerInfo.cgcEnabled === true){
return ContrailListModel(globalcontrollerlistModelConfig);
}
else{
return ContrailListModel(listModelConfig);
}
};
return VRouterListModel;
});
Expand Up @@ -6,14 +6,21 @@ define(
[ 'underscore' ],
function(_) {
var NodeColorMapping = function() {
var nodeColorMap = {},
lastUpdated;


var lastUpdated;
var regionList = [];
this.getNodeColorMap = function (hostNames, resetColor) {
var region = contrail.getCookie('region');
if(region == null) {
region = "####Default";
}
if (regionList[region] == null) {
regionList[region] = {
nodeColorMap:{}
}
};
var self = this,
colors = cowc.FIVE_NODE_COLOR,
assignedColors = _.values(nodeColorMap);
assignedColors = _.values(regionList[region].nodeColorMap);
if (!$.isArray(hostNames)) {
hostNames = [hostNames];
}
Expand All @@ -28,12 +35,12 @@ define(
// color settings then we need to overwrite the existing
// colors in nodecolormap
if (resetColor) {
var existingNodes = _.keys(nodeColorMap),
var existingNodes = _.keys(regionList[region].nodeColorMap),
existingNodesLen = existingNodes.length;
//TODO overwrite the colors with the cookie colors
colors = cowc.FIVE_NODE_COLOR;
for (var i = 0; i < existingNodesLen; i++) {
nodeColorMap[existingNodes[i]] = cowu.ifNull(colors[i], cowc.DEFAULT_COLOR);
regionList[region].nodeColorMap[existingNodes[i]] = cowu.ifNull(colors[i], cowc.DEFAULT_COLOR);
}
}
//if hostname doesn't exists in nodeColorMap
Expand All @@ -42,13 +49,13 @@ define(
//keys = _.sortBy(keys);
var i = 0, unassignedColors = _.difference(colors, assignedColors);
$.each(keys, function (idx, obj) {
if (nodeColorMap[obj] == null) {
nodeColorMap[obj] = unassignedColors[i] != null ? unassignedColors[i]:
if (regionList[region].nodeColorMap[obj] == null) {
regionList[region].nodeColorMap[obj] = unassignedColors[i] != null ? unassignedColors[i]:
($.isArray(cowc.DEFAULT_COLOR) ? cowc.DEFAULT_COLOR[0] : cowc.DEFAULT_COLOR);
i++;
}
});
return nodeColorMap;
return regionList[region].nodeColorMap;
};
};
return NodeColorMapping;
Expand Down
Expand Up @@ -137,6 +137,7 @@ define([

this.VROUTER_FLOWS_CHART_COLORS = ['#6f97ae','#d95436'];
this.VROUTER_DROP_PACKETS_COLORS = ['#d95436'];
this.GLOBAL_CONTROLLER_CHART_COLOR = ['#72a9d0'];

this.dropStatsKeyList = [
"discard",
Expand Down
Expand Up @@ -7,10 +7,10 @@ var controllerInfraDashboardLoader = new ControllerInfraDashboardLoader();

function ControllerInfraDashboardLoader() {
this.load = function (paramObject) {
var self = this,
var self = this,
hashParams = paramObject['hashParams'],
renderFn = paramObject['function'];

$("#page-content").css("padding","2px 10px 5px");
if(monInfraDashboardLoader.loadedControllerInfoboxes != true) {
monInfraDashboardLoader.loadedControllerInfoboxes = true;
require(['mon-infra-dashboard-view'],function() {
Expand All @@ -23,7 +23,6 @@ function ControllerInfraDashboardLoader() {
});
}
};

this.destroy = function() {
}
}
Expand Down

0 comments on commit 46525cd

Please sign in to comment.