From 82ae83bc9ac790eb9cd3315d3aab670898334016 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 10 Feb 2012 13:07:22 -0800 Subject: [PATCH] Revert "bug 13099: global settings page - when name is xennetworklabel/kvmnetworklabel/vmwarenetworklabel and value is null, show "Use default gateway" instead of null." This reverts commit 0237dd43b222c10abb56b5d03eaa0189fd0953d4. --- ui/scripts/globalSettings.js | 57 ++++++++++++------------------------ 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js index e8067981678..e543b5926be 100644 --- a/ui/scripts/globalSettings.js +++ b/ui/scripts/globalSettings.js @@ -1,11 +1,4 @@ (function(cloudStack) { - - var replaceNullValueWith = { - 'xennetworklabel': 'Use default gateway', - 'xennetworklabel': 'Use default gateway', - 'xennetworklabel': 'Use default gateway' - }; - cloudStack.sections['global-settings'] = { title: 'Global Settings', id: 'global-settings', @@ -15,29 +8,24 @@ edit: { label: 'Change value', action: function(args) { - var name = args.context["global-settings"].name; + var name = args.data.jsonObj.name; var value = args.data.value; - - if((name in replaceNullValueWith) && (value == replaceNullValueWith[name])) { - args.response.success({data: args.context["global-settings"]}); - } - else { - $.ajax({ - url: createURL( - 'updateConfiguration&name=' + todb(name) + '&value=' + todb(value) - ), - dataType: 'json', - async: true, - success: function(json) { - var item = json.updateconfigurationresponse.configuration; - cloudStack.dialog.notice({ message: 'Please restart your management server for your change to take effect.' }); - args.response.success({data: item}); - }, - error: function(json) { - args.response.error(parseXMLHttpResponse(json)); - } - }); - } + + $.ajax({ + url: createURL( + 'updateConfiguration&name=' + name + '&value=' + value + ), + dataType: 'json', + async: true, + success: function(json) { + var item = json.updateconfigurationresponse.configuration; + cloudStack.dialog.notice({ message: 'Please restart your management server for your change to take effect.' }); + args.response.success({data: item}); + }, + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); + } + }); } } }, @@ -62,16 +50,7 @@ dataType: "json", async: true, success: function(json) { - var configurationObjs = json.listconfigurationsresponse.configuration; - - var items = []; - $(configurationObjs).each(function(){ - if((this.name in replaceNullValueWith) && (this.value == null)) { - this.value = replaceNullValueWith[this.name]; - } - items.push(this); - }); - + var items = json.listconfigurationsresponse.configuration; args.response.success({ data: items }); } });