Skip to content

Commit

Permalink
Merge "Closes-Bug: #1549690 Merege all ajax calls issued for getting …
Browse files Browse the repository at this point in the history
…web-server configuration into single call. Currently, different calls are issued for getting web-server configuration like one call for getting the disabled features and one for getting the feature-pkgs enabled."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 26, 2016
2 parents cf182b1 + dccad21 commit 84576eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/serverroot/utils/common.utils.js
Expand Up @@ -1387,6 +1387,9 @@ function getWebServerInfo (req, res, appData)
serverObj['configServer']['ip'] = getValueByJsonPath(config,
'cnfg;server_ip',
null);

serverObj['disabledFeatures'] = getValueByJsonPath(config,'features;disabled',[]);
serverObj['featurePkgsInfo'] = getValueByJsonPath(config,'featurePkg',[]);
var pkgList = process.mainModule.exports['pkgList'];
var pkgLen = pkgList.length;
var activePkgs = [];
Expand Down
7 changes: 2 additions & 5 deletions webroot/js/handlers/MenuHandler.js
Expand Up @@ -34,18 +34,15 @@ define(['underscore'], function (_) {
}
}
$.get('/' + mFileName+ '?built_at=' + built_at, function (xml) {
$.get('/api/admin/webconfig/features/disabled?built_at=' + built_at, function (disabledFeatures) {
$.get('/api/admin/webconfig/featurePkg/webController?built_at=' + built_at, function (featurePkgsInfo) {
menuObj = $.xml2json(xml);
var disabledFeatures = globalObj['webServerInfo']['disabledFeatures'];
var featurePkgsInfo = globalObj['webServerInfo']['featurePkgsInfo'];
processXMLJSON(menuObj, disabledFeatures);
globalObj['webServerInfo']['disabledFeatures'] = ifNull(disabledFeatures, []);
var menuShortcuts = contrail.getTemplate4Id('menu-shortcuts')(menuHandler.filterMenuItems(menuObj['items']['item'], 'menushortcut', featurePkgsInfo));
$("#sidebar-shortcuts").html(menuShortcuts);
['items']['item'] = menuHandler.filterMenuItems(menuObj['items']['item']);
initMenuDefObj.resolve();
});
})
});

//Add an event listener for clicking on menu items
$('#menu').on('click', 'ul > li > a', function (e) {
Expand Down

0 comments on commit 84576eb

Please sign in to comment.