CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - implement Edit Region action, ID field shouldn't be editable since ID is the base when searching for an entry in the database.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6cb1486f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6cb1486f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6cb1486f Branch: refs/heads/api_entity Commit: 6cb1486f299ee2f5d761a9c4ec6bf4d2cce4963d Parents: 75a6e00 Author: Jessica Wang <[email protected]> Authored: Wed Mar 20 15:39:30 2013 -0700 Committer: Jessica Wang <[email protected]> Committed: Wed Mar 20 15:39:30 2013 -0700 ---------------------------------------------------------------------- ui/scripts/regions.js | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6cb1486f/ui/scripts/regions.js ---------------------------------------------------------------------- diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index 72940e1..68191c0 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -105,9 +105,15 @@ edit: { label: 'label.edit.region', action: function(args) { + var data = { + id: args.context.regions[0].id, + name: args.data.name, + endpoint: args.data.endpoint + }; + $.ajax({ url: createURL('updateRegion'), - data: args.data, + data: data, success: function(json) { args.response.success(); $(window).trigger('cloudStack.refreshRegions'); @@ -154,11 +160,11 @@ title: 'label.details', fields: [ { - name: { label: 'label.name', isEditable: true }, + id: { label: 'label.id' } }, { - endpoint: { label: 'label.endpoint', isEditable: true }, - id: { label: 'label.id', isEditable: true } + name: { label: 'label.name', isEditable: true }, + endpoint: { label: 'label.endpoint', isEditable: true } } ], dataProvider: function(args) {
