Skip to content

Commit

Permalink
Merge branch 'proxmox:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
wy414012 authored Nov 12, 2024
2 parents d58957d + f4bf730 commit 7c92c56
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
4 changes: 2 additions & 2 deletions www/manager6/form/ViewSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Ext.define('PVE.form.ViewSelector', {
text: gettext('Pool View'),
groups: ['pool'],
// Pool View only lists VMs and Containers
filterfn: ({ data }) => data.type === 'qemu' || data.type === 'lxc' || data.type === 'pool',
getFilterFn: () => ({ data }) => data.type === 'qemu' || data.type === 'lxc' || data.type === 'pool',
},
tags: {
text: gettext('Tag View'),
groups: ['tag'],
filterfn: ({ data }) => data.type === 'qemu' || data.type === 'lxc',
getFilterFn: () => ({ data }) => data.type === 'qemu' || data.type === 'lxc',
groupRenderer: function(info) {
let tag = PVE.Utils.renderTags(info.tag, PVE.UIOptions.tagOverrides);
return `<span class="proxmox-tags-full">${tag}</span>`;
Expand Down
6 changes: 4 additions & 2 deletions www/manager6/storage/PBSEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,14 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
// old key without FP
values['crypt-key-fp'] = icon + gettext('Active');
}
values.cryptMode = 'keep';
values['crypt-allow-edit'] = false;
} else {
values['crypt-key-fp'] = gettext('None');
let cryptModeNone = me.down('radiofield[inputValue=none]');
cryptModeNone.setBoxLabel(gettext('Do not encrypt backups'));
cryptModeNone.setValue(true);
values.cryptMode = 'none';
values['crypt-allow-edit'] = true;
}
vm.set('keepCryptVisible', !!cryptKeyInfo);
vm.set('allowEdit', !cryptKeyInfo);
Expand Down Expand Up @@ -272,7 +275,6 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
padding: '0 0 0 25',
cbind: {
hidden: '{isCreate}',
checked: '{!isCreate}',
},
bind: {
hidden: '{!keepCryptVisible}',
Expand Down
23 changes: 17 additions & 6 deletions www/manager6/tree/ResourceTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ Ext.define('PVE.tree.ResourceTree', {

useArrows: true,

// private
getTypeOrder: function(type) {
switch (type) {
case 'lxc': return 0;
case 'qemu': return 1;
case 'node': return 2;
case 'sdn': return 3;
case 'storage': return 4;
default: return 9;
}
},

// private
nodeSortFn: function(node1, node2) {
let me = this;
Expand All @@ -55,10 +67,9 @@ Ext.define('PVE.tree.ResourceTree', {
let n2IsGuest = n2.type === 'qemu' || n2.type === 'lxc';
if (me['group-guest-types'] || !n1IsGuest || !n2IsGuest) {
// first sort (group) by type
if (n1.type > n2.type) {
return 1;
} else if (n1.type < n2.type) {
return -1;
let res = me.getTypeOrder(n1.type) - me.getTypeOrder(n2.type);
if (res !== 0) {
return res;
}
}

Expand Down Expand Up @@ -316,7 +327,7 @@ Ext.define('PVE.tree.ResourceTree', {

// also check for name for when the tree is sorted by name
let moveCheckAttrs = groups.concat(['node', 'template', 'name']);
let filterfn = me.viewFilter.filterfn;
let filterFn = me.viewFilter.getFilterFn ? me.viewFilter.getFilterFn() : Ext.identityFn;

let reselect = false; // for disappeared nodes
let index = pdata.dataIndex;
Expand Down Expand Up @@ -388,7 +399,7 @@ Ext.define('PVE.tree.ResourceTree', {
if (olditem) {
return;
}
if (filterfn && !filterfn(item)) {
if (filterFn && !filterFn(item)) {
return;
}
let info = Ext.apply({ leaf: true }, item.data);
Expand Down

0 comments on commit 7c92c56

Please sign in to comment.