diff --git a/client/WEB-INF/classes/resources/resource.properties b/client/WEB-INF/classes/resources/resource.properties index e11b0388b7d..a448bbbc7b0 100644 --- a/client/WEB-INF/classes/resources/resource.properties +++ b/client/WEB-INF/classes/resources/resource.properties @@ -91,5 +91,6 @@ please.confirm.you.want.to.lock.account.that.will.prevent.account.access.to.the. please.confirm.you.want.to.enable.account = Please confirm you want to enable account. please.select.an.available.zone.to.associate.your.new.ip.with..acquiring.additional.ip.may.cost.you.an.additional.dollars.per.month. = Please select an availability zone to associate your new IP with. Acquiring additional IP may cost you an additional dollars per month. please.confirm.you.want.to.release.this.IP.address = Please confirm you want to release this IP address +please.restart.your.management.server.for.your.new.settings.to.take.effect = Please RESTART your management server for your new settings to take effect diff --git a/ui/new/jsp/globalsetting.jsp b/ui/new/jsp/globalsetting.jsp index 1195ea308ee..eaa07e42542 100644 --- a/ui/new/jsp/globalsetting.jsp +++ b/ui/new/jsp/globalsetting.jsp @@ -62,7 +62,9 @@
-
+
+ +
@@ -82,3 +84,9 @@
+ + diff --git a/ui/new/scripts/cloud.core2.globalsetting.js b/ui/new/scripts/cloud.core2.globalsetting.js index 3941af69d16..77382cb6700 100644 --- a/ui/new/scripts/cloud.core2.globalsetting.js +++ b/ui/new/scripts/cloud.core2.globalsetting.js @@ -1,5 +1,41 @@ function afterLoadGlobalSettingJSP() { + var $detailsTab = $("#right_panel_content #tab_content_details"); + //edit button *** + var $readonlyFields = $detailsTab.find("#value"); + var $editFields = $detailsTab.find("#value_edit"); + initializeEditFunction($readonlyFields, $editFields, doUpdateGlobalSetting); + + //initialize dialogs + initDialogWithOK("dialog_alert_restart_management_server"); +} + +function doUpdateGlobalSetting() { + // validate values + var $detailsTab = $("#right_panel_content #tab_content_details"); + + var isValid = true; + isValid &= validateString("Value", $detailsTab.find("#value_edit"), $detailsTab.find("#value_edit_errormsg"), true); + if (!isValid) + return; + + var jsonObj = $detailsTab.data("jsonObj"); + var name = jsonObj.name; + var value = trim($detailsTab.find("#value_edit").val()); + + $.ajax({ + data: createURL("command=updateConfiguration&name="+todb(name)+"&value="+todb(value)+"&response=json"), + dataType: "json", + success: function(json) { + $detailsTab.find("#value").text(value); + + //no embedded object returned, so.... + jsonObj.value = value; + + globalSettingToMidmenu(jsonObj, $("#"+globalSettingGetMidmenuId(jsonObj))); + $("#dialog_alert_restart_management_server").dialog("open"); + } + }); } function globalSettingGetMidmenuId(jsonObj) { @@ -29,5 +65,6 @@ function globalSettingJsonToDetailsTab(jsonObj) { $detailsTab.data("jsonObj", jsonObj); $detailsTab.find("#name").text(fromdb(jsonObj.name)); $detailsTab.find("#value").text(fromdb(jsonObj.value)); + $detailsTab.find("#value_edit").val(fromdb(jsonObj.value)); $detailsTab.find("#description").text(fromdb(jsonObj.description)); } \ No newline at end of file diff --git a/ui/new/scripts/cloud.core2.js b/ui/new/scripts/cloud.core2.js index 8b11b3f8271..de00180e434 100644 --- a/ui/new/scripts/cloud.core2.js +++ b/ui/new/scripts/cloud.core2.js @@ -781,6 +781,26 @@ function initDialog(elementId, width1) { } } +function initDialogWithOK(elementId, width1) { + if(width1 == null) { + $("#"+elementId).dialog({ + autoOpen: false, + modal: true, + zIndex: 2000, + buttons: { "OK": function() { $(this).dialog("close"); } } + }); + } + else { + $("#"+elementId).dialog({ + width: width1, + autoOpen: false, + modal: true, + zIndex: 2000, + buttons: { "OK": function() { $(this).dialog("close"); } } + }); + } +} + function disableMultipleSelectionInMidMenu() { $("#midmenu_container").selectable("destroy"); //Most pages don't need multiple selection in middle menu. }