mirror of https://github.com/apache/cloudstack.git
cloudStack UI - Instance page - Stop Instance - show "Force Stop Instance" option for root-admin.
This commit is contained in:
parent
e91e0b4174
commit
0611c92cad
|
|
@ -1,5 +1,6 @@
|
|||
#New - Add all new parameters here.
|
||||
|
||||
force.stop.instance=Force Stop Instance
|
||||
force.stop.instance.warning=Force Stop Instance might cause data lost
|
||||
|
||||
#Labels
|
||||
label.PreSetup=PreSetup
|
||||
|
|
|
|||
|
|
@ -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.instance" /></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">
|
||||
|
|
|
|||
|
|
@ -143,7 +143,13 @@ 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",
|
||||
|
|
@ -221,9 +227,8 @@ function bindStopVMButton() {
|
|||
$("#dialog_info_please_select_one_item_in_middle_menu").dialog("open");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#dialog_confirmation")
|
||||
.text(dictionary["message.action.stop.instance"])
|
||||
|
||||
$("#dialog_confirmation_stop_vm")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
$(this).dialog("close");
|
||||
|
|
@ -240,9 +245,11 @@ function bindStopVMButton() {
|
|||
vmToRightPanel($midmenuItem1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var isForced = $("#dialog_confirmation_stop_vm").find("#force_stop_instance").attr("checked").toString();
|
||||
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
var apiCommand = "command=stopVirtualMachine&id="+id;
|
||||
var apiCommand = "command=stopVirtualMachine&id="+id+"&forced="+isForced;
|
||||
doActionToMidMenu(id, apiInfo, apiCommand);
|
||||
}
|
||||
|
||||
|
|
@ -1412,15 +1419,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