CLOUDSTACK-2041:Granular global parameter- Zone settings
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/61f3f931 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/61f3f931 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/61f3f931 Branch: refs/heads/internallb Commit: 61f3f931dd9df5354a39cfac0d60fccd782a6aab Parents: 6e2ecff Author: Pranav Saxena <pranav.sax...@citrix.com> Authored: Thu May 2 17:37:01 2013 +0530 Committer: Pranav Saxena <pranav.sax...@citrix.com> Committed: Thu May 2 17:37:01 2013 +0530 ---------------------------------------------------------------------- ui/scripts/system.js | 44 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 36 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61f3f931/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 5c3f359..0b5b3bc 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5523,20 +5523,48 @@ // Granular settings for zone settings: { - title: 'label.menu.global.settings', + title: 'Settings', custom: cloudStack.uiCustom.granularSettings({ dataProvider: function(args) { - args.response.success({ - data: [ - { name: 'config.param.1', value: 1 }, - { name: 'config.param.2', value: 2 } - ] - }); + $.ajax({ + url:createURL('listConfigurations&zoneid=' + args.context.physicalResources[0].id), + data: { page: args.page, pageSize: pageSize, listAll: true }, + success:function(json){ + args.response.success({ + data:json.listconfigurationsresponse.configuration + + }); + + }, + + error:function(json){ + args.response.error(parseXMLHttpResponse(json)); + + } + }); + }, actions: { edit: function(args) { // call updateZoneLevelParamter - args.response.success(); + var data = { + name: args.data.jsonObj.name, + value: args.data.value + }; + + $.ajax({ + url:createURL('updateConfiguration&zoneid=' + args.context.physicalResources[0].id), + data:data, + success:function(json){ + var item = json.updateconfigurationresponse.configuration; + args.response.success({data:item}); + }, + + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); + } + + }); } } })