|
900 | 900 |
|
901 | 901 | // Granular settings for account |
902 | 902 | settings: { |
903 | | - title: 'label.menu.global.settings', |
| 903 | + title: 'Settings', |
904 | 904 | custom: cloudStack.uiCustom.granularSettings({ |
905 | 905 | 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 | + |
912 | 923 | }, |
913 | 924 | actions: { |
914 | 925 | edit: function(args) { |
915 | 926 | // 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 | + |
917 | 946 | } |
918 | 947 | } |
919 | 948 | }) |
|
0 commit comments