diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 2fdd1e50ea2..b3729acd472 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -715,7 +715,7 @@ message.number.zones=

# of Zones

message.remove.vpn.access=Please confirm that you want to remove VPN access from the following user. message.restart.mgmt.server=Please restart your management server(s) for your new settings to take effect. message.security.group.usage=(Use Ctrl-click to select all applicable security groups) -message.snapshot.schedule=Your snapshot schedule is currently set to +message.snapshot.schedule=You can setup recurring snapshot schedules by selecting from the available options below and applying your policy preference message.step.1.continue=Please select a template or ISO to continue message.step.1.desc=Please select a template for your new virtual instance. You can also choose to select a blank template from which an ISO image can be installed onto. message.step.2.continue=Please select a service offering to continue @@ -731,6 +731,8 @@ message.volume.create.template.confirm=Please confirm that you wish to create a message.zone.step.1.desc=Please select a network model for your zone. 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. #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 310912df12d..fa11c3d2ac7 100644 --- a/client/WEB-INF/classes/resources/messages_es.properties +++ b/client/WEB-INF/classes/resources/messages_es.properties @@ -715,7 +715,7 @@ message.number.zones =

# de Zonas

message.remove.vpn.access = Por favor, confirme que desea eliminar el acceso VPN desde el siguiente usuario message.restart.mgmt.server = Por favor, reinicie el servidor de administración (s) para la nueva configuración surta efecto. message.security.group.usage = (Uso pulse Ctrl para seleccionar todos los grupos de seguridad se aplica) -message.snapshot.schedule = Su programación de instantáneas está configurado para +message.snapshot.schedule = Puede horarios de configuración recurrente instantáneas mediante la selección de las opciones disponibles a continuación y la aplicación de su preferencia política message.step.1.continue = Por favor seleccione una plantilla o ISO para continuar message.step.1.desc = Por favor seleccione una plantilla para la instancia virtual. También puede optar por seleccionar una plantilla en blanco desde el que puede ser una imagen ISO instalado en. message.step.2.continue = Por favor seleccione una oferta de servicio para continuar @@ -731,6 +731,8 @@ message.volume.create.template.confirm = Por favor, confirme que desea crear una message.zone.step.1.desc = Por favor seleccione un modelo de red para su zona. message.zone.step.2.desc = Por favor ingrese los siguientes datos para agregar una nueva zona 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. #Errors diff --git a/client/WEB-INF/classes/resources/messages_ja.properties b/client/WEB-INF/classes/resources/messages_ja.properties index ffb2aea15bc..56cad27f631 100644 --- a/client/WEB-INF/classes/resources/messages_ja.properties +++ b/client/WEB-INF/classes/resources/messages_ja.properties @@ -715,7 +715,7 @@ message.number.zones=

# -- Zone

message.remove.vpn.access=次のユーザからのVPNアクセスを削除してもよろしいですか? message.restart.mgmt.server=新しい設定を有効にするために、管理サーバ(複数可)を再起動してください。 message.security.group.usage=全ての該当するセキュリティグループを選択するには、 Ctrlキーを押しながらクリックしてください。 -message.snapshot.schedule =スナップショットスケジュールは現在設定されています。 +message.snapshot.schedule =あなたは以下のオプションから選択し、適用、ポリシー設定をすることにより、セットアップ定期的なスナップショットをスケジュールすることができます message.step.1.continue=テンプレートまたはISOイメージを選択して続行してください message.step.1.desc=新しい仮想インスタンス用のテンプレートを選択してください。ISOイメージがインストールされているブランクのテンプレートを選択することもできます。 message.step.2.continue=サービスオファリングを選択して続行してください @@ -731,6 +731,8 @@ message.volume.create.template.confirm=このディスクボリューム用の message.zone.step.1.desc=Zoneのネットワークモデルを選択してください。 message.zone.step.2.desc=新しいZoneを追加するために、次の情報を入力してください。 message.zone.step.3.desc=新しいPodを追加するために、次の情報を入力してください。 +message.apply.snapshot.policy=あなたが正常に現在のスナップショットのポリシーを更新している。 +message.disable.snapshot.policy=あなたが正常に現在のスナップショットのポリシーを無効にしている。 #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 825103c79a6..7496f20fbf3 100644 --- a/client/WEB-INF/classes/resources/messages_zh_CN.properties +++ b/client/WEB-INF/classes/resources/messages_zh_CN.properties @@ -715,7 +715,7 @@ message.number.zones =

