ui: reverse showColumns to hideColumns, default to hide comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-11-15 19:37:21 +01:00
parent 896475ee5b
commit 6ecc74209f

View File

@ -311,7 +311,7 @@ Ext.define('PVE.storage.ContentView', {
} }
); );
var availableColumns = { let availableColumns = {
'name': { 'name': {
header: gettext('Name'), header: gettext('Name'),
flex: 2, flex: 2,
@ -343,13 +343,12 @@ Ext.define('PVE.storage.ContentView', {
}, },
}; };
if (!me.showColumns) { if (me.hideColumns) {
me.showColumns = ['name', 'comment', 'date', 'format', 'size']; me.hideColumns.forEach(key => delete availableColumns[key]);
} else if (!me.hasCommentColumn) {
delete availableColumns.comment;
} }
var columns = []; const columns = Object.values(availableColumns);
me.showColumns.forEach(function(datum) {
columns.push(availableColumns[datum]);
});
Ext.apply(me, { Ext.apply(me, {
store: store, store: store,