mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 12:14:27 +00:00
add new "RBD (PVE)" storage choice
this is for adding a pve managed ceph rbd storage, so that the user just has to select the pool, and does not need to write the monitor hosts and copy the keyring the old "RBD" is renamed to "RBD (external)" Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
d6f5549e58
commit
3c23c0258b
@ -775,7 +775,10 @@ Ext.define('PVE.Utils', { utilities: {
|
|||||||
return Ext.Date.format(date, "Y-m-d");
|
return Ext.Date.format(date, "Y-m-d");
|
||||||
},
|
},
|
||||||
|
|
||||||
format_storage_type: function(value) {
|
format_storage_type: function(value, md, record) {
|
||||||
|
if (value === 'rbd' && record && !record.get('monhost')) {
|
||||||
|
value = 'pveceph';
|
||||||
|
}
|
||||||
if (value === 'dir') {
|
if (value === 'dir') {
|
||||||
return PVE.Utils.directoryText;
|
return PVE.Utils.directoryText;
|
||||||
} else if (value === 'nfs') {
|
} else if (value === 'nfs') {
|
||||||
@ -789,7 +792,9 @@ Ext.define('PVE.Utils', { utilities: {
|
|||||||
} else if (value === 'iscsi') {
|
} else if (value === 'iscsi') {
|
||||||
return 'iSCSI';
|
return 'iSCSI';
|
||||||
} else if (value === 'rbd') {
|
} else if (value === 'rbd') {
|
||||||
return 'RBD';
|
return 'RBD (external)';
|
||||||
|
} else if (value === 'pveceph') {
|
||||||
|
return 'RBD (PVE)';
|
||||||
} else if (value === 'sheepdog') {
|
} else if (value === 'sheepdog') {
|
||||||
return 'Sheepdog';
|
return 'Sheepdog';
|
||||||
} else if (value === 'zfs') {
|
} else if (value === 'zfs') {
|
||||||
|
@ -62,7 +62,8 @@ Ext.define('PVE.dc.StorageView', {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var win = Ext.create(editor, {
|
var win = Ext.create(editor, {
|
||||||
storageId: rec.data.storage
|
storageId: rec.data.storage,
|
||||||
|
pveceph: !rec.data.monhost
|
||||||
});
|
});
|
||||||
|
|
||||||
win.show();
|
win.show();
|
||||||
@ -165,6 +166,17 @@ Ext.define('PVE.dc.StorageView', {
|
|||||||
win.show();
|
win.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: PVE.Utils.format_storage_type('pveceph'),
|
||||||
|
iconCls: 'fa fa-fw fa-building',
|
||||||
|
handler: function() {
|
||||||
|
var win = Ext.create('PVE.storage.RBDEdit', {
|
||||||
|
pveceph: 1
|
||||||
|
});
|
||||||
|
win.on('destroy', reload);
|
||||||
|
win.show();
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: PVE.Utils.format_storage_type('rbd'),
|
text: PVE.Utils.format_storage_type('rbd'),
|
||||||
iconCls: 'fa fa-fw fa-building',
|
iconCls: 'fa fa-fw fa-building',
|
||||||
|
@ -19,6 +19,9 @@ Ext.define('PVE.storage.RBDInputPanel', {
|
|||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
if (!me.nodename) {
|
||||||
|
me.nodename = 'localhost';
|
||||||
|
}
|
||||||
|
|
||||||
me.column1 = [
|
me.column1 = [
|
||||||
{
|
{
|
||||||
@ -28,7 +31,21 @@ Ext.define('PVE.storage.RBDInputPanel', {
|
|||||||
fieldLabel: 'ID',
|
fieldLabel: 'ID',
|
||||||
vtype: 'StorageId',
|
vtype: 'StorageId',
|
||||||
allowBlank: false
|
allowBlank: false
|
||||||
},
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
if (me.pveceph) {
|
||||||
|
me.column1.push(
|
||||||
|
{
|
||||||
|
xtype: me.isCreate ? 'pveCephPoolSelector' : 'displayfield',
|
||||||
|
nodename: me.nodename,
|
||||||
|
name: 'pool',
|
||||||
|
fieldLabel: gettext('Pool'),
|
||||||
|
allowBlank: false
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
me.column1.push(
|
||||||
{
|
{
|
||||||
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
xtype: me.isCreate ? 'textfield' : 'displayfield',
|
||||||
name: 'pool',
|
name: 'pool',
|
||||||
@ -51,7 +68,8 @@ Ext.define('PVE.storage.RBDInputPanel', {
|
|||||||
fieldLabel: gettext('User name'),
|
fieldLabel: gettext('User name'),
|
||||||
allowBlank: true
|
allowBlank: true
|
||||||
}
|
}
|
||||||
];
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// here value is an array,
|
// here value is an array,
|
||||||
// while before it was a string
|
// while before it was a string
|
||||||
@ -116,11 +134,13 @@ Ext.define('PVE.storage.RBDEdit', {
|
|||||||
|
|
||||||
var ipanel = Ext.create('PVE.storage.RBDInputPanel', {
|
var ipanel = Ext.create('PVE.storage.RBDInputPanel', {
|
||||||
isCreate: me.isCreate,
|
isCreate: me.isCreate,
|
||||||
storageId: me.storageId
|
storageId: me.storageId,
|
||||||
|
nodename: me.nodename,
|
||||||
|
pveceph: me.pveceph
|
||||||
});
|
});
|
||||||
|
|
||||||
Ext.apply(me, {
|
Ext.apply(me, {
|
||||||
subject: PVE.Utils.format_storage_type('rbd'),
|
subject: PVE.Utils.format_storage_type(me.pveceph?'pveceph':'rbd'),
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
items: [ ipanel ]
|
items: [ ipanel ]
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user