},
showCephInstallOrMask: function(container, msg, nodename, callback) {
- var regex = new RegExp("not (installed|initialized)", "i");
- if (msg.match(regex)) {
+ if (msg.match(/not (installed|initialized)/i)) {
if (Proxmox.UserName === 'root@pam') {
container.el.mask();
if (!container.down('pveCephInstallWindow')) {
}
},
+ monitor_ceph_installed: function(view, rstore, nodename, maskOwnerCt) {
+ PVE.Utils.handleStoreErrorOrMask(
+ view,
+ rstore,
+ /not (installed|initialized)/i,
+ (_, error) => {
+ nodename = nodename || 'localhost';
+ let maskTarget = maskOwnerCt ? view.ownerCt : view;
+ rstore.stopUpdate();
+ PVE.Utils.showCephInstallOrMask(maskTarget, error.statusText, nodename, win => {
+ view.mon(win, 'cephInstallWindowClosed', () => rstore.startUpdate());
+ });
+ },
+ );
+ },
+
+
propertyStringSet: function(target, source, name, value) {
if (source) {
if (value === undefined) {
order: 'DESC',
},
}));
- var regex = new RegExp("not (installed|initialized)", "i");
- PVE.Utils.handleStoreErrorOrMask(view, view.rstore, regex, function(me, error) {
- me.rstore.stopUpdate();
- PVE.Utils.showCephInstallOrMask(me.ownerCt, error.statusText, view.nodename,
- function(win) {
- me.mon(win, 'cephInstallWindowClosed', function() {
- me.rstore.startUpdate();
- });
- },
- );
- });
+ // 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);
},
});
let store = Ext.create('Proxmox.data.DiffStore', { rstore: rstore });
- PVE.Utils.handleStoreErrorOrMask(
- me,
- rstore,
- /not (installed|initialized)/i,
- (_, error) => {
- rstore.stopUpdate();
- PVE.Utils.showCephInstallOrMask(me, error.statusText, nodename, win => {
- me.mon(win, 'cephInstallWindowClosed', () => rstore.startUpdate());
- });
- },
- );
+ // manages the "install ceph?" overlay
+ PVE.Utils.monitor_ceph_installed(me, rstore, nodename);
var run_editor = function() {
let rec = sm.getSelection()[0];
view.on('destroy', view.rstore.stopUpdate);
if (view.showCephInstallMask) {
- var regex = new RegExp("not (installed|initialized)", "i");
- PVE.Utils.handleStoreErrorOrMask(view, view.rstore, regex, function(me, error) {
- view.rstore.stopUpdate();
- PVE.Utils.showCephInstallOrMask(view.ownerCt, error.statusText, view.nodename,
- function(win) {
- me.mon(win, 'cephInstallWindowClosed', function() {
- view.rstore.startUpdate();
- });
- },
- );
- });
+ PVE.Utils.monitor_ceph_installed(view, view.rstore, view.nodename, true);
}
},
me.reads = me.down('#reads');
me.writes = me.down('#writes');
- var regex = new RegExp("not (installed|initialized)", "i");
- PVE.Utils.handleStoreErrorOrMask(me, me.store, regex, function(me, error) {
- me.store.stopUpdate();
- PVE.Utils.showCephInstallOrMask(me, error.statusText, nodename || 'localhost',
- function(win) {
- me.mon(win, 'cephInstallWindowClosed', function() {
- me.store.startUpdate();
- });
- },
- );
- });
+ // manages the "install ceph?" overlay
+ PVE.Utils.monitor_ceph_installed(me, me.store, nodename);
me.mon(me.store, 'load', me.updateAll, me);
me.mon(me.metadatastore, 'load', function(store, records, success) {