ui: add port support for remotes
by adding a field to RemoteEdit and showing it in the grid Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
		
				
					committed by
					
						
						Dietmar Maurer
					
				
			
			
				
	
			
			
			
						parent
						
							ba20987ae7
						
					
				
				
					commit
					9c33683c25
				
			@ -1,6 +1,15 @@
 | 
				
			|||||||
Ext.define('pmx-remotes', {
 | 
					Ext.define('pmx-remotes', {
 | 
				
			||||||
    extend: 'Ext.data.Model',
 | 
					    extend: 'Ext.data.Model',
 | 
				
			||||||
    fields: ['name', 'host', 'userid', 'fingerprint', 'comment'],
 | 
					    fields: ['name', 'host', 'port', 'userid', 'fingerprint', 'comment',
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
						    name: 'server',
 | 
				
			||||||
 | 
						    calculate: function(data) {
 | 
				
			||||||
 | 
							let host = data.host || "localhost";
 | 
				
			||||||
 | 
							let port = data.port || "8007";
 | 
				
			||||||
 | 
							return `${host}:${port}`;
 | 
				
			||||||
 | 
						    }
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
    idProperty: 'name',
 | 
					    idProperty: 'name',
 | 
				
			||||||
    proxy: {
 | 
					    proxy: {
 | 
				
			||||||
	type: 'proxmox',
 | 
						type: 'proxmox',
 | 
				
			||||||
@ -109,7 +118,7 @@ Ext.define('PBS.config.RemoteView', {
 | 
				
			|||||||
	    header: gettext('Host'),
 | 
						    header: gettext('Host'),
 | 
				
			||||||
	    width: 200,
 | 
						    width: 200,
 | 
				
			||||||
	    sortable: true,
 | 
						    sortable: true,
 | 
				
			||||||
	    dataIndex: 'host',
 | 
						    dataIndex: 'server',
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	    header: gettext('User name'),
 | 
						    header: gettext('User name'),
 | 
				
			||||||
 | 
				
			|||||||
@ -48,6 +48,16 @@ Ext.define('PBS.window.RemoteEdit', {
 | 
				
			|||||||
		name: 'host',
 | 
							name: 'host',
 | 
				
			||||||
		fieldLabel: gettext('Host'),
 | 
							fieldLabel: gettext('Host'),
 | 
				
			||||||
	    },
 | 
						    },
 | 
				
			||||||
 | 
						    {
 | 
				
			||||||
 | 
							xtype: 'proxmoxintegerfield',
 | 
				
			||||||
 | 
							allowBlank: true,
 | 
				
			||||||
 | 
							minValue: 1,
 | 
				
			||||||
 | 
							maxValue: 2**16,
 | 
				
			||||||
 | 
							name: 'port',
 | 
				
			||||||
 | 
							emptyText: 8007,
 | 
				
			||||||
 | 
							deleteEmpty: true,
 | 
				
			||||||
 | 
							fieldLabel: gettext('Port'),
 | 
				
			||||||
 | 
						    },
 | 
				
			||||||
	],
 | 
						],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	column2: [
 | 
						column2: [
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user