mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 08:26:08 +00:00
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
896c0d5019
commit
ce7eeea1bf
@ -22,7 +22,6 @@ JSSRC= \
|
|||||||
data/ResourceStore.js \
|
data/ResourceStore.js \
|
||||||
data/model/RRDModels.js \
|
data/model/RRDModels.js \
|
||||||
form/VLanField.js \
|
form/VLanField.js \
|
||||||
form/RRDTypeSelector.js \
|
|
||||||
form/KVComboBox.js \
|
form/KVComboBox.js \
|
||||||
form/Boolean.js \
|
form/Boolean.js \
|
||||||
form/CompressionSelector.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, {
|
Ext.apply(me, {
|
||||||
tbar: [ '->' , { xtype: 'pveRRDTypeSelector' } ],
|
tbar: [ '->' , { xtype: 'proxmoxRRDTypeSelector' } ],
|
||||||
plugins: {
|
plugins: {
|
||||||
ptype: 'lazyitems',
|
ptype: 'lazyitems',
|
||||||
items: [
|
items: [
|
||||||
|
@ -93,7 +93,7 @@ Ext.define('PVE.node.Summary', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.apply(me, {
|
Ext.apply(me, {
|
||||||
tbar: [version_btn, '->', { xtype: 'pveRRDTypeSelector' } ],
|
tbar: [version_btn, '->', { xtype: 'proxmoxRRDTypeSelector' } ],
|
||||||
plugins: {
|
plugins: {
|
||||||
ptype: 'lazyitems',
|
ptype: 'lazyitems',
|
||||||
items: [
|
items: [
|
||||||
|
@ -81,7 +81,7 @@ Ext.define('PVE.qemu.Summary', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.apply(me, {
|
Ext.apply(me, {
|
||||||
tbar: [ '->', { xtype: 'pveRRDTypeSelector' } ],
|
tbar: [ '->', { xtype: 'proxmoxRRDTypeSelector' } ],
|
||||||
plugins: {
|
plugins: {
|
||||||
ptype: 'lazyitems',
|
ptype: 'lazyitems',
|
||||||
items: [
|
items: [
|
||||||
|
@ -10,7 +10,7 @@ Ext.define('PVE.storage.Summary', {
|
|||||||
tbar: [
|
tbar: [
|
||||||
'->',
|
'->',
|
||||||
{
|
{
|
||||||
xtype: 'pveRRDTypeSelector'
|
xtype: 'proxmoxRRDTypeSelector'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user