mirror of https://github.com/apache/cloudstack.git
cloudStack - UserVM page - Stop VM action - add option "Force Stop".
This commit is contained in:
parent
5a9233f4ea
commit
140d872259
|
|
@ -13,6 +13,9 @@ label.cidr.list=Source CIDR
|
|||
force.delete=Force Delete
|
||||
force.delete.domain.warning=Warning: Choosing this option will cause the deletion of all child domains and all associated accounts and their resources.
|
||||
|
||||
force.stop=Force Stop
|
||||
force.stop.instance.warning=Warning: Forcing a stop on this instance should be your last option. It can lead to data loss as well as inconsistent behavior of the virtual machine's state. Please consult with the Administrator Guide or Cloud.com Support before executing this command.
|
||||
|
||||
label.PreSetup=PreSetup
|
||||
label.SR.name = SR Name-Label
|
||||
label.SharedMountPoint=SharedMountPoint
|
||||
|
|
|
|||
|
|
@ -1452,6 +1452,28 @@ dictionary = {
|
|||
</div>
|
||||
</div>
|
||||
<!-- Create template of disk volume dialog (end) -->
|
||||
|
||||
<!-- Confirm to stop VM (begin) -->
|
||||
<div id="dialog_confirmation_stop_vm" title='<fmt:message key="label.confirmation"/>' style="display: none">
|
||||
<p>
|
||||
<fmt:message key="message.action.stop.instance" />
|
||||
</p>
|
||||
<div class="dialog_formcontent" id="force_stop_instance_container" style="display:none">
|
||||
<form action="#" method="post" id="form_acquire">
|
||||
<ol>
|
||||
<li style="padding-top:10px">
|
||||
<input type="checkbox" class="checkbox" id="force_stop_instance" />
|
||||
<p style="color:red"><fmt:message key="force.stop" /></p>
|
||||
</li>
|
||||
<li>
|
||||
<p style="color:red"><fmt:message key="force.stop.instance.warning" /></p>
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Confirm to stop VM (end) -->
|
||||
|
||||
<!-- ***** Dialogs (end) ***** -->
|
||||
|
||||
<div id="hidden_container">
|
||||
|
|
|
|||
|
|
@ -140,7 +140,14 @@ function afterLoadInstanceJSP() {
|
|||
initDialog("dialog_change_service_offering", 600);
|
||||
initDialog("dialog_create_template", 400);
|
||||
initDialog("dialog_migrate_instance", 600);
|
||||
|
||||
initDialog("dialog_confirmation_stop_vm");
|
||||
|
||||
var $dialogStopVm = $("#dialog_confirmation_stop_vm");
|
||||
if(isAdmin()) {
|
||||
$dialogStopVm.find("#force_stop_instance_container").show();
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=listOsTypes"),
|
||||
dataType: "json",
|
||||
|
|
@ -219,8 +226,7 @@ function bindStopVMButton() {
|
|||
return false;
|
||||
}
|
||||
|
||||
$("#dialog_confirmation")
|
||||
.text(dictionary["message.action.stop.instance"])
|
||||
$("#dialog_confirmation_stop_vm")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
$(this).dialog("close");
|
||||
|
|
@ -237,11 +243,13 @@ function bindStopVMButton() {
|
|||
vmToRightPanel($midmenuItem1);
|
||||
}
|
||||
}
|
||||
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
var apiCommand = "command=stopVirtualMachine&id="+id;
|
||||
doActionToMidMenu(id, apiInfo, apiCommand);
|
||||
}
|
||||
|
||||
var isForced = $("#dialog_confirmation_stop_vm").find("#force_stop_instance").attr("checked").toString();
|
||||
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
var apiCommand = "command=stopVirtualMachine&id="+id+"&forced="+isForced;
|
||||
doActionToMidMenu(id, apiInfo, apiCommand);
|
||||
}
|
||||
|
||||
selectedItemsInMidMenu = {}; //clear selected items for action
|
||||
},
|
||||
|
|
@ -1409,15 +1417,15 @@ function doStartVM($actionLink, $detailsTab, $midmenuItem1) {
|
|||
}
|
||||
|
||||
function doStopVM($actionLink, $detailsTab, $midmenuItem1) {
|
||||
$("#dialog_confirmation")
|
||||
.text(dictionary["message.action.stop.instance"])
|
||||
$("#dialog_confirmation_stop_vm")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
$(this).dialog("close");
|
||||
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
var id = jsonObj.id;
|
||||
var apiCommand = "command=stopVirtualMachine&id="+id;
|
||||
var id = jsonObj.id;
|
||||
var isForced = $("#dialog_confirmation_stop_vm").find("#force_stop_instance").attr("checked").toString();
|
||||
var apiCommand = "command=stopVirtualMachine&id="+id+"&forced="+isForced;
|
||||
doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab);
|
||||
},
|
||||
"Cancel": function() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue