From b91a319777c590e35692333db059aabefbf0e56a Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 14 Jun 2011 17:52:34 -0700 Subject: [PATCH] bug 9549: CloudStack UI - deleteHost API now takes in new parameter "forced". Here is related UI change: a checkbox "Force Remove" has been added to Remove Host Confirmation Dialog. --- .../classes/resources/messages.properties | 4 +++- .../classes/resources/messages_es.properties | 4 +++- .../classes/resources/messages_ja.properties | 4 +++- .../resources/messages_zh_CN.properties | 4 +++- ui/jsp/host.jsp | 20 +++++++++++++++++++ ui/scripts/cloud.core.host.js | 16 ++++++++++----- 6 files changed, 43 insertions(+), 9 deletions(-) diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 890c3dd5b4a..a7572192aae 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -2,8 +2,10 @@ - #Labels +force.remove=Force Remove +force.remove.host.warning=Warning: Choosing this option will cause CloudStack to forcefully stop all running virtual machines before removing this host from the cluster. + 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. diff --git a/client/WEB-INF/classes/resources/messages_es.properties b/client/WEB-INF/classes/resources/messages_es.properties index 43d0809d25c..e196736832a 100644 --- a/client/WEB-INF/classes/resources/messages_es.properties +++ b/client/WEB-INF/classes/resources/messages_es.properties @@ -2,8 +2,10 @@ - #Labels +force.remove=Fuerza Retire +force.remove.host.warning=Advertencia: Si elige esta opción, CloudStack para detener la fuerza todas las máquinas virtuales en ejecución antes de retirar este host del clúster. + force.stop=Grupo de Alto force.stop.instance.warning=Advertencia: Obligar a una parada en este caso debería ser su última opción. Puede conducir a la pérdida de datos, así como un comportamiento incoherente del estado de la máquina virtual. Por favor, consulte con la Guía del administrador o al Cloud.com antes de ejecutar este comando. diff --git a/client/WEB-INF/classes/resources/messages_ja.properties b/client/WEB-INF/classes/resources/messages_ja.properties index fc82c081c8f..c4249ef1218 100644 --- a/client/WEB-INF/classes/resources/messages_ja.properties +++ b/client/WEB-INF/classes/resources/messages_ja.properties @@ -2,8 +2,10 @@ - #Labels +force.remove=フォース削除 +force.remove.host.warning=警告:CloudStack強制的にクラスタからこのホストを削除する前に、実行中のすべての仮想マシンを停止することが、このオプションを選択する。 + force.stop=強制停止 force.stop.instance.warning=警告:あなたの最後のオプションである必要がありますこのインスタンスの停止を強制する。これは、データの損失だけでなく、仮想マシンの状態の一貫性のない動作につながることができます。このコマンドを実行する前に、管理者ガイド』または『Cloud.comサポートに相談してください。 diff --git a/client/WEB-INF/classes/resources/messages_zh_CN.properties b/client/WEB-INF/classes/resources/messages_zh_CN.properties index 16a6e6ddb9e..98299f589c5 100644 --- a/client/WEB-INF/classes/resources/messages_zh_CN.properties +++ b/client/WEB-INF/classes/resources/messages_zh_CN.properties @@ -2,8 +2,10 @@ - #Labels +force.remove=强行移走 +force.remove.host.warning=警告:选择此选项将导致CloudStack强行删除此之前停止从群集主机上的所有正在运行的虚拟机。 + force.stop=强制停止 force.stop.instance.warning=警告:强制停止在这种情况下应该是你最后的选择。它可以导致数据丢失,以及虚拟机的状态不一致的行为。请与系统管理员指南或Cloud.com支援与顾问在执行此命令。 diff --git a/ui/jsp/host.jsp b/ui/jsp/host.jsp index 8a7d1aa054d..dcb6f540081 100644 --- a/ui/jsp/host.jsp +++ b/ui/jsp/host.jsp @@ -853,6 +853,26 @@ dictionary = { + + +
diff --git a/ui/scripts/cloud.core.host.js b/ui/scripts/cloud.core.host.js index 3cf41276adf..5d5e40fade8 100644 --- a/ui/scripts/cloud.core.host.js +++ b/ui/scripts/cloud.core.host.js @@ -49,7 +49,13 @@ function hostGetSearchParams() { function afterLoadHostJSP() { initDialog("dialog_add_host", 400); initDialog("dialog_update_os"); - + initDialog("dialog_confirmation_remove_host"); + + var $dialogRemoveHost = $("#dialog_confirmation_remove_host"); + if(isAdmin()) { + $dialogRemoveHost.find("#force_remove_host_container").show(); + } + // switch between different tabs var tabArray = [$("#tab_details"), $("#tab_instance"), $("#tab_router"), $("#tab_systemvm"), $("#tab_statistics")]; var tabContentArray = [$("#tab_content_details"), $("#tab_content_instance"), $("#tab_content_router"), $("#tab_content_systemvm"), $("#tab_content_statistics")]; @@ -656,13 +662,13 @@ function doForceReconnect($actionLink, $detailsTab, $midmenuItem1){ function doRemoveHost($actionLink, $detailsTab, $midmenuItem1){ var jsonObj = $midmenuItem1.data("jsonObj"); - $("#dialog_confirmation") - .text(dictionary["message.action.remove.host"]) + $("#dialog_confirmation_remove_host") .dialog("option", "buttons", { "OK": function() { $(this).dialog("close"); - var id = jsonObj.id; - var apiCommand = "command=deleteHost&id="+id; + var id = jsonObj.id; + var isForced = $("#dialog_confirmation_remove_host").find("#force_remove_host").attr("checked").toString(); + var apiCommand = "command=deleteHost&id="+id+"&forced="+isForced; doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab); }, "Cancel": function() {