[pve-devel] applied: [PATCH v2 manager] fix #1928: ct snapshot: changed rollback message to warning

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 16 12:22:07 CET 2018


On 11/16/18 12:02 PM, Tim Marx wrote:
> Signed-off-by: Tim Marx <t.marx at proxmox.com>
> ---
> changes since v1:
> *swap snapname & snaptime
> *warning message shortened

applied, thanks!

> 
>  www/manager6/lxc/SnapshotTree.js | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/lxc/SnapshotTree.js b/www/manager6/lxc/SnapshotTree.js
> index 4996e2e3..3a84f891 100644
> --- a/www/manager6/lxc/SnapshotTree.js
> +++ b/www/manager6/lxc/SnapshotTree.js
> @@ -156,11 +156,17 @@ Ext.define('PVE.lxc.SnapshotTree', {
>  	var rollbackBtn = new Proxmox.button.Button({
>  	    text: gettext('Rollback'),
>  	    disabled: true,
> +	    dangerous: true,
>  	    selModel: sm,
>  	    enableFn: valid_snapshot_rollback,
>  	    confirmMsg: function(rec) {
> -		return Proxmox.Utils.format_task_description('vzrollback', me.vmid) +
> -		    " '" +  rec.data.name + "'";
> +		var taskdescription = Proxmox.Utils.format_task_description('vzrollback', me.vmid);
> +		var snaptime = Ext.Date.format(rec.data.snaptime,'Y-m-d H:i:s');
> +		var snapname = rec.data.name;
> +		var msg = Ext.String.format(gettext('{0} to {1} - {2}')+
> +		gettext('<p>Note: Rollback stops CT</p>'),
> +		taskdescription, snapname, snaptime);

I followed up with a commit which moves the HTML <p> tags out from the gettext
and does the msg assembly in two steps, 1. String.format 2. add Note seemed a bit
cleaner to me and didn't want to irk you with a v3 with this nit of mine :-)

> +		return msg;
>  	    },
>  	    handler: function(btn, event) {
>  		var rec = sm.getSelection()[0];
> 





More information about the pve-devel mailing list