diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index d410e88da1d..555bbc8f929 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -734,6 +734,9 @@ message.zone.step.2.desc=Please enter the following info to add a new zone message.zone.step.3.desc=Please enter the following info to add a new pod message.apply.snapshot.policy=You have successfully updated your current snapshot policy. message.disable.snapshot.policy=You have successfully disabled your current snapshot policy. +message.action.change.service.warning=Your instance must be stopped before attempting to change its current service offering. +message.action.reset.password.warning=Your instance must be stopped before attempting to change its current password. +message.action.reset.password.off=Your instance currently does not support this feature. #Errors error.login=Your username/password does not match our records. diff --git a/client/WEB-INF/classes/resources/messages_es.properties b/client/WEB-INF/classes/resources/messages_es.properties index bc3d0428b71..0e91d78681f 100644 --- a/client/WEB-INF/classes/resources/messages_es.properties +++ b/client/WEB-INF/classes/resources/messages_es.properties @@ -734,6 +734,9 @@ message.zone.step.2.desc = Por favor ingrese los siguientes datos para agregar u message.zone.step.3.desc = Por favor ingrese los siguientes datos para agregar una vaina nueva message.apply.snapshot.policy = Ha actualizado su política instantánea actual. message.disable.snapshot.policy = Ha desactivado su política instantánea actual. +message.action.change.service.warning = Su ejemplo debe ser detenido antes de intentar cambiar su oferta de servicios actual. +message.action.reset.password.warning = Su ejemplo debe ser detenido antes de intentar cambiar su contraseña actual. +message.action.reset.password.off = Su ejemplo en la actualidad no es compatible con esta función. #Errors diff --git a/client/WEB-INF/classes/resources/messages_ja.properties b/client/WEB-INF/classes/resources/messages_ja.properties index 20b9c98081b..e4849fbc70f 100644 --- a/client/WEB-INF/classes/resources/messages_ja.properties +++ b/client/WEB-INF/classes/resources/messages_ja.properties @@ -734,6 +734,9 @@ message.zone.step.2.desc=新しいZoneを追加するために、次の情報を message.zone.step.3.desc=新しいPodを追加するために、次の情報を入力してください。 message.apply.snapshot.policy=あなたが正常に現在のスナップショットのポリシーを更新している。 message.disable.snapshot.policy=あなたが正常に現在のスナップショットのポリシーを無効にしている。 +message.action.change.service.warning=あなたのインスタンスは、現在のサービスの提供を変更する前に停止する必要があります。 +message.action.reset.password.warning=あなたのインスタンスは、その現在のパスワードを変更しようとする前に停止する必要があります。 +message.action.reset.password.off=あなたのインスタンスは、現在この機能をサポートしていません。 #Errors error.login=ユーザ名/パスワードが記録と一致しません diff --git a/client/WEB-INF/classes/resources/messages_zh_CN.properties b/client/WEB-INF/classes/resources/messages_zh_CN.properties index 87855d04600..2a3847806cf 100644 --- a/client/WEB-INF/classes/resources/messages_zh_CN.properties +++ b/client/WEB-INF/classes/resources/messages_zh_CN.properties @@ -734,6 +734,9 @@ message.zone.step.2.desc =请输入下面的信息以添加一个新的Zone message.zone.step.3.desc =请输入下面的信息以添加一个新的Pod message.apply.snapshot.policy=您已成功更新您的当前快照的政策。 message.disable.snapshot.policy=你已经成功停用了您的当前快照的政策。 +message.action.change.service.warning=您的实例之前,必须停止试图改变其目前提供的服务。 +message.action.reset.password.warning=您的实例之前,必须停止试图改变其目前的密码。 +message.action.reset.password.off=您的实例目前不支持此功能。 #Errors error.login=您的用户名/密码与我们的记录不匹配。 diff --git a/ui/jsp/instance.jsp b/ui/jsp/instance.jsp index 9c02f1a4fea..070a5bafa41 100644 --- a/ui/jsp/instance.jsp +++ b/ui/jsp/instance.jsp @@ -46,7 +46,10 @@ dictionary = { 'label.root.disk.offering': '', 'label.full': '', 'label.available': '', - 'message.launch.vm.on.private.network': '' + 'message.launch.vm.on.private.network': '', + 'message.action.change.service.warning': '', + 'message.action.reset.password.warning': '', + 'message.action.reset.password.off': '' }; diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 98e9539df44..112d547f4db 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -1606,14 +1606,35 @@ function doDetachISO($actionLink, $detailsTab, $midmenuItem1) { }).dialog("open"); } -function doResetPassword($actionLink, $detailsTab, $midmenuItem1) { +function doResetPassword($actionLink, $detailsTab, $midmenuItem1) { + var jsonObj = $midmenuItem1.data("jsonObj"); + + if (jsonObj.passwordenabled == false) { + $("#dialog_info") + .text(dictionary["message.action.reset.password.off"]) + .dialog('option', 'buttons', { + "OK": function() { + $(this).dialog("close"); + } + }).dialog("open"); + return; + } else if (jsonObj.state != 'Stopped') { + $("#dialog_info") + .text(dictionary["message.action.reset.password.warning"]) + .dialog('option', 'buttons', { + "OK": function() { + $(this).dialog("close"); + } + }).dialog("open"); + return; + } + $("#dialog_confirmation") .text(dictionary["message.action.instance.reset.password"]) .dialog('option', 'buttons', { "Yes": function() { $(this).dialog("close"); - var jsonObj = $midmenuItem1.data("jsonObj"); if(jsonObj.passwordenabled != true) { var $afterActionInfoContainer = $("#right_panel_content #after_action_info_container_on_top"); $afterActionInfoContainer.find("#after_action_info").text("Reset password failed. Reason: This instance is not using a template that has the password reset feature enabled. If you have forgotten your root password, please contact support."); @@ -1633,7 +1654,18 @@ function doResetPassword($actionLink, $detailsTab, $midmenuItem1) { function doChangeService($actionLink, $detailsTab, $midmenuItem1) { var jsonObj = $midmenuItem1.data("jsonObj"); - var id = jsonObj.id; + var id = jsonObj.id; + + if (jsonObj.state != 'Stopped') { + $("#dialog_info") + .text(dictionary['message.action.change.service.warning']) + .dialog('option', 'buttons', { + "OK": function() { + $(this).dialog("close"); + } + }).dialog("open"); + return; + } $.ajax({ data: createURL("command=listServiceOfferings&VirtualMachineId="+id), @@ -1904,7 +1936,8 @@ function vmBuildActionMenu(jsonObj, $thisTab, $midmenuItem1) { else buildActionLinkForTab("label.action.detach.iso", vmActionMap, $actionMenu, $midmenuItem1, $thisTab); - buildActionLinkForTab("label.action.reset.password", vmActionMap, $actionMenu, $midmenuItem1, $thisTab); + buildActionLinkForTab("label.action.reset.password", vmActionMap, $actionMenu, $midmenuItem1, $thisTab); + buildActionLinkForTab("label.action.change.service", vmActionMap, $actionMenu, $midmenuItem1, $thisTab); noAvailableActions = false; } else if (jsonObj.state == 'Stopped') {