mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 02:09:29 +00:00
ui: cephfs: only allow CephFS creation if MDS is configured
Introduce the mdsCount again, I know remember again why I had it in v3 of my CephFS series.. Use this to disable the CephFS create button if we have no MDS configured, as this is a requirement. Further change the gettext for 'No XY configure' to a format string so that it can be reused. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> Tested-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
e337caaf46
commit
a9d47b2bb3
@ -114,7 +114,7 @@ Ext.define('PVE.NodeCephFSPanel', {
|
|||||||
xtype: 'pveNodeCephFSPanel',
|
xtype: 'pveNodeCephFSPanel',
|
||||||
mixins: ['Proxmox.Mixin.CBind'],
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
title: gettext('Cluster Administration'),
|
title: gettext('CephFS'),
|
||||||
onlineHelp: 'chapter_pvecm',
|
onlineHelp: 'chapter_pvecm',
|
||||||
|
|
||||||
border: false,
|
border: false,
|
||||||
@ -125,17 +125,23 @@ Ext.define('PVE.NodeCephFSPanel', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
xtype: 'grid',
|
|
||||||
title: gettext('CephFS'),
|
|
||||||
viewModel: {
|
viewModel: {
|
||||||
parent: null,
|
parent: null,
|
||||||
data: {
|
data: {
|
||||||
cephfsConfigured: false
|
cephfsConfigured: false,
|
||||||
|
mdsCount: 0
|
||||||
|
},
|
||||||
|
formulas: {
|
||||||
|
canCreateFS: function(get) {
|
||||||
|
return (!get('cephfsConfigured') && get('mdsCount') > 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emptyText: gettext('No CephFS configured.'),
|
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
xtype: 'grid',
|
||||||
|
emptyText: Ext.String.format(gettext('No {0} configured.'), 'CephFS'),
|
||||||
controller: {
|
controller: {
|
||||||
xclass: 'Ext.app.ViewController',
|
xclass: 'Ext.app.ViewController',
|
||||||
|
|
||||||
@ -190,7 +196,7 @@ Ext.define('PVE.NodeCephFSPanel', {
|
|||||||
handler: 'onCreate',
|
handler: 'onCreate',
|
||||||
bind: {
|
bind: {
|
||||||
// only one CephFS per Ceph cluster makes sense for now
|
// only one CephFS per Ceph cluster makes sense for now
|
||||||
disabled: '{cephfsConfigured}'
|
disabled: '{!canCreateFS}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -218,6 +224,7 @@ Ext.define('PVE.NodeCephFSPanel', {
|
|||||||
{
|
{
|
||||||
xtype: 'grid',
|
xtype: 'grid',
|
||||||
title: gettext('Metadata Servers'),
|
title: gettext('Metadata Servers'),
|
||||||
|
emptyText: Ext.String.format(gettext('No {0} configured.'), 'MDS'),
|
||||||
controller: {
|
controller: {
|
||||||
xclass: 'Ext.app.ViewController',
|
xclass: 'Ext.app.ViewController',
|
||||||
|
|
||||||
@ -238,9 +245,17 @@ Ext.define('PVE.NodeCephFSPanel', {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
Proxmox.Utils.monStoreErrors(view, view.rstore);
|
Proxmox.Utils.monStoreErrors(view, view.rstore);
|
||||||
|
view.rstore.on('load', this.onLoad, this);
|
||||||
view.on('destroy', view.rstore.stopUpdate);
|
view.on('destroy', view.rstore.stopUpdate);
|
||||||
},
|
},
|
||||||
|
onLoad: function(store, records, success) {
|
||||||
|
var vm = this.getViewModel();
|
||||||
|
if (!success || !records) {
|
||||||
|
vm.set('mdsCount', 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vm.set('mdsCount', records.length);
|
||||||
|
},
|
||||||
onCreateMDS: function() {
|
onCreateMDS: function() {
|
||||||
var view = this.getView();
|
var view = this.getView();
|
||||||
view.rstore.stopUpdate();
|
view.rstore.stopUpdate();
|
||||||
|
Loading…
Reference in New Issue
Block a user