[pve-devel] [PATCH manager 7/7] ui: lxc: add 'more' button with HA manage menu item to panel

Emmanuel Kasper e.kasper at proxmox.com
Mon Oct 16 18:33:17 CEST 2017


On 10/11/2017 12:09 PM, Thomas Lamprecht wrote:
> Move the remove button into the more button and add a 'Manage HA'
> button there, mirroring the changes from the qemu panel.
> 
> Allows to add an unmanaged CT to HA or to edit the HA settings of a
> managed one.
> 
> Fixes: #1518
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>  www/manager6/lxc/Config.js | 42 ++++++++++++++++++++++++++++++------------
>  1 file changed, 30 insertions(+), 12 deletions(-)
> 
> diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
> index d5a6ff7c..4dde5805 100644
> --- a/www/manager6/lxc/Config.js
> +++ b/www/manager6/lxc/Config.js
> @@ -98,16 +98,34 @@ Ext.define('PVE.lxc.Config', {
>  	    iconCls: 'fa fa-send-o'
>  	});
>  
> -	var removeBtn = Ext.create('PVE.button.Button', {
> -	    text: gettext('Remove'),
> -	    disabled: !caps.vms['VM.Allocate'],
> -	    handler: function() {
> -		Ext.create('PVE.window.SafeDestroy', {
> -		    url: base_url,
> -		    item: { type: 'CT', id: vmid }
> -		}).show();
> -	    },
> -	    iconCls: 'fa fa-trash-o'
> +	var moreBtn = Ext.create('PVE.button.Button', {
> +	    text: gettext('More'),
> +	    menu: { items: [
> +		{
> +		    iconCls: 'fa fa-heartbeat ',
> +		    hidden: !caps.nodes['Sys.Console'],
> +		    text: gettext('Manage HA'),
> +		    handler: function() {
> +			var ha = me.pveSelNode.data.hastate;
> +			Ext.create('PVE.ha.VMResourceEdit', {
> +			    vmid: vmid,
> +			    isCreate: (!ha || ha === 'unmanaged')
> +			}).show();
> +		    }
> +		},

I think that in 6/7 and 7/7 we're missing a guestType parameter to pass.

This has the effect that all new created HA resources have the label
'VM' next to their pveGuestIDSelector, including containers.





More information about the pve-devel mailing list