mirror of
				https://git.proxmox.com/git/pve-manager
				synced 2025-11-04 08:57:09 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			56 lines
		
	
	
		
			909 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			909 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
Ext.define('PVE.form.GroupSelector', {
 | 
						|
    extend: 'PVE.form.ComboGrid',
 | 
						|
    alias: ['widget.pveGroupSelector'],
 | 
						|
 | 
						|
    allowBlank: false,
 | 
						|
 | 
						|
    initComponent: function() {
 | 
						|
	var me = this;
 | 
						|
 | 
						|
	var store = new Ext.data.Store({
 | 
						|
	    model: 'pve-groups'
 | 
						|
	});
 | 
						|
 | 
						|
	Ext.apply(me, {
 | 
						|
	    store: store,
 | 
						|
	    autoSelect: false,
 | 
						|
	    valueField: 'groupid',
 | 
						|
	    displayField: 'groupid',
 | 
						|
            listConfig: {
 | 
						|
		columns: [
 | 
						|
		    {
 | 
						|
			header: gettext('Group'),
 | 
						|
			sortable: true,
 | 
						|
			dataIndex: 'groupid',
 | 
						|
			flex: 1
 | 
						|
		    },
 | 
						|
		    {
 | 
						|
			id: 'comment',
 | 
						|
			header: 'Comment',
 | 
						|
			sortable: false,
 | 
						|
			dataIndex: 'comment',
 | 
						|
			flex: 1
 | 
						|
		    }
 | 
						|
		]
 | 
						|
	    }
 | 
						|
	});
 | 
						|
 | 
						|
        me.callParent();
 | 
						|
 | 
						|
	store.load();
 | 
						|
    }
 | 
						|
 | 
						|
}, function() {
 | 
						|
 | 
						|
    Ext.define('pve-groups', {
 | 
						|
	extend: 'Ext.data.Model',
 | 
						|
	fields: [ 'groupid', 'comment' ],
 | 
						|
	proxy: {
 | 
						|
            type: 'pve',
 | 
						|
	    url: "/api2/json/access/groups"
 | 
						|
	},
 | 
						|
	idProperty: 'groupid'
 | 
						|
    });
 | 
						|
 | 
						|
});
 |