Pool View

LnxBil

Distinguished Member
Feb 21, 2015
8,808
1,400
273
Saarland, Germany
Hi all,

Is it possible to set the initial view to 'pool view' on a per user basis? Or at least change the default to pool view. For most 'ordinary' users would it be best in my opinion to start there - only seeing pools with vm members.

Best regards
Andreas
 
Hi

I found a way to limit the "view" access.
In /usr/share/pve-manager/ext4/pvemanagerlib.js change the following lines.
Only root will see Server View, Folder View, Storage View and Pool View.

I'm sure there is a more elegant way, but I'm not a JavaScript expert ;)
(if you log out root und login some other user, you have to hit the reload button on your browser to make the views disappear - and vice versa)



from

var default_views = {

server: {
text: gettext('Server View'),
groups: ['node']
},
folder: {
text: gettext('Folder View'),
groups: ['type']
},
storage: {
text: gettext('Storage View'),
groups: ['node'],
filterfn: function(node) {
return node.data.type === 'storage' || node.data.type === 'node';
}
},
pool: {
text: gettext('Pool View'),
groups: ['pool'],
// Pool View only lists VMs and Containers
filterfn: function(node) {
return node.data.type === 'qemu' || node.data.type === 'lxc' || node.data.type === 'openvz' ||
node.data.type === 'pool';
}
}
};

to

if (PVE.UserName === 'root@pam'){
var default_views = {

server: {
text: gettext('Server View'),
groups: ['node']
},
folder: {
text: gettext('Folder View'),
groups: ['type']
},
storage: {
text: gettext('Storage View'),
groups: ['node'],
filterfn: function(node) {
return node.data.type === 'storage' || node.data.type === 'node';
}
},
pool: {
text: gettext('Pool View'),
groups: ['pool'],
// Pool View only lists VMs and Containers
filterfn: function(node) {
return node.data.type === 'qemu' || node.data.type === 'lxc' || node.data.type === 'openvz' ||
node.data.type === 'pool';
}
}
};
}

else {
var default_views = {

pool: {
text: gettext('Pool View'),
groups: ['pool'],
// Pool View only lists VMs and Containers
filterfn: function(node) {
return node.data.type === 'qemu' || node.data.type === 'lxc' || node.data.type === 'openvz' ||
node.data.type === 'pool';
}
}
};
}
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!