# of Zones

message.remove.vpn.access =请确认您要删除来自下列用户VPN接入 message.restart.mgmt.server =请重新启动管理服务器,以使您的新设置生效。 message.security.group.usage =(使用 Ctrl-click 来选者所有可应用的安全组) -message.snapshot.schedule =您的快照的日程目前设定为 +message.snapshot.schedule =你可以从下面选择可用的选项和应用的政策优惠设置重复快照计划 message.step.1.continue =请选择一个模板或光盘以继续 message.step.1.desc =请为您的新虚拟机选择一个模板。您也可以选择选择一个空白模板,一个光盘可以被安装到这个模板之上。 message.step.2.continue =请选择服务Offering以继续 @@ -731,6 +731,8 @@ message.volume.create.template.confirm =请确认您希望从该卷上创建模 message.zone.step.1.desc =请为您的Zone,选择网络模型。 message.zone.step.2.desc =请输入下面的信息以添加一个新的Zone message.zone.step.3.desc =请输入下面的信息以添加一个新的Pod +message.apply.snapshot.policy=您已成功更新您的当前快照的政策。 +message.disable.snapshot.policy=你已经成功停用了您的当前快照的政策。 #Errors error.login=您的用户名/密码与我们的记录不匹配。 diff --git a/ui/css/main.css b/ui/css/main.css index ffa49be2a48..5bffeb8969b 100644 --- a/ui/css/main.css +++ b/ui/css/main.css @@ -5372,7 +5372,7 @@ a:hover.search_button { .dialog_snapshotleft_actions a:link {width:auto; height:auto; margin:0 5px 0 0; padding:0; color:#2c8bbc; text-decoration:none; font-size:11px;} .dialog_snapshotleft_actions a:visited {width:auto; height:auto; margin:0 5px 0 0; padding:0; color:#2c8bbc; text-decoration:none; font-size:11px;} .dialog_snapshotleft_actions a:hover {width:auto; height:auto; margin:0 5px 0 0; padding:0; color:#2c8bbc; text-decoration:underline; font-size:11px;} -.dialog_snapshotright {width:400px; height:150px; float:left; margin:0; padding:15px 0 0 0; } +.dialog_snapshotright {width:400px; height:150px; float:left; margin:0; padding:30px 0 0 0; } .dialog_snapshotright_infotext{width:360px; height:160px; float:left; display:none; margin:0; padding:0; font-size:15px; font-family:Arial, Helvetica, sans-serif; font-size:normal; text-align:left; margin:10px; color:#333;} .dialog_snapshots_editcontent {width:350px; height:auto; float:left; margin:0; padding:0;} .dialog_snapshots_editcontent_title {width:280px; height:auto; float:left; margin:0; padding:0;} diff --git a/ui/jsp/volume.jsp b/ui/jsp/volume.jsp index d7263ffbde6..b34fd9de6e1 100644 --- a/ui/jsp/volume.jsp +++ b/ui/jsp/volume.jsp @@ -26,7 +26,9 @@ dictionary = { 'label.action.delete.snapshot' : '', 'label.action.delete.snapshot.processing' : '', 'message.action.delete.snapshot' : '', - 'message.download.volume' : '' + 'message.download.volume' : '', + 'message.disable.snapshot.policy' : '', + 'message.apply.snapshot.policy' : '' }; @@ -308,12 +310,11 @@ dictionary = {
 :   
