diff --git a/webroot/common/ui/js/controller.app.js b/webroot/common/ui/js/controller.app.js
index 1ef18e208..6114b76e7 100644
--- a/webroot/common/ui/js/controller.app.js
+++ b/webroot/common/ui/js/controller.app.js
@@ -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',
@@ -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'
}
}
};
diff --git a/webroot/common/ui/js/controller.constants.js b/webroot/common/ui/js/controller.constants.js
index 6153dad93..0dc727e09 100644
--- a/webroot/common/ui/js/controller.constants.js
+++ b/webroot/common/ui/js/controller.constants.js
@@ -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";
diff --git a/webroot/common/ui/js/controller.labels.js b/webroot/common/ui/js/controller.labels.js
index 4890cd3ed..7caf736c9 100644
--- a/webroot/common/ui/js/controller.labels.js
+++ b/webroot/common/ui/js/controller.labels.js
@@ -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";
diff --git a/webroot/menu.xml b/webroot/menu.xml
index bd56502c4..6b0d042f1 100644
--- a/webroot/menu.xml
+++ b/webroot/menu.xml
@@ -48,6 +48,11 @@ and need to add the iconClass tag wherever we need to show some icons
mon_infra_dashboard
Infrastructure Dashboard
+
+
+ cloudAdmin
+
+
.
@@ -68,6 +73,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_mx
+
+
+ cloudAdmin
+
+
/monitor/infra/mx/ui
@@ -80,6 +90,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_underlay
+
+
+ cloudAdmin
+
+
/monitor/infrastructure/underlay/ui
@@ -92,6 +107,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_control
+
+
+ cloudAdmin
+
+
/monitor/infrastructure/controlnode/ui
@@ -105,6 +125,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_vrouter
+
+
+ cloudAdmin
+
+
/monitor/infrastructure/vrouter/ui
@@ -118,6 +143,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_analytics
+
+
+ cloudAdmin
+
+
/monitor/infrastructure/analyticsnode/ui
@@ -131,6 +161,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_config
+
+
+ cloudAdmin
+
+
/monitor/infrastructure/confignode/ui
@@ -144,6 +179,11 @@ and need to add the iconClass tag wherever we need to show some icons
-
mon_infra_database
+
+
+ cloudAdmin
+
+
/monitor/infrastructure/databasenode/ui
@@ -157,9 +197,44 @@ and need to add the iconClass tag wherever we need to show some icons
+ -
+ cgcinfrastrure
+
+ menu-icon fa fa-puzzle-piece
+
+
+ openstack
+ cloudstack
+
+
+ globalController
+
+
+
+
-
+
+ mon_gc_globalcontroller
+
+
+ /monitor/infrastructure/globalcontroller/ui
+ globalControllerDashboard.main.js
+ globalControllerDashbaordLoader
+ renderCGCView
+
+
+ GlobalController, All regions
+
+
+
-
menu-icon fa fa-sitemap
+
+
+ cloudAdmin
+ member
+
+
/monitor/networking/ui
@@ -244,6 +319,10 @@ and need to add the iconClass tag wherever we need to show some icons
openstack
cloudstack
+
+ cloudAdmin
+ member
+
-
diff --git a/webroot/monitor/infrastructure/common/ui/js/models/VRouterListModel.js b/webroot/monitor/infrastructure/common/ui/js/models/VRouterListModel.js
index 03fbb9154..b372cf010 100644
--- a/webroot/monitor/infrastructure/common/ui/js/models/VRouterListModel.js
+++ b/webroot/monitor/infrastructure/common/ui/js/models/VRouterListModel.js
@@ -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;
});
diff --git a/webroot/monitor/infrastructure/common/ui/js/utils/NodeColorMapping.js b/webroot/monitor/infrastructure/common/ui/js/utils/NodeColorMapping.js
index bc7feb0f3..7292191fc 100644
--- a/webroot/monitor/infrastructure/common/ui/js/utils/NodeColorMapping.js
+++ b/webroot/monitor/infrastructure/common/ui/js/utils/NodeColorMapping.js
@@ -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];
}
@@ -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
@@ -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;
diff --git a/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.constants.js b/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.constants.js
index cfc8ec158..2223ab5e5 100644
--- a/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.constants.js
+++ b/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.constants.js
@@ -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",
diff --git a/webroot/monitor/infrastructure/dashboard/ui/js/controllerInfraDashboard.main.js b/webroot/monitor/infrastructure/dashboard/ui/js/controllerInfraDashboard.main.js
index 94a9d2ba4..445caa585 100644
--- a/webroot/monitor/infrastructure/dashboard/ui/js/controllerInfraDashboard.main.js
+++ b/webroot/monitor/infrastructure/dashboard/ui/js/controllerInfraDashboard.main.js
@@ -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() {
@@ -23,7 +23,6 @@ function ControllerInfraDashboardLoader() {
});
}
};
-
this.destroy = function() {
}
}
diff --git a/webroot/monitor/infrastructure/globalcontroller/api/globalcontroller.api.js b/webroot/monitor/infrastructure/globalcontroller/api/globalcontroller.api.js
index 115044834..8d5a3165a 100644
--- a/webroot/monitor/infrastructure/globalcontroller/api/globalcontroller.api.js
+++ b/webroot/monitor/infrastructure/globalcontroller/api/globalcontroller.api.js
@@ -28,22 +28,21 @@ var rest = require(process.mainModule.exports["corePath"] +
function getGlobalControllerOverview (req, res, appData)
{
var dataObjArr = [];
- var reqUrl = "/analytics/uves/vrouters";
var resultJSON = {};
+ var reqUrl = "/analytics/uves/vrouter/*?flat&cfilt=UVEAlarms,ContrailConfig";
commonUtils.createReqObj(dataObjArr, reqUrl, null, null, opApiServer, null,
appData);
- reqUrl = "/analytics/uves/control-nodes";
+ reqUrl = "/analytics/uves/control-node/*?flat&cfilt=UVEAlarms,ContrailConfig";
commonUtils.createReqObj(dataObjArr, reqUrl, null, null, opApiServer, null,
appData);
- reqUrl = "/analytics/uves/analytics-node";
- var anaPostData = {};
- anaPostData["cfilt"] = ["CollectorState:self_ip_list", "ContrailConfig"];
- commonUtils.createReqObj(dataObjArr, reqUrl, global.HTTP_REQUEST_POST,
- anaPostData, opApiServer, null, appData);
- reqUrl = "/analytics/uves/config-nodes";
+ reqUrl = "/analytics/uves/analytics-node/*?flat&cfilt=UVEAlarms,CollectorState:self_ip_list,ContrailConfig";
+ commonUtils.createReqObj(dataObjArr, reqUrl, null, null, opApiServer, null,
+ appData);
+
+ reqUrl = "/analytics/uves/config-node/*?flat&cfilt=UVEAlarms,ContrailConfig";
commonUtils.createReqObj(dataObjArr, reqUrl, null, null, opApiServer, null,
appData);
- reqUrl = "/analytics/uves/database-nodes";
+ reqUrl = "/analytics/uves/database-node/*?flat&cfilt=UVEAlarms,ContrailConfig";
commonUtils.createReqObj(dataObjArr, reqUrl, null, null, opApiServer, null,
appData);
reqUrl = "/analytics/uves/virtual-machines";
@@ -61,28 +60,39 @@ function getGlobalControllerOverview (req, res, appData)
reqUrl = "/analytics/alarms";
commonUtils.createReqObj(dataObjArr, reqUrl, null, null, opApiServer, null,
appData);
+ reqUrl = "/virtual-networks";
+ commonUtils.createReqObj(dataObjArr, reqUrl, null, null, configApiServer, null,
+ appData);
async.map(dataObjArr,
commonUtils.getServerResponseByRestApi(opApiServer, true),
function(err, results) {
- var vrNodes = commonUtils.getValueByJsonPath(results, "0", []);
- var controlNodes = commonUtils.getValueByJsonPath(results, "1", []);
- var anaNodes = commonUtils.getValueByJsonPath(results, "2;value", []);
- var configNodes = commonUtils.getValueByJsonPath(results, "3", []);
- var databaseNodes = commonUtils.getValueByJsonPath(results, "4", []);
+ var vrNodes = commonUtils.getValueByJsonPath(results, "0;value", []);
+ var controlNodes = commonUtils.getValueByJsonPath(results, "1;value", []);
+ var analyticsNodes = commonUtils.getValueByJsonPath(results, "2;value", []);
+ var configNodes = commonUtils.getValueByJsonPath(results, "3;value", []);
+ var databaseNodes = commonUtils.getValueByJsonPath(results, "4;value", []);
var vms = commonUtils.getValueByJsonPath(results, "5", []);
var vmis = commonUtils.getValueByJsonPath(results, "6", []);
var svcInsts = commonUtils.getValueByJsonPath(results, "7", []);
var fips = commonUtils.getValueByJsonPath(results, "8;floating-ips", []);
var alarms = commonUtils.getValueByJsonPath(results, "9", {});
- resultJSON["vrNodesCnt"] = vrNodes.length;
+ var vns = commonUtils.getValueByJsonPath(results, "10;virtual-networks", []);
+
+ resultJSON["vRoutersCnt"] = vrNodes.length;
+ resultJSON['vRoutersNodes'] = vrNodes;
resultJSON["controlNodesCnt"] = controlNodes.length;
- resultJSON["anaNodesCnt"] = anaNodes.length;
+ resultJSON["controlNodes"] = controlNodes;
+ resultJSON["analyticsNodesCnt"] = analyticsNodes.length;
+ resultJSON["analyticsNodes"] = analyticsNodes;
resultJSON["configNodesCnt"] = configNodes.length;
+ resultJSON["configNodes"] = configNodes;
resultJSON["databaseNodesCnt"] = databaseNodes.length;
+ resultJSON["databaseNodes"] = databaseNodes;
resultJSON["vmCnt"] = vms.length;
resultJSON["vmiCnt"] = vmis.length;
resultJSON["svcInstsCnt"] = svcInsts.length;
resultJSON["fipsCnt"] = fips.length;
+ resultJSON["vnCnt"] = vns.length;
var alarmsCnt = 0;
for (var key in alarms) {
var alarmTypes = alarms[key];
@@ -91,13 +101,18 @@ function getGlobalControllerOverview (req, res, appData)
var alrms = commonUtils.getValueByJsonPath(alarmTypes,
i + ";value;UVEAlarms;alarms",
[]);
- alarmsCnt += alrms.length;
+ var unackedCnt = 0;
+ _.each(alrms, function(alrm,key) {
+ if(!alrm.ack) {
+ unackedCnt++;
+ }
+ });
+ alarmsCnt += unackedCnt;
}
}
resultJSON["alarmsCnt"] = alarmsCnt;
commonUtils.handleJSONResponse(null, res, resultJSON);
});
}
-
exports.getGlobalControllerOverview = getGlobalControllerOverview;
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/globalController.viewconfig.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/globalController.viewconfig.js
new file mode 100644
index 000000000..2bd5f94d8
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/globalController.viewconfig.js
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
+ */
+
+define(['underscore', 'contrail-view', 'legend-view',
+ 'monitor/infrastructure/globalcontroller/ui/js/models/globalControllerListModel','contrail-list-model'],
+ function(_, ContrailView, LegendView, GlobalControllerListModel,ContrailListModel){
+ var GlobalControllerViewConfig = function () {
+ var self = this,
+ regionList = globalObj['webServerInfo']['regionList'],
+ index = regionList.indexOf(cowc.GLOBAL_CONTROLLER_ALL_REGIONS),
+ defaulConfig = {};
+ if (index > -1) {
+ regionList.splice(index, 1);
+ }
+ var barViewListModel;
+ defaulConfig['bar-view'] = function(){
+ barViewListModel = new ContrailListModel([]);
+ return {
+ "modelCfg":{listModel:barViewListModel},
+ "viewCfg": {
+ "elementId" : ctwl.GLOBAL_CONTROLLER_REGION_BAR_SECTION_ID,
+ "view" : "globalControllerBarView",
+ "viewPathPrefix":"monitor/infrastructure/globalcontroller/ui/js/views/",
+ "app":cowc.APP_CONTRAIL_CONTROLLER
+ },
+ "itemAttr": {
+ "height":0.71,
+ "width": 8
+ }
+ }
+ }
+ for (var i = 0; i < regionList.length; i++) {
+ defaulConfig[regionList[i]] = function(cfg){
+ var globalControllerListModel = new GlobalControllerListModel({region:cfg['id']});
+ if((globalControllerListModel.loadedFromCache == true) || (globalControllerListModel.isRequestInProgress() != true)) {
+ var items = globalControllerListModel.getItems()[0];
+ barViewListModel.addData([items]);
+ }
+ globalControllerListModel.onAllRequestsComplete.subscribe(function(){
+ var items = globalControllerListModel.getItems()[0];
+ if(items != null){
+ barViewListModel.addData([items]);
+ }
+ });
+ return {
+ "modelCfg":{listModel:globalControllerListModel},
+ "viewCfg": {
+ "elementId" : ctwl.GLOBAL_CONTROLLER_REGION_SECTION_ID+cfg['id'],
+ "view" : "globalControllerRegionView",
+ "viewPathPrefix":"monitor/infrastructure/globalcontroller/ui/js/views/",
+ "app":cowc.APP_CONTRAIL_CONTROLLER
+ },
+ "itemAttr": {
+ "height":2.4,
+ "width": 4.3
+ }
+ }
+ }
+ }
+ self.viewConfig = defaulConfig;
+ self.getViewConfig = function(id) {
+ return self.viewConfig[id];
+ };
+ };
+ return (new GlobalControllerViewConfig()).viewConfig;
+});
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/globalControllerDashboard.main.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/globalControllerDashboard.main.js
new file mode 100644
index 000000000..030b840a3
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/globalControllerDashboard.main.js
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
+ */
+var globalControllerDashbaordLoader = new globalControllerDashbaordLoader();
+function globalControllerDashbaordLoader() {
+ this.load = function (paramObject) {
+ var self = this, currMenuObj = globalObj.currMenuObj,
+ hashParams = paramObject['hashParams'],
+ rootDir = currMenuObj['resources']['resource'][0]['rootDir'],
+ pathGCView = rootDir + '/js/views/GlobalControllerListView.js',
+ renderFn = paramObject['function'];
+ // Remove padding of page content if the page is multi-region dashbaord
+ $("#page-content").css("padding","0px");
+ //hide the project dropdown in multiregion dashbaord
+ $('#gohan-config-role').hide();
+ if (self.globalControllerDashboardView == null) {
+ requirejs([pathGCView], function (globalControllerDashboardView){
+ self.globalControllerDashboardView = new globalControllerDashboardView();
+ self.renderView(renderFn, hashParams);
+ });
+ } else {
+ self.renderView(renderFn, hashParams);
+ }
+ }
+ this.renderView = function (renderFn, hashParams) {
+ $(contentContainer).html("");
+ switch (renderFn) {
+ case 'renderCGCView':
+ this.globalControllerDashboardView[renderFn]({hashParams: hashParams});
+ break;
+ }
+ };
+ this.updateViewByHash = function (hashObj, lastHashObj) {
+ var renderFn;
+ this.load({hashParams: hashObj, 'function': renderFn});
+ };
+ this.destroy = function () {
+ $("#page-content").css("padding","2px 10px 5px");
+ ctwu.destroyDOMResources(ctwl.GLOBAL_CONTROLLER_PREFIX_ID);
+ };
+}
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/models/globalControllerListModel.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/models/globalControllerListModel.js
new file mode 100644
index 000000000..f01484c86
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/models/globalControllerListModel.js
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
+ */
+define([
+ 'contrail-list-model'
+], function (ContrailListModel) {
+ var self = this;
+ var GlobalControllerListModel = function (modelConfig) {
+ var listModelConfig = {
+ remote : {
+ ajaxConfig : {
+ url : ctwl.GLOBALCONTROLLER_REGIONS_SUMMARY_URL+ modelConfig.region
+ },
+ dataParser : function (response) {
+ return self.parseGlobalControllerModelData(response);
+ },
+ },
+ cacheConfig : {
+ // ucid: ctwc.GLOBAL_CONTROLLER_NODESCOUNT+modelConfig
+ }
+ };
+ return ContrailListModel(listModelConfig);
+ };
+ return GlobalControllerListModel;
+ }
+);
+ var parseGlobalControllerModelData = function(response){
+ var vRoutersNodes = response.data.vRoutersNodes,
+ controlNodes = response.data.controlNodes,
+ analyticsNodes = response.data.analyticsNodes,
+ configNodes = response.data.configNodes,
+ databaseNodes = response.data.databaseNodes;
+ self.getNodesDownList(response,vRoutersNodes, 'vRoutersNodesDownCnt');
+ self.getNodesDownList(response,controlNodes, 'controlNodesDownCnt');
+ self.getNodesDownList(response,analyticsNodes, 'analyticsNodesDownCnt');
+ self.getNodesDownList(response,configNodes, 'configNodesDownCnt');
+ self.getNodesDownList(response,databaseNodes, 'databaseNodesDownCnt');
+ return [response];
+ };
+ var getNodesDownList = function(response,NodesAlarmsList, nodesDownName){
+ var DownAlarmsCnt = 0,
+ severity,
+ ack,
+ checkUVEAlarms;
+ if(NodesAlarmsList.length > 0){
+ for(i=0;i -1) {
+ regionList.splice(index, 1);
+ }
+ gcArray = [{
+ "id": "bar-view"
+ }];
+ _.each(regionList, function(region){
+ regionVC = {
+ "id": ""+region+"",
+ };
+ gcArray.push(regionVC);
+ })
+ return gcArray;
+ }
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerBarView.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerBarView.js
new file mode 100644
index 000000000..db02bea56
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerBarView.js
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
+ */
+define([
+ 'underscore',
+ 'contrail-view'
+], function (_, ContrailView) {
+ var globalControllerBarView = ContrailView.extend({
+ render: function (viewConfig) {
+ var self = this,
+ viewConfig = this.attributes.viewConfig,
+ selector = $(contentContainer),
+ globalControllerBarViewTemplate = contrail.getTemplate4Id("barView-template");
+ var regionList = globalObj['webServerInfo']['regionList'];
+ var index = regionList.indexOf('All Regions');
+ var defaulConfig = {};
+ if (index > -1) {
+ regionList.splice(index, 1);
+ }
+ var regionListLen = regionList.length;
+ var totalNodesCnt =0;
+ if (self.model.loadedFromCache == true){
+ getAggregateBarInfo(self);
+ }
+ self.model.onDataUpdate.subscribe(function(){
+ getAggregateBarInfo(self);
+ });
+ function getAggregateBarInfo(self){
+ //parse the data to get the aggregate and render the view
+ var items = self.model.getItems();
+ var alarmsCnt = 0,servivceInstanceCnt = 0,interfacesCnt = 0,floatIps = 0,
+ analyticsNodesCnt = 0, configNodesCnt = 0;controlNodesCnt=0,
+ databaseNodesCnt = 0, vRoutersCnt = 0, vnCnt = 0, zeroAlarmsFlag = 0,
+ vRoutersNodesDownCnt = 0, configNodesDownCnt = 0, controlNodesDownCnt = 0,
+ analyticsNodesDownCnt = 0, databaseNodesDownCnt = 0,totalNodesDownCnt = 0;
+ for(i=0;i 0) {
+ $('#alert_info').css("background-color", "#e4564f");
+ $('#pageHeader').find('#alert_info').text(alarmsCnt);
+ }
+ else{
+ $('#alert_info').css("background-color", "#fff");
+ }
+ self.$el.html(globalControllerBarViewTemplate({zeroAlarmsFlag:zeroAlarmsFlag, alarmCnt:alarmsCnt,regionListLen:regionListLen,
+ interfacesCnt:interfacesCnt,servivceInstanceCnt:servivceInstanceCnt,floatIps:floatIps, vnCnt:vnCnt,totalNodesCnt:totalNodesCnt,
+ totalNodesDownCnt: totalNodesDownCnt}));
+ }
+ }
+ });
+ return globalControllerBarView;
+});
\ No newline at end of file
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerRegionView.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerRegionView.js
new file mode 100644
index 000000000..f73127f27
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerRegionView.js
@@ -0,0 +1,86 @@
+ /*
+ * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
+ */
+define([
+ 'underscore',
+ 'contrail-view',
+ 'monitor/infrastructure/globalcontroller/ui/js/models/globalControllerListModel'
+], function (_, ContrailView, GlobalControllerListModel) {
+ var GlobalControllerRegionView = ContrailView.extend({
+ render: function (viewConfig) {
+ var self = this,
+ globalControllerListModel = self.model;
+ self.model.onAllRequestsComplete.subscribe(function () {
+ renderRegionView();
+ });
+ if (self.model.loadedFromCache == true) {
+ renderRegionView();
+ }
+ if (!self.model.isRequestInProgress()) {
+ renderRegionView();
+ }
+ function renderRegionView(){
+ var cfgDashbaordViewTemplate = contrail.getTemplate4Id("globalController-dashbaord-template");
+ var headInfo = globalControllerListModel.getItems()[0];
+ self.$el.html(cfgDashbaordViewTemplate({headInfo}));
+ var objectCntSection = self.$el.find(".container .objectcntsection"),
+ chartSection = self.$el.find(".container .chartsection"),
+ nodesCntSection = self.$el.find(".container .nodescntcontainer");
+ self.renderView4Config(objectCntSection,
+ globalControllerListModel, getObjectCountView());
+ self.renderView4Config(chartSection,
+ globalControllerListModel, getGlobalControllerChartsView(viewConfig));
+ self.renderView4Config(nodesCntSection,
+ globalControllerListModel, getNodesCountView());
+ }
+ }
+ });
+ var getObjectCountView = function () {
+ return {
+ elementId: "objectviewCnt",
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: "objectviewCnt_grid",
+ view : "objectCntView",
+ viewPathPrefix:"monitor/infrastructure/globalcontroller/ui/js/views/",
+ app:cowc.APP_CONTRAIL_CONTROLLER
+ }]}]
+ }
+ }
+ }
+ var getGlobalControllerChartsView = function (viewConfig) {
+ return {
+ elementId: "globalControllerChart",
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: "globalControllerChart_grid",
+ view : "globalControllerchartView",
+ viewPathPrefix:"monitor/infrastructure/globalcontroller/ui/js/views/",
+ app:cowc.APP_CONTRAIL_CONTROLLER
+ }]}]
+ }
+ }
+ }
+ var getNodesCountView = function () {
+ return {
+ elementId: "nodesCounttView",
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: "nodesCntView_grid",
+ view: "nodesCntView",
+ viewPathPrefix:"monitor/infrastructure/globalcontroller/ui/js/views/",
+ app:cowc.APP_CONTRAIL_CONTROLLER,
+ viewConfig: {
+ }
+ }]}]
+ }
+ }
+ }
+ return GlobalControllerRegionView;
+});
\ No newline at end of file
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerchartView.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerchartView.js
new file mode 100644
index 000000000..5a3655b85
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/globalControllerchartView.js
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
+ */
+define([
+ 'underscore',
+ 'contrail-view',
+ 'chart-utils'
+], function (_, ContrailView, ChartUtils) {
+ var chartView = ContrailView.extend({
+ render: function (viewConfig) {
+ var self = this,
+ chartViewTemplate = contrail.getTemplate4Id("chartView-template"),
+ model = this.model;
+ var region = getValueByJsonPath(model.getItems()[0], 'regionName', null);
+ this.$el.append(chartViewTemplate);
+ var secondRowtopLeftchartContainer = self.$el.find(".row .col1 .topleft-chart-container");
+ var secondRowtopRightchartContainer = self.$el.find(".row .col2 .topright-chart-container");
+ var secondRowbottomLeftchartContainer = self.$el.find(".row .col3 .bottomleft-chart-container");
+ var secondRowbottomRightchartContainer = self.$el.find(".row .col4 .bottomright-chart-container");
+ if(region != null){
+ self.renderView4Config(secondRowtopLeftchartContainer,
+ null, getSystemCPUPercentilesView(region));
+ self.renderView4Config(secondRowtopRightchartContainer,
+ null, getSystemMemoryPercentilesView(region));
+ self.renderView4Config(secondRowbottomLeftchartContainer,
+ null, getBandWidthPercentilesChart(region));
+ self.renderView4Config(secondRowbottomRightchartContainer,
+ null, getDiskUsageInfo(region));
+ }
+ }
+ });
+ var getSystemCPUPercentilesView = function (region) {
+ var postData = {
+ "autoSort": true,
+ "async": false,
+ "formModelAttrs": {
+ "table_type": "STAT",
+ "query_prefix": "stat",
+ "from_time": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "from_time_utc": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "to_time": Date.now(),
+ "to_time_utc": Date.now(),
+ "time_granularity_unit": "secs",
+ "time_granularity": 150,
+ "limit": "150000",
+ "table_name": "StatTable.NodeStatus.system_cpu_usage",
+ "select": "T=, PERCENTILES(system_cpu_usage.cpu_share)",
+ }
+ };
+ return {
+ elementId: ctwl.GLOBAL_CONTROLLER_CHARTVIEW_CPU_MAX+region,
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: ctwl.GLOBAL_CONTROLLER_CHARTVIEW_CPU_MAX_SECTION+region,
+ view: "LineWithFocusChartView",
+ viewConfig: {
+ modelConfig: {
+ remote: {
+ ajaxConfig : {
+ url : ctwl.GLOBAL_CONTROLLER_CHARTS_URL+ region,
+ type: 'POST',
+ data: JSON.stringify(postData)
+ },
+ dataParser : function(response) {
+ var data = getValueByJsonPath(response,'data;data',[]);
+ if (response['queryJSON'] != null) {
+ data = _.map(data, function(obj) {
+ return _.extend({}, obj, {queryJSON: response['queryJSON']});
+ });
+ }
+ return data;
+ }
+ },
+ cacheConfig : {
+ ucid: "globalController_system_cpu_chart"+region
+ }
+ },
+ parseFn : cowu.chartDataFormatter,
+ chartOptions: {
+ title:ctwl.GLOBAL_CONTROLLER_SYSTEM_CPU_TITLE,
+ subtitle:ctwl.GLOBAL_CONTROLLER_SYSTEM_MAX_CPU_UTILIZATION,
+ staticColor: true,
+ colors: monitorInfraConstants.GLOBAL_CONTROLLER_CHART_COLOR,
+ xAxisLabel:'',
+ height: 30,
+ area: true,
+ spliceAtBorders: false,
+ bucketSize: 2.5,
+ defaultDataStatusMessage: false,
+ hideFocusChart: true,
+ showYAxis: false,
+ showXAxis: false,
+ showTicks: false,
+ yFormatter:d3.format(".2f"),
+ yFormatter: function(y){
+ return y+' %';
+ },
+ yAxisLabel: "System CPU",
+ tooltipFn:ChartUtils.defaultLineWithFocusChartTooltipFn,
+ margin: {
+ left: 10,
+ top: 5,
+ right: 10,
+ bottom: 10
+ },
+ yField: getYFieldsForPercentile('system_cpu_usage.cpu_share')
+ //})
+ }
+ }
+ }]}]
+ }
+ }
+ }
+ var getSystemMemoryPercentilesView = function (region) {
+ var postData = {
+ "autoSort": true,
+ "async": false,
+ "formModelAttrs": {
+ "table_type": "STAT",
+ "query_prefix": "stat",
+ "from_time": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "from_time_utc": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "to_time": Date.now(),
+ "to_time_utc": Date.now(),
+ "time_granularity_unit": "secs",
+ "time_granularity": 150,
+ "limit": "150000",
+ "table_name": "StatTable.NodeStatus.system_mem_usage",
+ "select": "T=, PERCENTILES(system_mem_usage.used)"
+ }
+ };
+ return {
+ elementId: ctwl.GLOBAL_CONTROLLER_CHARTVIEW_MEMORY_MAX+region,
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: ctwl.GLOBAL_CONTROLLER_CHARTVIEW_MEMORY_MAX_SECTION+region,
+ view: "LineWithFocusChartView",
+ viewConfig: {
+ modelConfig: {
+ remote: {
+ ajaxConfig : {
+ url : ctwl.GLOBAL_CONTROLLER_CHARTS_URL+ region,
+ type: 'POST',
+ data: JSON.stringify(postData)
+ },
+ dataParser : function(response) {
+ var data = getValueByJsonPath(response,'data;data',[]);
+ if (response['queryJSON'] != null) {
+ data = _.map(data, function(obj) {
+ return _.extend({}, obj, {queryJSON: response['queryJSON']});
+ });
+ }
+ return data;
+ }
+ },
+ cacheConfig : {
+ ucid: "globalController_system_memory_chart"+region
+ }
+ },
+ parseFn : cowu.chartDataFormatter,
+ chartOptions: {
+ title:ctwl.GLOBAL_CONTROLLER_SYSTEM_MEMORY_TITLE,
+ subtitle:ctwl.GLOBAL_CONTROLLER_SYSTEM_MAX_MEMORY_UTILIZATION,
+ staticColor: true,
+ colors: monitorInfraConstants.GLOBAL_CONTROLLER_CHART_COLOR,
+ yAxisLabel: "System Memory",
+ height: 30,
+ area: true,
+ spliceAtBorders: false,
+ bucketSize: 2.5,
+ defaultDataStatusMessage: false,
+ hideFocusChart: true,
+ showYAxis: false,
+ showXAxis: false,
+ showTicks: false,
+ yField: getYFieldsForPercentile('system_mem_usage.used'),
+ yFormatter: function(y) {
+ return formatBytes(y * 1024, true, null, null,
+ null);
+ },
+ tooltipFn:ChartUtils.defaultLineWithFocusChartTooltipFn,
+ margin: {
+ left: 10,
+ top: 5,
+ right: 10,
+ bottom: 10
+ }
+ }
+ }
+ }]}]
+ }
+ }
+ }
+ var getBandWidthPercentilesChart = function (region) {
+ var postData = {
+ "autoSort": true,
+ "async": false,
+ "formModelAttrs": {
+ "table_type": "STAT",
+ "query_prefix": "stat",
+ "from_time": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "from_time_utc": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "to_time": Date.now(),
+ "to_time_utc": Date.now(),
+ "time_granularity_unit": "secs",
+ "time_granularity": 150,
+ "limit": "150000",
+ "table_name": "StatTable.VrouterStatsAgent.phy_band_in_bps",
+ "select": "T=, PERCENTILES(phy_band_in_bps.__value)"
+ }
+ };
+ return {
+ elementId: "chartview_bandwdth_percentile"+region,
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: "chartview_grid_bandwdth"+region,
+ view: "LineWithFocusChartView",
+ viewConfig: {
+ modelConfig: {
+ remote: {
+ ajaxConfig : {
+ url : ctwl.GLOBAL_CONTROLLER_CHARTS_URL+region,
+ type: 'POST',
+ data: JSON.stringify(postData)
+ },
+ dataParser : function(response) {
+ var data = getValueByJsonPath(response,'data;data',[]);
+ if (response['queryJSON'] != null) {
+ data = _.map(data, function(obj) {
+ return _.extend({}, obj, {queryJSON: response['queryJSON']});
+ });
+ }
+ return data;
+ }
+ },
+ cacheConfig : {
+ ucid: "globalController_bandwidth_chart"+region
+ }
+ },
+ parseFn : cowu.parseDataForLineChart,
+ chartOptions: {
+ title:ctwl.GLOBAL_CONTROLLER_BANDWIDTH_IN_TITLE,
+ subtitle:ctwl.GLOBAL_CONTROLLER_SYSTEM_MAX_BANDWIDTH_IN,
+ staticColor: true,
+ colors: monitorInfraConstants.GLOBAL_CONTROLLER_CHART_COLOR,
+ xAxisLabel: '',
+ yAxisLabel: "Bandwidth In",
+ height: 35,
+ area: true,
+ spliceAtBorders: false,
+ bucketSize: 2.5,
+ defaultDataStatusMessage: false,
+ hideFocusChart: true,
+ showYAxis: false,
+ showXAxis: false,
+ showTicks: false,
+ yFields: ['PERCENTILES(phy_band_in_bps.__value);95'],
+ yFormatter: function(y) {
+ return formatBytes(y, null, null, null, null, true);
+ },
+ tooltipFn:ChartUtils.defaultLineWithFocusChartTooltipFn,
+ margin: {
+ left: 10,
+ right: 10,
+ bottom:10
+ }
+ }
+ }
+ }]}]
+ }
+ }
+ }
+ var getDiskUsageInfo = function (region) {
+ var postData = {
+ "autoSort": true,
+ "async": false,
+ "formModelAttrs": {
+ "table_type": "STAT",
+ "query_prefix": "stat",
+ "from_time": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "from_time_utc": Date.now() - (cowc.DEFAULT_CHART_DURATION * 60 * 60 * 1000),
+ "to_time": Date.now(),
+ "to_time_utc": Date.now(),
+ "time_granularity_unit": "secs",
+ "time_granularity": 150,
+ "limit": "150000",
+ "table_name": "StatTable.NodeStatus.disk_usage_info",
+ "select": "T=,PERCENTILES(disk_usage_info.partition_space_used_1k)"
+ }
+ };
+ return {
+ elementId: ctwl.GLOBAL_CONTROLLER_CHARTVIEW_DISK_USAGE+region,
+ view: "SectionView",
+ viewConfig: {
+ rows: [{
+ columns: [{
+ elementId: ctwl.GLOBAL_CONTROLLER_CHARTVIEW_DISK_USAGE_SECTION+region,
+ view: "LineWithFocusChartView",
+ viewConfig: {
+ modelConfig: {
+ remote: {
+ ajaxConfig : {
+ url : ctwl.GLOBAL_CONTROLLER_CHARTS_URL+ region,
+ type: 'POST',
+ data: JSON.stringify(postData)
+ },
+ dataParser : function(response) {
+ var data = getValueByJsonPath(response,'data;data',[]);
+ if (response['queryJSON'] != null) {
+ data = _.map(data, function(obj) {
+ return _.extend({}, obj, {queryJSON: response['queryJSON']});
+ });
+ }
+ return data;
+ }
+ },
+ cacheConfig : {
+ ucid: "globalController_diskusage_chart"+region
+ }
+ },
+ parseFn : cowu.chartDataFormatter,
+ chartOptions: {
+ title:ctwl.GLOBAL_CONTROLLER_DISK_USAGE_TITLE,
+ subtitle:ctwl.GLOBAL_CONTROLLER_SYSTEM_CPU_UTILIZATION,
+ staticColor: true,
+ colors: monitorInfraConstants.GLOBAL_CONTROLLER_CHART_COLOR,
+ yAxisLabel: "Disk usage",
+ height: 35,
+ area: true,
+ spliceAtBorders: false,
+ bucketSize: 2.5,
+ defaultDataStatusMessage: false,
+ hideFocusChart: true,
+ showTicks: false,
+ showYAxis: false,
+ showXAxis: false,
+ yField: getYFieldsForPercentile('disk_usage_info.partition_space_used_1k'),
+ yFormatter : function(d){
+ return formatBytes(d * 1024, true);
+ },
+ tooltipFn:ChartUtils.defaultLineWithFocusChartTooltipFn,
+ margin: {
+ left: 10,
+ right: 10,
+ bottom:10
+ }
+ }
+ }
+ }]}]
+ }
+ }
+ }
+ var getYFieldsForPercentile = function (field) {
+ return 'PERCENTILES('+field+');95';
+ }
+ return chartView;
+});
\ No newline at end of file
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/views/nodesCntView.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/nodesCntView.js
new file mode 100644
index 000000000..8e3d67c16
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/nodesCntView.js
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
+ */
+define([
+ 'underscore',
+ 'contrail-view'
+], function (_, ContrailView) {
+ var nodesCntView = ContrailView.extend({
+ render: function () {
+ var self = this,
+ nodesCountViewTemplate = contrail.getTemplate4Id("nodeCntView-template"),
+ model = this.model,
+ dataNodesCnt = getValueByJsonPath(model.getItems()[0], 'data', null);
+ this.$el.append(nodesCountViewTemplate({dataNodesCnt}));
+ }
+ });
+ return nodesCntView;
+});
\ No newline at end of file
diff --git a/webroot/monitor/infrastructure/globalcontroller/ui/js/views/objectCntView.js b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/objectCntView.js
new file mode 100644
index 000000000..53dd3748c
--- /dev/null
+++ b/webroot/monitor/infrastructure/globalcontroller/ui/js/views/objectCntView.js
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
+ */
+define([
+ 'underscore',
+ 'contrail-view'
+], function (_, ContrailView) {
+ var ObjectCountView = ContrailView.extend({
+ render: function () {
+ var self = this,
+ objectCountViewTemplate = contrail.getTemplate4Id("objectCntView-template"),
+ model = this.model,
+ dataObjectCnt = getValueByJsonPath(model.getItems()[0], 'data', null);
+ this.$el.append(objectCountViewTemplate({dataObjectCnt}));
+ }
+ });
+ return ObjectCountView;
+});
\ No newline at end of file
diff --git a/webroot/monitor/infrastructure/vrouter/ui/js/vrouter.viewconfig.js b/webroot/monitor/infrastructure/vrouter/ui/js/vrouter.viewconfig.js
index 9658ed141..f07c91855 100644
--- a/webroot/monitor/infrastructure/vrouter/ui/js/vrouter.viewconfig.js
+++ b/webroot/monitor/infrastructure/vrouter/ui/js/vrouter.viewconfig.js
@@ -6,8 +6,17 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
function(_, ContrailView, ContrailListModel, CFDataSource, LegendView, VRouterListModel){
var VRouterViewConfig = function () {
var self = this;
- var vRouterListModel,vRouterUIListModel;
-
+ var vRouterListModel,vRouterUIListModel;
+ self.currentRegion = null;
+ self.isRegionChanged = function() {
+ var currentRegionFromCookie = contrail.getCookie('region');
+ if (self.currentRegion != currentRegionFromCookie) {
+ self.currentRegion = currentRegionFromCookie;
+ return true;
+ } else {
+ return false;
+ }
+ }
self.populateVRouterListModels = function() {
vRouterListModel = new VRouterListModel();
self.vRouterListModel = vRouterListModel;
@@ -129,8 +138,9 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
}
},
"vrouter-cpu-mem-scatter-chart" : function(){
- if(self.vRouterListModel == null)
+ if(self.vRouterListModel == null || self.isRegionChanged()) {
self.populateVRouterListModels();
+ }
return {
modelCfg: {listModel:vRouterUIListModel},
viewCfg: {
@@ -161,9 +171,10 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
}
}
},
- "vrouter-summary-cpu-mem-scatter-chart" : function(){
- if(self.vRouterListModel == null)
+ "vrouter-summary-cpu-mem-scatter-chart" : function(cfg,i){
+ if(self.vRouterListModel == null || self.isRegionChanged() || i == 0) {
self.populateVRouterListModels();
+ }
return {
modelCfg: {listModel:vRouterUIListModel},
viewCfg: {
@@ -390,9 +401,10 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
}
}
},
- "vrouter-summary-grid" : function() {
- if(self.vRouterListModel == null)
+ "vrouter-summary-grid" : function(cfg,i) {
+ if(self.vRouterListModel == null || self.isRegionChanged() || i == 0) {
self.populateVRouterListModels();
+ }
return {
modelCfg: {listModel: vRouterUIListModel},
viewCfg: {
@@ -413,8 +425,8 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
}
}
},
- "vrouter-crossfilters-chart" : function() {
- if(self.vRouterListModel == null) {
+ "vrouter-crossfilters-chart" : function(cfg,i) {
+ if(self.vRouterListModel == null || self.isRegionChanged() || i == 0) {
self.populateVRouterListModels();
}
return {
@@ -450,8 +462,9 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
}
},
"vrouter-system-cpu-mem-chart" : function() {
- if(self.vRouterListModel == null)
+ if(self.vRouterListModel == null || self.isRegionChanged()) {
self.populateVRouterListModels();
+ }
return {
modelCfg: {
modelId:'VROUTER_LIST_MODEL',
@@ -510,8 +523,9 @@ define(['underscore', 'contrail-view','contrail-list-model', 'cf-datasource', 'l
}
},
"vrouter-vn-int-inst-chart" : function() {
- if(self.vRouterListModel == null)
+ if(self.vRouterListModel == null || self.isRegionChanged()) {
self.populateVRouterListModels();
+ }
return {
modelCfg: {listModel:vRouterUIListModel},
viewCfg: {