viewModel: {
parent: null,
data: {
- cephfsConfigured: false,
mdsCount: 0,
},
formulas: {
canCreateFS: function(get) {
- return !get('cephfsConfigured') && get('mdsCount') > 0;
+ return get('mdsCount') > 0;
},
},
},
}));
// manages the "install ceph?" overlay
PVE.Utils.monitor_ceph_installed(view, view.rstore, view.nodename, true);
- view.rstore.on('load', this.onLoad, this);
view.on('destroy', () => view.rstore.stopUpdate());
},
},
});
},
-
- onLoad: function(store, records, success) {
- var vm = this.getViewModel();
- if (!(success && records && records.length > 0)) {
- vm.set('cephfsConfigured', false);
- return;
- }
- vm.set('cephfsConfigured', true);
- },
},
tbar: [
{
reference: 'createButton',
handler: 'onCreate',
bind: {
- // only one CephFS per Ceph cluster makes sense for now
disabled: '{!canCreateFS}',
},
},
vm.set('mdsCount', 0);
return;
}
- vm.set('mdsCount', records.length);
+ let count = 0;
+ for (const mds of records) {
+ if (mds.data.state === 'up:standby') {
+ count++;
+ }
+ }
+ vm.set('mdsCount', count);
},
cbind: {
nodename: '{nodename}',