add type column to storage content view

and move the grouping feature in the class definition while changing
the text to a generic one

this allows us to group by all columns and still have meaningful
grouping headers

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-01-10 15:17:04 +01:00 committed by Dietmar Maurer
parent 7c3a011345
commit 93cdb62689

View File

@ -331,6 +331,12 @@ Ext.define('PVE.storage.ContentView', {
trackOver: false,
loadMask: false
},
features: [
{
ftype: 'grouping',
groupHeaderTpl: '{name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
}
],
initComponent : function() {
var me = this;
@ -360,10 +366,6 @@ Ext.define('PVE.storage.ContentView', {
var sm = Ext.create('Ext.selection.RowModel', {});
var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
groupHeaderTpl: '{[ PVE.Utils.format_content_types(values.name) ]} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
});
var reload = function() {
store.load();
me.statusStore.load();
@ -406,7 +408,6 @@ Ext.define('PVE.storage.ContentView', {
Ext.apply(me, {
store: store,
selModel: sm,
features: [ groupingFeature ],
tbar: [
{
xtype: 'pveButton',
@ -516,6 +517,12 @@ Ext.define('PVE.storage.ContentView', {
width: 100,
dataIndex: 'format'
},
{
header: gettext('Type'),
width: 100,
dataIndex: 'content',
renderer: PVE.Utils.format_content_types
},
{
header: gettext('Size'),
width: 100,