ext6migrate: fix StatuView and Summary

we move the static configuration to the class definiton
change applyIf to apply
and change the show event to activate

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-03-10 11:46:58 +01:00 committed by Dietmar Maurer
parent 3b422683cf
commit e857c94adc
2 changed files with 59 additions and 63 deletions

View File

@ -2,20 +2,10 @@ Ext.define('PVE.storage.StatusView', {
extend: 'PVE.grid.ObjectGrid',
alias: 'widget.pveStorageStatusView',
initComponent : function() {
var me = this;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
throw "no node name specified";
}
var storage = me.pveSelNode.data.storage;
if (!storage) {
throw "no storage ID specified";
}
var rows = {
title: gettext('Status'),
cwidth1: 150,
interval: 30000,
rows : {
disable: {
header: gettext('Enabled'),
required: true,
@ -56,15 +46,22 @@ Ext.define('PVE.storage.StatusView', {
required: true,
renderer: PVE.Utils.render_size
}
};
},
initComponent : function() {
var me = this;
Ext.applyIf(me, {
title: gettext('Status'),
var nodename = me.pveSelNode.data.node;
if (!nodename) {
throw "no node name specified";
}
var storage = me.pveSelNode.data.storage;
if (!storage) {
throw "no storage ID specified";
}
Ext.apply(me, {
url: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/status",
cwidth1: 150,
interval: 30000,
//height: 195,
rows: rows
});
me.callParent();

View File

@ -1,7 +1,18 @@
Ext.define('PVE.storage.Summary', {
extend: 'Ext.panel.Panel',
alias: 'widget.pveStorageSummary',
scrollable: true,
bodyPadding: 10,
defaults: {
style: 'padding-top:10px',
width: 800
},
tbar: [
'->',
{
xtype: 'pveRRDTypeSelector'
}
],
initComponent: function() {
var me = this;
@ -25,18 +36,6 @@ Ext.define('PVE.storage.Summary', {
var rrdurl = "/api2/png/nodes/" + nodename + "/storage/" + storage + "/rrd";
Ext.apply(me, {
autoScroll: true,
bodyStyle: 'padding:10px',
defaults: {
style: 'padding-top:10px',
width: 800
},
tbar: [
'->',
{
xtype: 'pveRRDTypeSelector'
}
],
items: [
statusview,
{
@ -49,7 +48,7 @@ Ext.define('PVE.storage.Summary', {
]
});
me.on('show', rstore.startUpdate);
me.on('activate', rstore.startUpdate);
me.on('hide', rstore.stopUpdate);
me.on('destroy', rstore.stopUpdate);