pve-manager/www/manager6/form/FileSelector.js
Thomas Lamprecht eae6918493 FileSelector: adapt combogrid total and column width
By default the "Size" column ellipsed a lot entries, which is just
annoying. Adapt it so that all sizes can be viewed comfortably.

Further increase the total width of this combogrid, a lot less could
be seen there since theme change from the 4.X era.
Use an new empirical found out good  working value.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-07-26 15:37:05 +02:00

78 lines
1.4 KiB
JavaScript

Ext.define('PVE.form.FileSelector', {
extend: 'PVE.form.ComboGrid',
alias: 'widget.pveFileSelector',
setStorage: function(storage, nodename) {
var me = this;
var change = false;
if (storage && (me.storage !== storage)) {
me.storage = storage;
change = true;
}
if (nodename && (me.nodename !== nodename)) {
me.nodename = nodename;
change = true;
}
if (!(me.storage && me.nodename && change)) {
return;
}
var url = '/api2/json/nodes/' + me.nodename + '/storage/' + me.storage + '/content';
if (me.storageContent) {
url += '?content=' + me.storageContent;
}
me.store.setProxy({
type: 'pve',
url: url
});
me.store.load();
},
initComponent: function() {
var me = this;
var store = Ext.create('Ext.data.Store', {
model: 'pve-storage-content'
});
Ext.apply(me, {
store: store,
allowBlank: false,
autoSelect: false,
valueField: 'volid',
displayField: 'text',
listConfig: {
width: 600,
columns: [
{
header: gettext('Name'),
dataIndex: 'text',
hideable: false,
flex: 1
},
{
header: gettext('Format'),
width: 60,
dataIndex: 'format'
},
{
header: gettext('Size'),
width: 100,
dataIndex: 'size',
renderer: PVE.Utils.format_size
}
]
}
});
me.callParent();
me.setStorage(me.storage, me.nodename);
}
});