mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss
This commit is contained in:
commit
00b81a13e0
@ -25,15 +25,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="tab_content_details">
|
<div id="tab_content_details">
|
||||||
<div class="grid_actionpanel">
|
<div class="grid_actionpanel">
|
||||||
|
|
||||||
<div class="grid_editbox" id="edit_button">
|
|
||||||
</div>
|
|
||||||
<div class="gridheader_loaderbox" id="spinning_wheel" style="border: 1px solid #999;
|
<div class="gridheader_loaderbox" id="spinning_wheel" style="border: 1px solid #999;
|
||||||
display: none;">
|
display: none;">
|
||||||
<div class="gridheader_loader" id="Div1">
|
<div class="gridheader_loader" id="Div1">
|
||||||
</div>
|
</div>
|
||||||
<p id="description">
|
<p id="description">
|
||||||
Detaching Disk …</p>
|
Waiting …</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -119,11 +119,6 @@ function afterLoadTemplateJSP() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//edit button ***
|
|
||||||
var $readonlyFields = $detailsTab.find("#name, #displaytext, #passwordenabled, #ispublic, #isfeatured, #ostypename");
|
|
||||||
var $editFields = $detailsTab.find("#name_edit, #displaytext_edit, #passwordenabled_edit, #ispublic_edit, #isfeatured_edit, #ostypename_edit");
|
|
||||||
initializeEditFunction($readonlyFields, $editFields, doUpdateTemplate);
|
|
||||||
|
|
||||||
//populate dropdown ***
|
//populate dropdown ***
|
||||||
var addTemplateZoneField = $("#dialog_add_template #add_template_zone");
|
var addTemplateZoneField = $("#dialog_add_template #add_template_zone");
|
||||||
if (isAdmin())
|
if (isAdmin())
|
||||||
@ -286,10 +281,11 @@ function templateJsonToDetailsTab(jsonObj) {
|
|||||||
// action Edit, Copy, Create VM
|
// action Edit, Copy, Create VM
|
||||||
if ((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.id==DomRTemplateId || jsonObj.isready == "false") {
|
if ((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.id==DomRTemplateId || jsonObj.isready == "false") {
|
||||||
//template.find("#template_edit_container, #template_copy_container, #template_create_vm_container").hide();
|
//template.find("#template_edit_container, #template_copy_container, #template_create_vm_container").hide();
|
||||||
$("#edit_button").hide();
|
//$("#edit_button").hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#edit_button").show();
|
buildActionLinkForDetailsTab("Edit Template", templateActionMap, $actionMenu, midmenuItemId);
|
||||||
|
//$("#edit_button").show();
|
||||||
buildActionLinkForDetailsTab("Copy Template", templateActionMap, $actionMenu, midmenuItemId);
|
buildActionLinkForDetailsTab("Copy Template", templateActionMap, $actionMenu, midmenuItemId);
|
||||||
buildActionLinkForDetailsTab("Create VM", templateActionMap, $actionMenu, midmenuItemId);
|
buildActionLinkForDetailsTab("Create VM", templateActionMap, $actionMenu, midmenuItemId);
|
||||||
noAvailableActions = false;
|
noAvailableActions = false;
|
||||||
@ -360,6 +356,9 @@ function templateClearDetailsTab() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var templateActionMap = {
|
var templateActionMap = {
|
||||||
|
"Edit Template": {
|
||||||
|
dialogBeforeActionFn : doEditTemplate
|
||||||
|
},
|
||||||
"Delete Template": {
|
"Delete Template": {
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "deletetemplateresponse",
|
asyncJobResponse: "deletetemplateresponse",
|
||||||
@ -392,9 +391,31 @@ var templateActionMap = {
|
|||||||
var DomRTemplateId = 1;
|
var DomRTemplateId = 1;
|
||||||
|
|
||||||
|
|
||||||
function doUpdateTemplate() {
|
function doEditTemplate() {
|
||||||
var $detailsTab = $("#right_panel_content #tab_content_details");
|
var $detailsTab = $("#right_panel_content #tab_content_details");
|
||||||
|
var $readonlyFields = $detailsTab.find("#name, #displaytext, #passwordenabled, #ispublic, #isfeatured, #ostypename");
|
||||||
|
var $editFields = $detailsTab.find("#name_edit, #displaytext_edit, #passwordenabled_edit, #ispublic_edit, #isfeatured_edit, #ostypename_edit");
|
||||||
|
|
||||||
|
$readonlyFields.hide();
|
||||||
|
$editFields.show();
|
||||||
|
$detailsTab.find("#cancel_button, #save_button").show();
|
||||||
|
|
||||||
|
$detailsTab.find("#cancel_button").unbind("click").bind("click", function(event){
|
||||||
|
$editFields.hide();
|
||||||
|
$readonlyFields.show();
|
||||||
|
$("#save_button, #cancel_button").hide();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$detailsTab.find("#save_button").unbind("click").bind("click", function(event){
|
||||||
|
doEditTemplate2($detailsTab);
|
||||||
|
$editFields.hide();
|
||||||
|
$readonlyFields.show();
|
||||||
|
$("#save_button, #cancel_button").hide();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function doEditTemplate2($detailsTab) {
|
||||||
// validate values
|
// validate values
|
||||||
var isValid = true;
|
var isValid = true;
|
||||||
isValid &= validateString("Name", $detailsTab.find("#name_edit"), $detailsTab.find("#name_edit_errormsg"));
|
isValid &= validateString("Name", $detailsTab.find("#name_edit"), $detailsTab.find("#name_edit_errormsg"));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user