diff --git a/server/src/com/cloud/api/commands/CreateVolumeCmd.java b/server/src/com/cloud/api/commands/CreateVolumeCmd.java
index 360c7e45087..75f76d238ec 100644
--- a/server/src/com/cloud/api/commands/CreateVolumeCmd.java
+++ b/server/src/com/cloud/api/commands/CreateVolumeCmd.java
@@ -117,6 +117,14 @@ public class CreateVolumeCmd extends BaseCmd {
size = Long.valueOf(0);
}
+ if(diskOfferingId != null){
+ DiskOfferingVO dOffering = getManagementServer().findDiskOfferingById(diskOfferingId.longValue());
+
+ if(dOffering == null){
+ throw new ServerApiException(BaseCmd.PARAM_ERROR,"Diskoffering id:"+diskOfferingId+" is invalid");
+ }
+ }
+
boolean useSnapshot = false;
if (snapshotId == null)
{
diff --git a/ui/new/jsp/instance.jsp b/ui/new/jsp/instance.jsp
index d464b3860a6..e8944b43877 100644
--- a/ui/new/jsp/instance.jsp
+++ b/ui/new/jsp/instance.jsp
@@ -75,12 +75,10 @@
- <%=t.t("HA")%>:
+ <%=t.t("HA.Enabled")%>:
@@ -127,12 +125,10 @@
- <%=t.t("ISO")%>:
+ <%=t.t("ISO.attached")%>:
diff --git a/ui/new/jsp/iso.jsp b/ui/new/jsp/iso.jsp
index 6d24907e893..b7d6ab38876 100644
--- a/ui/new/jsp/iso.jsp
+++ b/ui/new/jsp/iso.jsp
@@ -35,7 +35,7 @@
-
+
@@ -107,9 +111,7 @@
<%=t.t("Bootable")%>:
@@ -142,8 +144,12 @@
-
-
+
+
+
diff --git a/ui/new/jsp/template.jsp b/ui/new/jsp/template.jsp
index a6d4a200da3..c62233ec905 100644
--- a/ui/new/jsp/template.jsp
+++ b/ui/new/jsp/template.jsp
@@ -112,9 +112,7 @@
<%=t.t("Password.Enabled")%>:
-
-
-
+
-
-
-
+
-
-
-
+
diff --git a/ui/new/scripts/cloud.core2.instance.js b/ui/new/scripts/cloud.core2.instance.js
index 4455f5fbd68..7d1ce21df9e 100644
--- a/ui/new/scripts/cloud.core2.instance.js
+++ b/ui/new/scripts/cloud.core2.instance.js
@@ -377,36 +377,44 @@ function clickInstanceGroupHeader($arrowIcon) {
}
function vmToRightPanel($midmenuItem) {
+ var json = $midmenuItem.data("jsonObj");
+ vmJsonToDetailsTab(json, $midmenuItem);
+ }
+
+ function vmJsonToDetailsTab(jsonObj, $midmenuItem){
+ var $detailsTab = $("#right_panel_content #tab_content_details");
+ $detailsTab.data("jsonObj", jsonObj);
+
//details tab
if($midmenuItem.find("#info_icon").css("display") != "none") {
- $rightPanelContent.find("#after_action_info").text($midmenuItem.data("afterActionInfo"));
+ $detailsTab.find("#after_action_info").text($midmenuItem.data("afterActionInfo"));
if($midmenuItem.find("#info_icon").hasClass("error"))
- $rightPanelContent.find("#after_action_info_container").addClass("errorbox");
+ $detailsTab.find("#after_action_info_container").addClass("errorbox");
else
- $rightPanelContent.find("#after_action_info_container").removeClass("errorbox");
- $rightPanelContent.find("#after_action_info_container").show();
+ $detailsTab.find("#after_action_info_container").removeClass("errorbox");
+ $detailsTab.find("#after_action_info_container").show();
}
else {
- $rightPanelContent.find("#after_action_info").text("");
- $rightPanelContent.find("#after_action_info_container").hide();
+ $detailsTab.find("#after_action_info").text("");
+ $detailsTab.find("#after_action_info_container").hide();
}
- var jsonObj = $midmenuItem.data("jsonObj");
+
var vmName = getVmName(jsonObj.name, jsonObj.displayname);
$rightPanelHeader.find("#vm_name").text(fromdb(vmName));
updateVirtualMachineStateInRightPanel(jsonObj.state);
- $rightPanelContent.find("#ipAddress").text(jsonObj.ipaddress);
- $rightPanelContent.find("#zoneName").text(fromdb(jsonObj.zonename));
- $rightPanelContent.find("#templateName").text(fromdb(jsonObj.templatename));
- $rightPanelContent.find("#serviceOfferingName").text(fromdb(jsonObj.serviceofferingname));
- $rightPanelContent.find("#created").text(jsonObj.created);
- $rightPanelContent.find("#account").text(fromdb(jsonObj.account));
- $rightPanelContent.find("#domain").text(fromdb(jsonObj.domain));
- $rightPanelContent.find("#hostName").text(fromdb(jsonObj.hostname));
- $rightPanelContent.find("#group").text(fromdb(jsonObj.group));
+ $detailsTab.find("#ipAddress").text(jsonObj.ipaddress);
+ $detailsTab.find("#zoneName").text(fromdb(jsonObj.zonename));
+ $detailsTab.find("#templateName").text(fromdb(jsonObj.templatename));
+ $detailsTab.find("#serviceOfferingName").text(fromdb(jsonObj.serviceofferingname));
+ $detailsTab.find("#created").text(jsonObj.created);
+ $detailsTab.find("#account").text(fromdb(jsonObj.account));
+ $detailsTab.find("#domain").text(fromdb(jsonObj.domain));
+ $detailsTab.find("#hostName").text(fromdb(jsonObj.hostname));
+ $detailsTab.find("#group").text(fromdb(jsonObj.group));
- setBooleanField(jsonObj.haenable, $rightPanelContent.find("#ha"));
- setBooleanField((jsonObj.isoid != null && jsonObj.isoid.length > 0), $rightPanelContent.find("#iso"));
+ setBooleanField(jsonObj.haenable, $detailsTab.find("#haenable"));
+ setBooleanField((jsonObj.isoid != null && jsonObj.isoid.length > 0), $detailsTab.find("#iso"));
//volume tab
//if (getHypervisorType() == "kvm")
@@ -418,7 +426,7 @@ function clickInstanceGroupHeader($arrowIcon) {
success: function(json) {
var items = json.listvolumesresponse.volume;
if (items != null && items.length > 0) {
- var container = $rightPanelContent.find("#tab_content_volume").empty();
+ var container = $detailsTab.find("#tab_content_volume").empty();
var template = $("#volume_tab_template");
for (var i = 0; i < items.length; i++) {
var newTemplate = template.clone(true);
diff --git a/ui/new/scripts/cloud.core2.iso.js b/ui/new/scripts/cloud.core2.iso.js
index 3a7402a33b1..58686de9e63 100644
--- a/ui/new/scripts/cloud.core2.iso.js
+++ b/ui/new/scripts/cloud.core2.iso.js
@@ -4,6 +4,28 @@ var g_zoneNames = [];
function afterLoadIsoJSP() {
var $detailsTab = $("#right_panel_content #tab_content_details");
+ //edit button ***
+ var $readonlyFields = $detailsTab.find("#name, #displaytext");
+ var $editFields = $detailsTab.find("#name_edit, #displaytext_edit");
+ $("#edit_button").bind("click", function(event){
+ $readonlyFields.hide();
+ $editFields.show();
+ $("#cancel_button, #save_button").show()
+ return false;
+ });
+ $("#cancel_button").bind("click", function(event){
+ $editFields.hide();
+ $readonlyFields.show();
+ $("#save_button, #cancel_button").hide();
+ return false;
+ });
+ $("#save_button").bind("click", function(event){
+ doUpdateIso();
+ $editFields.hide();
+ $readonlyFields.show();
+ $("#save_button, #cancel_button").hide();
+ return false;
+ });
//populate dropdown ***
$.ajax({
@@ -107,8 +129,13 @@ function isoJsonToDetailsTab(jsonObj) {
$detailsTab.data("jsonObj", jsonObj);
$detailsTab.find("#id").text(fromdb(jsonObj.id));
$detailsTab.find("#zonename").text(fromdb(jsonObj.zonename));
+
$detailsTab.find("#name").text(fromdb(jsonObj.name));
+ $detailsTab.find("#name_edit").val(fromdb(jsonObj.name));
+
$detailsTab.find("#displaytext").text(fromdb(jsonObj.displaytext));
+ $detailsTab.find("#displaytext_edit").val(fromdb(jsonObj.displaytext));
+
$detailsTab.find("#account").text(fromdb(jsonObj.account));
if(jsonObj.size != null)
@@ -158,7 +185,22 @@ function isoJsonToDetailsTab(jsonObj) {
}
function isoClearRightPanel() {
-
+ var $detailsTab = $("#right_panel_content #tab_content_details");
+
+ $detailsTab.find("#id").text("");
+ $detailsTab.find("#zonename").text("");
+
+ $detailsTab.find("#name").text("");
+ $detailsTab.find("#name_edit").val("");
+
+ $detailsTab.find("#displaytext").text("");
+ $detailsTab.find("#displaytext_edit").val("");
+
+ $detailsTab.find("#account").text("");
+ $detailsTab.find("#size").text("");
+ $detailsTab.find("#status").text("");
+ $detailsTab.find("#bootable").text("");
+ $detailsTab.find("#created").text("");
}
var isoActionMap = {
@@ -167,7 +209,7 @@ var isoActionMap = {
isAsyncJob: true,
asyncJobResponse: "deleteisosresponse",
inProcessText: "Deleting ISO....",
- afterActionSeccessFn: function(jsonObj) {
+ afterActionSeccessFn: function(jsonObj) {
var $midmenuItem1 = $("#midmenuItem_"+jsonObj.id);
$midmenuItem1.remove();
clearRightPanel();
@@ -192,11 +234,38 @@ var isoActionMap = {
}
var isoListAPIMap = {
- listAPI: "listisos&isofilter=self",
+ listAPI: "listIsos&isofilter=self",
listAPIResponse: "listisosresponse",
listAPIResponseObj: "iso"
};
+function doUpdateIso() {
+ var $detailsTab = $("#right_panel_content #tab_content_details");
+
+ // validate values
+ var isValid = true;
+ isValid &= validateString("Name", $detailsTab.find("#name_edit"), $detailsTab.find("#name_edit_errormsg"));
+ isValid &= validateString("Display Text", $detailsTab.find("#displaytext_edit"), $detailsTab.find("#displaytext_edit_errormsg"));
+ if (!isValid)
+ return;
+
+ var jsonObj = $detailsTab.data("jsonObj");
+ var id = jsonObj.id;
+
+ var name = trim($detailsTab.find("#name_edit").val());
+ var displaytext = trim($detailsTab.find("#displaytext_edit").val());
+
+ $.ajax({
+ data: createURL("command=updateIso&id="+id+"&name="+todb(name)+"&displayText="+todb(displaytext)),
+ dataType: "json",
+ success: function(json) {
+ var jsonObj = json.updateisoresponse;
+ isoToMidmenu(jsonObj, $("#midmenuItem_"+jsonObj.id));
+ isoJsonToDetailsTab(jsonObj);
+ }
+ });
+}
+
function populateZoneFieldExcludeSourceZone(zoneField, excludeZoneId) {
zoneField.empty();
if (g_zoneIds != null && g_zoneIds.length > 0) {
diff --git a/ui/new/scripts/cloud.core2.js b/ui/new/scripts/cloud.core2.js
index f2359742c46..c5484890d10 100644
--- a/ui/new/scripts/cloud.core2.js
+++ b/ui/new/scripts/cloud.core2.js
@@ -20,6 +20,166 @@
// Version: @VERSION@
+
+//***** actions for details tab in right panel (begin) ************************************************************************
+function buildActionLinkForDetailsTab(label, actionMap, $actionMenu, listAPIMap) {
+ var apiInfo = actionMap[label];
+ var $listItem = $("#action_list_item").clone();
+ $actionMenu.find("#action_list").append($listItem.show());
+ var $link = $listItem.find("#link").text(label);
+ $link.data("label", label);
+ $link.data("inProcessText", apiInfo.inProcessText);
+ $link.data("api", apiInfo.api);
+ $link.data("isAsyncJob", apiInfo.isAsyncJob);
+ $link.data("asyncJobResponse", apiInfo.asyncJobResponse);
+ $link.data("afterActionSeccessFn", apiInfo.afterActionSeccessFn);
+ $link.data("dialogBeforeActionFn", apiInfo.dialogBeforeActionFn);
+
+ var $detailsTab = $("#right_panel_content #tab_content_details");
+ var id = $detailsTab.data("jsonObj").id;
+
+ $link.bind("click", function(event) {
+ $actionMenu.hide();
+ var $actionLink = $(this);
+ var dialogBeforeActionFn = $actionLink.data("dialogBeforeActionFn");
+ if(dialogBeforeActionFn == null) {
+ var apiCommand = "command="+$actionLink.data("api")+"&id="+id;
+ doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap);
+ }
+ else {
+ dialogBeforeActionFn($actionLink, listAPIMap, $detailsTab);
+ }
+ return false;
+ });
+}
+
+function doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap) {
+ var label = $actionLink.data("label");
+ var inProcessText = $actionLink.data("inProcessText");
+ var isAsyncJob = $actionLink.data("isAsyncJob");
+ var asyncJobResponse = $actionLink.data("asyncJobResponse");
+ var afterActionSeccessFn = $actionLink.data("afterActionSeccessFn");
+ var listAPI = listAPIMap["listAPI"];
+ var listAPIResponse = listAPIMap["listAPIResponse"];
+ var listAPIResponseObj = listAPIMap["listAPIResponseObj"];
+
+ var $detailsTab = $("#right_panel_content #tab_content_details");
+ var $spinningWheel = $detailsTab.find("#spinning_wheel");
+ $spinningWheel.find("#description").text(inProcessText);
+ $spinningWheel.show();
+
+ //Async job (begin) *****
+ if(isAsyncJob == true) {
+ $.ajax({
+ data: createURL(apiCommand),
+ dataType: "json",
+ success: function(json) {
+ var jobId = json[asyncJobResponse].jobid;
+ var timerKey = "asyncJob_" + jobId;
+ $("body").everyTime(
+ 10000,
+ timerKey,
+ function() {
+ $.ajax({
+ data: createURL("command=queryAsyncJobResult&jobId="+jobId),
+ dataType: "json",
+ success: function(json) {
+ var result = json.queryasyncjobresultresponse;
+ if (result.jobstatus == 0) {
+ return; //Job has not completed
+ } else {
+ $("body").stopTime(timerKey);
+ $spinningWheel.hide();
+ if (result.jobstatus == 1) { // Succeeded
+ $detailsTab.find("#action_message_box #description").text(label + " action succeeded.");
+ $detailsTab.find("#action_message_box").removeClass("error").show();
+
+ //DestroyVirtualMachine API doesn't return an embedded object on success (Bug 6041)
+ //Before Bug 6041 get fixed, use the temporary solution below.
+ $.ajax({
+ cache: false,
+ data: createURL("command="+listAPI+"&id="+id),
+ dataType: "json",
+ success: function(json) {
+ afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
+ }
+ });
+ //After Bug 6037 is fixed, remove temporary solution above and uncomment the line below
+ //afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
+
+ } else if (result.jobstatus == 2) { // Failed
+ $detailsTab.find("#action_message_box #description").text(label + " action failed. Reason: " + sanitizeXSS(result.jobresult));
+ $detailsTab.find("#action_message_box").addClass("error").show();
+ }
+ }
+ },
+ error: function(XMLHttpResponse) {
+ $("body").stopTime(timerKey);
+ handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
+ }
+ });
+ },
+ 0
+ );
+ },
+ error: function(XMLHttpResponse) {
+ handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
+ }
+ });
+ }
+ //Async job (end) *****
+
+ //Sync job (begin) *****
+ else {
+ $.ajax({
+ data: createURL(apiCommand),
+ dataType: "json",
+ async: false,
+ success: function(json) {
+ $spinningWheel.hide();
+
+ //RecoverVirtualMachine API doesn't return an embedded object on success (Bug 6037)
+ //Before Bug 6037 get fixed, use the temporary solution below.
+ $.ajax({
+ cache: false,
+ data: createURL("command="+listAPI+"&id="+id),
+ dataType: "json",
+ async: false,
+ success: function(json) {
+ $detailsTab.find("#action_message_box #description").text(label + " action succeeded.");
+ $detailsTab.find("#action_message_box").removeClass("error").show();
+
+ afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
+ }
+ });
+ //After Bug 6037 is fixed, remove temporary solution above and uncomment the line below
+ //afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
+ },
+ error: function(XMLHttpResponse) {
+ handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
+ }
+ });
+ }
+ //Sync job (end) *****
+}
+
+function handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label) {
+ $detailsTab.find("#spinning_wheel").hide();
+
+ var errorMsg = "";
+ if(XMLHttpResponse.responseText != null & XMLHttpResponse.responseText.length > 0) {
+ var start = XMLHttpResponse.responseText.indexOf("h1") + 3;
+ var end = XMLHttpResponse.responseText.indexOf(" 0)
+ $detailsTab.find("#action_message_box #description").text(label + " action failed. Reason: " + sanitizeXSS(unescape(errorMsg)));
+ else
+ $detailsTab.find("#action_message_box #description").text(label + " action failed.");
+ $detailsTab.find("#action_message_box").addClass("error").show();
+}
+//***** actions for details tab in right panel (end) **************************************************************************
+
//***** actions for middle menu (begin) ************************************************************************
var selectedItemsInMidMenu = {};
@@ -180,164 +340,6 @@ function handleErrorInMidMenu(XMLHttpResponse, $midmenuItem) {
}
//***** actions for middle menu (end) **************************************************************************
-//***** actions for details tab in right panel (begin) ************************************************************************
-function buildActionLinkForDetailsTab(label, actionMap, $actionMenu, listAPIMap) {
- var apiInfo = actionMap[label];
- var $listItem = $("#action_list_item").clone();
- $actionMenu.find("#action_list").append($listItem.show());
- var $link = $listItem.find("#link").text(label);
- $link.data("label", label);
- $link.data("inProcessText", apiInfo.inProcessText);
- $link.data("api", apiInfo.api);
- $link.data("isAsyncJob", apiInfo.isAsyncJob);
- $link.data("asyncJobResponse", apiInfo.asyncJobResponse);
- $link.data("afterActionSeccessFn", apiInfo.afterActionSeccessFn);
- $link.data("dialogBeforeActionFn", apiInfo.dialogBeforeActionFn);
-
- var $detailsTab = $("#right_panel_content #tab_content_details");
- var id = $detailsTab.data("jsonObj").id;
-
- $link.bind("click", function(event) {
- $actionMenu.hide();
- var $actionLink = $(this);
- var dialogBeforeActionFn = $actionLink.data("dialogBeforeActionFn");
- if(dialogBeforeActionFn == null) {
- var apiCommand = "command="+$actionLink.data("api")+"&id="+id;
- doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap);
- }
- else {
- dialogBeforeActionFn($actionLink, listAPIMap, $detailsTab);
- }
- return false;
- });
-}
-
-function doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap) {
- var label = $actionLink.data("label");
- var inProcessText = $actionLink.data("inProcessText");
- var isAsyncJob = $actionLink.data("isAsyncJob");
- var asyncJobResponse = $actionLink.data("asyncJobResponse");
- var afterActionSeccessFn = $actionLink.data("afterActionSeccessFn");
- var listAPI = listAPIMap["listAPI"];
- var listAPIResponse = listAPIMap["listAPIResponse"];
- var listAPIResponseObj = listAPIMap["listAPIResponseObj"];
-
- var $detailsTab = $("#right_panel_content #tab_content_details");
- var $spinningWheel = $detailsTab.find("#spinning_wheel");
- $spinningWheel.find("#description").text(inProcessText);
- $spinningWheel.show();
-
- //Async job (begin) *****
- if(isAsyncJob == true) {
- $.ajax({
- data: createURL(apiCommand),
- dataType: "json",
- success: function(json) {
- var jobId = json[asyncJobResponse].jobid;
- var timerKey = "asyncJob_" + jobId;
- $("body").everyTime(
- 10000,
- timerKey,
- function() {
- $.ajax({
- data: createURL("command=queryAsyncJobResult&jobId="+jobId),
- dataType: "json",
- success: function(json) {
- var result = json.queryasyncjobresultresponse;
- if (result.jobstatus == 0) {
- return; //Job has not completed
- } else {
- $("body").stopTime(timerKey);
- $spinningWheel.hide();
- if (result.jobstatus == 1) { // Succeeded
- $detailsTab.find("#action_message_box #description").text(label + " action succeeded.");
- $detailsTab.find("#action_message_box").removeClass("error").show();
-
- //DestroyVirtualMachine API doesn't return an embedded object on success (Bug 6041)
- //Before Bug 6041 get fixed, use the temporary solution below.
- $.ajax({
- cache: false,
- data: createURL("command="+listAPI+"&id="+id),
- dataType: "json",
- success: function(json) {
- afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
- }
- });
- //After Bug 6037 is fixed, remove temporary solution above and uncomment the line below
- //afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
-
- } else if (result.jobstatus == 2) { // Failed
- $detailsTab.find("#action_message_box #description").text(label + " action failed. Reason: " + sanitizeXSS(result.jobresult));
- $detailsTab.find("#action_message_box").addClass("error").show();
- }
- }
- },
- error: function(XMLHttpResponse) {
- $("body").stopTime(timerKey);
- handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
- }
- });
- },
- 0
- );
- },
- error: function(XMLHttpResponse) {
- handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
- }
- });
- }
- //Async job (end) *****
-
- //Sync job (begin) *****
- else {
- $.ajax({
- data: createURL(apiCommand),
- dataType: "json",
- async: false,
- success: function(json) {
- $spinningWheel.hide();
-
- //RecoverVirtualMachine API doesn't return an embedded object on success (Bug 6037)
- //Before Bug 6037 get fixed, use the temporary solution below.
- $.ajax({
- cache: false,
- data: createURL("command="+listAPI+"&id="+id),
- dataType: "json",
- async: false,
- success: function(json) {
- $detailsTab.find("#action_message_box #description").text(label + " action succeeded.");
- $detailsTab.find("#action_message_box").removeClass("error").show();
-
- afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
- }
- });
- //After Bug 6037 is fixed, remove temporary solution above and uncomment the line below
- //afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
- },
- error: function(XMLHttpResponse) {
- handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
- }
- });
- }
- //Sync job (end) *****
-}
-
-function handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label) {
- $detailsTab.find("#spinning_wheel").hide();
-
- var errorMsg = "";
- if(XMLHttpResponse.responseText != null & XMLHttpResponse.responseText.length > 0) {
- var start = XMLHttpResponse.responseText.indexOf("h1") + 3;
- var end = XMLHttpResponse.responseText.indexOf(" 0)
- $detailsTab.find("#action_message_box #description").text(label + " action failed. Reason: " + sanitizeXSS(unescape(errorMsg)));
- else
- $detailsTab.find("#action_message_box #description").text(label + " action failed.");
- $detailsTab.find("#action_message_box").addClass("error").show();
-}
-//***** actions for details tab in right panel (end) **************************************************************************
//***** actions for a subgrid item in right panel (begin) ************************************************************************
function buildActionLinkForSubgridItem(label, actionMap, $actionMenu, listAPIMap, $subgridItem) {
@@ -513,12 +515,12 @@ function todb(val) {
var midmenuItemCount = 20;
function setBooleanField(value, $field) {
- if(value == "true")
- $field.find("#icon").removeClass("cross_icon").addClass("tick_icon").show();
- else if(value == "false")
- $field.find("#icon").removeClass("tick_icon").addClass("cross_icon").show();
+ if(value == "true" || value == true)
+ $field.text("Yes").show();
+ else if(value == "false" || value == false)
+ $field.text("No").show();
else
- $field.find("#icon").hide();
+ $field.hide();
}
function clearLeftMenu() {
diff --git a/ui/new/scripts/cloud.core2.template.js b/ui/new/scripts/cloud.core2.template.js
index e6289de9810..819d4cd918d 100644
--- a/ui/new/scripts/cloud.core2.template.js
+++ b/ui/new/scripts/cloud.core2.template.js
@@ -9,24 +9,21 @@ function afterLoadTemplateJSP() {
var $editFields = $detailsTab.find("#name_edit, #displaytext_edit, #passwordenabled_edit, #ispublic_edit, #isfeatured_edit, #ostypename_edit");
$("#edit_button").bind("click", function(event){
$readonlyFields.hide();
- $editFields.show();
- $(this).hide();
+ $editFields.show();
$("#cancel_button, #save_button").show()
return false;
});
$("#cancel_button").bind("click", function(event){
$editFields.hide();
$readonlyFields.show();
- $("#save_button, #cancel_button").hide();
- $("#edit_button").show();
+ $("#save_button, #cancel_button").hide();
return false;
});
$("#save_button").bind("click", function(event){
doUpdateTemplate();
$editFields.hide();
$readonlyFields.show();
- $("#save_button, #cancel_button").hide();
- $("#edit_button").show();
+ $("#save_button, #cancel_button").hide();
return false;
});
@@ -223,16 +220,16 @@ function templateClearRightPanel() {
$detailsTab.find("#status").text("");
- setBooleanField(null, $detailsTab.find("#passwordenabled"));
+ $detailsTab.find("#passwordenabled").text("");
$detailsTab.find("#passwordenabled_edit").val(null);
- setBooleanField(null, $detailsTab.find("#ispublic"));
+ $detailsTab.find("#ispublic").text("");
$detailsTab.find("#ispublic_edit").val(null);
- setBooleanField(null, $detailsTab.find("#isfeatured"));
+ $detailsTab.find("#isfeatured").text("");
$detailsTab.find("#isfeatured_edit").val(null);
- setBooleanField(null, $detailsTab.find("#crossZones"));
+ $detailsTab.find("#crossZones").text("");
$detailsTab.find("#ostypename").text("");
$detailsTab.find("#ostypename_edit").val(null);