use RRDTypeSelector from widget toolkit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
956cd0bdda
commit
9946c4bd24
@ -22,7 +22,6 @@ JSSRC= \
|
||||
data/ResourceStore.js \
|
||||
data/model/RRDModels.js \
|
||||
form/VLanField.js \
|
||||
form/RRDTypeSelector.js \
|
||||
form/KVComboBox.js \
|
||||
form/Boolean.js \
|
||||
form/CompressionSelector.js \
|
||||
|
@ -1,49 +0,0 @@
|
||||
Ext.define('PVE.form.RRDTypeSelector', {
|
||||
extend: 'Ext.form.field.ComboBox',
|
||||
alias: ['widget.pveRRDTypeSelector'],
|
||||
|
||||
displayField: 'text',
|
||||
valueField: 'id',
|
||||
editable: false,
|
||||
queryMode: 'local',
|
||||
value: 'hour',
|
||||
stateEvents: [ 'select' ],
|
||||
stateful: true,
|
||||
stateId: 'pveRRDTypeSelection',
|
||||
store: {
|
||||
type: 'array',
|
||||
fields: [ 'id', 'timeframe', 'cf', 'text' ],
|
||||
data : [
|
||||
[ 'hour', 'hour', 'AVERAGE', "Hour (average)" ],
|
||||
[ 'hourmax', 'hour', 'MAX', "Hour (max)" ],
|
||||
[ 'day', 'day', 'AVERAGE', "Day (average)" ],
|
||||
[ 'daymax', 'day', 'MAX', "Day (max)" ],
|
||||
[ 'week', 'week', 'AVERAGE', "Week (average)" ],
|
||||
[ 'weekmax', 'week', 'MAX', "Week (max)" ],
|
||||
[ 'month', 'month', 'AVERAGE', "Month (average)" ],
|
||||
[ 'monthmax', 'month', 'MAX', "Month (max)" ],
|
||||
[ 'year', 'year', 'AVERAGE', "Year (average)" ],
|
||||
[ 'yearmax', 'year', 'MAX', "Year (max)" ]
|
||||
]
|
||||
},
|
||||
// save current selection in the state Provider so RRDView can read it
|
||||
getState: function() {
|
||||
var ind = this.getStore().findExact('id', this.getValue());
|
||||
var rec = this.getStore().getAt(ind);
|
||||
if (!rec) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
id: rec.data.id,
|
||||
timeframe: rec.data.timeframe,
|
||||
cf: rec.data.cf
|
||||
};
|
||||
},
|
||||
// set selection based on last saved state
|
||||
applyState : function(state) {
|
||||
if (state && state.id) {
|
||||
this.setValue(state.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -74,7 +74,7 @@ Ext.define('PVE.lxc.Summary', {
|
||||
});
|
||||
|
||||
Ext.apply(me, {
|
||||
tbar: [ '->' , { xtype: 'pveRRDTypeSelector' } ],
|
||||
tbar: [ '->' , { xtype: 'proxmoxRRDTypeSelector' } ],
|
||||
plugins: {
|
||||
ptype: 'lazyitems',
|
||||
items: [
|
||||
|
@ -93,7 +93,7 @@ Ext.define('PVE.node.Summary', {
|
||||
});
|
||||
|
||||
Ext.apply(me, {
|
||||
tbar: [version_btn, '->', { xtype: 'pveRRDTypeSelector' } ],
|
||||
tbar: [version_btn, '->', { xtype: 'proxmoxRRDTypeSelector' } ],
|
||||
plugins: {
|
||||
ptype: 'lazyitems',
|
||||
items: [
|
||||
|
@ -81,7 +81,7 @@ Ext.define('PVE.qemu.Summary', {
|
||||
});
|
||||
|
||||
Ext.apply(me, {
|
||||
tbar: [ '->', { xtype: 'pveRRDTypeSelector' } ],
|
||||
tbar: [ '->', { xtype: 'proxmoxRRDTypeSelector' } ],
|
||||
plugins: {
|
||||
ptype: 'lazyitems',
|
||||
items: [
|
||||
|
@ -10,7 +10,7 @@ Ext.define('PVE.storage.Summary', {
|
||||
tbar: [
|
||||
'->',
|
||||
{
|
||||
xtype: 'pveRRDTypeSelector'
|
||||
xtype: 'proxmoxRRDTypeSelector'
|
||||
}
|
||||
],
|
||||
initComponent: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user