6529dbca44
Split PVE specific models, which where not moved to the general widget toolkit, in a separate folder: data/models/ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
43 lines
761 B
JavaScript
43 lines
761 B
JavaScript
Ext.define('PVE.form.CephPoolSelector', {
|
|
extend: 'Ext.form.field.ComboBox',
|
|
alias: 'widget.pveCephPoolSelector',
|
|
|
|
allowBlank: false,
|
|
valueField: 'pool_name',
|
|
displayField: 'pool_name',
|
|
editable: false,
|
|
queryMode: 'local',
|
|
|
|
initComponent: function() {
|
|
var me = this;
|
|
|
|
if (!me.nodename) {
|
|
throw "no nodename given";
|
|
}
|
|
|
|
var store = Ext.create('Ext.data.Store', {
|
|
fields: ['name'],
|
|
sorters: 'name',
|
|
proxy: {
|
|
type: 'proxmox',
|
|
url: '/api2/json/nodes/' + me.nodename + '/ceph/pools'
|
|
}
|
|
});
|
|
|
|
Ext.apply(me, {
|
|
store: store
|
|
});
|
|
|
|
me.callParent();
|
|
|
|
store.load({
|
|
callback: function(rec, op, success){
|
|
if (success && rec.length > 0) {
|
|
me.select(rec[0]);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|