add CephPoolSelector
this allows us to give the user a list of pve managed ceph pools Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
52b3ac0385
commit
6e198c8f49
@ -72,6 +72,7 @@ JSSRC= \
|
||||
form/VMSelector.js \
|
||||
form/USBSelector.js \
|
||||
form/CalendarEvent.js \
|
||||
form/CephPoolSelector.js \
|
||||
dc/Tasks.js \
|
||||
dc/Log.js \
|
||||
panel/StatusPanel.js \
|
||||
|
42
www/manager6/form/CephPoolSelector.js
Normal file
42
www/manager6/form/CephPoolSelector.js
Normal file
@ -0,0 +1,42 @@
|
||||
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: 'pve',
|
||||
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]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user