Skip to content

Commit 22a5c6d

Browse files
committed
CLOUDSTACK-2041:Granular global parameter- Account settings
1 parent d91b0f2 commit 22a5c6d

1 file changed

Lines changed: 37 additions & 8 deletions

File tree

ui/scripts/accounts.js

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -900,20 +900,49 @@
900900

901901
// Granular settings for account
902902
settings: {
903-
title: 'label.menu.global.settings',
903+
title: 'Settings',
904904
custom: cloudStack.uiCustom.granularSettings({
905905
dataProvider: function(args) {
906-
args.response.success({
907-
data: [
908-
{ name: 'config.param.1', value: 1 },
909-
{ name: 'config.param.2', value: 2 }
910-
]
911-
});
906+
$.ajax({
907+
url:createURL('listConfigurations&accountid=' + args.context.accounts[0].id),
908+
data: { page: args.page, pageSize: pageSize, listAll: true },
909+
success:function(json){
910+
args.response.success({
911+
data:json.listconfigurationsresponse.configuration
912+
913+
});
914+
915+
},
916+
917+
error:function(json){
918+
args.response.error(parseXMLHttpResponse(json));
919+
920+
}
921+
});
922+
912923
},
913924
actions: {
914925
edit: function(args) {
915926
// call updateAccountLevelParameters
916-
args.response.success();
927+
var data = {
928+
name: args.data.jsonObj.name,
929+
value: args.data.value
930+
};
931+
932+
$.ajax({
933+
url:createURL('updateConfiguration&accountid=' + args.context.accounts[0].id),
934+
data:data,
935+
success:function(json){
936+
var item = json.updateconfigurationresponse.configuration;
937+
args.response.success({data:item});
938+
},
939+
940+
error: function(json) {
941+
args.response.error(parseXMLHttpResponse(json));
942+
}
943+
944+
});
945+
917946
}
918947
}
919948
})

0 commit comments

Comments
 (0)