+ + + + + : Enabled
@@ -541,6 +542,12 @@ dictionary = {
+ diff --git a/ui/scripts/cloud.core.volume.js b/ui/scripts/cloud.core.volume.js index 5f5cea11826..bb77b89b5e4 100644 --- a/ui/scripts/cloud.core.volume.js +++ b/ui/scripts/cloud.core.volume.js @@ -226,12 +226,16 @@ function afterLoadVolumeJSP() { $("#snapshot_interval").change(function(event) { var thisElement = $(this); var snapshotInterval = thisElement.val(); - var jsonObj = thisElement.data("jsonObj"); + var $snapshotIntervalOption = thisElement.find("#snapshot_interval_"+snapshotInterval); + var jsonObj = $snapshotIntervalOption.data("jsonObj"); var $dialog = $("#dialog_recurring_snapshot"); + if (jsonObj == undefined || jsonObj == null) { + $dialog.find("#policy_enabled").text("Disabled"); + } else { + $dialog.find("#policy_enabled").text("Enabled"); + } + $dialog.find("#info_container").hide(); switch (snapshotInterval) { - case "-1": - $dialog.find("#snapshot_form").hide(); - break; case "0": $dialog.find("#edit_time_colon, #edit_hour_container, #edit_meridiem_container, #edit_day_of_week_container, #edit_day_of_month_container").hide(); $dialog.find("#edit_past_the_hour, #edit_minute_container").show(); @@ -239,6 +243,10 @@ function afterLoadVolumeJSP() { $dialog.find("#edit_minute").val(jsonObj.schedule); $dialog.find("#edit_max").val(jsonObj.maxsnaps); $dialog.find("#edit_timezone").val(jsonObj.timezone); + } else { + $dialog.find("#edit_minute").val(""); + $dialog.find("#edit_max").val(""); + $dialog.find("#edit_timezone").val(""); } $dialog.find("#snapshot_form").show(); break; @@ -266,7 +274,13 @@ function afterLoadVolumeJSP() { $dialog.find("#edit_meridiem").val(meridiem); $dialog.find("#edit_max").val(jsonObj.maxsnaps); $dialog.find("#edit_timezone").val(jsonObj.timezone); - } + } else { + $dialog.find("#edit_minute").val(""); + $dialog.find("#edit_hour").val(""); + $dialog.find("#edit_meridiem").val(""); + $dialog.find("#edit_max").val(""); + $dialog.find("#edit_timezone").val(""); + } $dialog.find("#snapshot_form").show(); break; case "2": @@ -294,6 +308,13 @@ function afterLoadVolumeJSP() { $dialog.find("#edit_day_of_week").val(parts[2]); $dialog.find("#edit_max").val(jsonObj.maxsnaps); $dialog.find("#edit_timezone").val(jsonObj.timezone); + } else { + $dialog.find("#edit_minute").val(""); + $dialog.find("#edit_hour").val(""); + $dialog.find("#edit_meridiem").val(""); + $dialog.find("#edit_day_of_week").val(""); + $dialog.find("#edit_max").val(""); + $dialog.find("#edit_timezone").val(""); } $dialog.find("#snapshot_form").show(); break; @@ -321,6 +342,13 @@ function afterLoadVolumeJSP() { $dialog.find("#edit_day_of_month").val(parts[2]); $dialog.find("#edit_max").val(jsonObj.maxsnaps); $dialog.find("#edit_timezone").val(jsonObj.timezone); + } else { + $dialog.find("#edit_minute").val(""); + $dialog.find("#edit_hour").val(""); + $dialog.find("#edit_meridiem").val(""); + $dialog.find("#edit_day_of_month").val(""); + $dialog.find("#edit_max").val(""); + $dialog.find("#edit_timezone").val(""); } $dialog.find("#snapshot_form").show(); break; @@ -806,12 +834,15 @@ function doRecurringSnapshot($actionLink, $detailsTab, $midmenuItem1) { var items = json.listsnapshotpoliciesresponse.snapshotpolicy; var $snapInterval = dialogBox.find("#snapshot_interval"); if(items!=null && items.length>0) { - var item = items[0]; // We only expect a single policy. - $snapInterval.val(item.intervaltype).data("jsonObj", item); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + $snapInterval.find("#snapshot_interval_"+item.intervaltype).data("jsonObj", item); + } } else { - $snapInterval.val("-1").data("jsonObj", null); + // Maybe use a different message } clearBottomPanel(); + $snapInterval.val("0"); //default to hourly $snapInterval.change(); dialogBox.dialog('option', 'buttons', { @@ -823,23 +854,6 @@ function doRecurringSnapshot($actionLink, $detailsTab, $midmenuItem1) { var intervalType = thisDialog.find("#snapshot_interval").val(); var minute, hour12, hour24, meridiem, dayOfWeek, dayOfWeekString, dayOfMonth, schedule, max, timezone; switch(intervalType) { - case "-1": - var $snapshotInterval = $(this).find("#snapshot_interval"); - var jsonObj = $snapshotInterval.data("jsonObj"); - if(jsonObj != null) { - $.ajax({ - data: createURL("command=deleteSnapshotPolicies&id="+jsonObj.id), - dataType: "json", - success: function(json) { - $snapshotInterval.val("-1"); - }, - error: function(XMLHttpResponse) { - handleError(XMLHttpResponse); - } - }); - } - thisDialog.dialog("close"); - return false; case "0": var isValid = true; isValid &= validateInteger("Keep # of snapshots", bottomPanel.find("#edit_max"), bottomPanel.find("#edit_max_errormsg")); @@ -906,11 +920,16 @@ function doRecurringSnapshot($actionLink, $detailsTab, $midmenuItem1) { break; } var thisLink; + var $snapshotInterval = thisDialog.find("#snapshot_interval"); + var $snapshotIntervalOption = thisDialog.find("#snapshot_interval_"+$snapshotInterval.val()); $.ajax({ data: createURL("command=createSnapshotPolicy&intervaltype="+intervalType+"&schedule="+schedule+"&volumeid="+volumeId+"&maxsnaps="+max+"&timezone="+todb(timezone)), dataType: "json", success: function(json) { - thisDialog.dialog("close"); + $snapshotIntervalOption.data("jsonObj", json.createsnapshotpolicyresponse.snapshotpolicy); + $snapshotInterval.change(); + thisDialog.find("#info").text(dictionary["message.apply.snapshot.policy"]); + thisDialog.find("#info_container").show(); }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse); @@ -918,21 +937,25 @@ function doRecurringSnapshot($actionLink, $detailsTab, $midmenuItem1) { }); }, "Disable": function() { - var $snapshotInterval = $(this).find("#snapshot_interval"); - var jsonObj = $snapshotInterval.data("jsonObj"); + var thisDialog = $(this); + var $snapshotInterval = thisDialog.find("#snapshot_interval"); + var $snapshotIntervalOption = thisDialog.find("#snapshot_interval_"+$snapshotInterval.val()); + var jsonObj = $snapshotIntervalOption.data("jsonObj"); if(jsonObj != null) { $.ajax({ data: createURL("command=deleteSnapshotPolicies&id="+jsonObj.id), dataType: "json", - success: function(json) { - $snapshotInterval.val("-1"); + success: function(json) { + $snapshotIntervalOption.data("jsonObj", null); + $snapshotInterval.change(); + thisDialog.find("#info").text(dictionary["message.disable.snapshot.policy"]); + thisDialog.find("#info_container").show(); }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse); } }); } - $(this).dialog("close"); }, "Close": function() { $(this).dialog("close");