if (Proxmox.UserName === 'root@pam') {
container.el.mask();
if (!container.down('pveCephInstallWindow')){
+ var isInstalled = msg.match(/not initialized/i) ? true : false;
var win = Ext.create('PVE.ceph.Install', {
nodename: nodename
});
+ win.getViewModel().set('isInstalled', isInstalled);
container.add(win);
win.show();
callback(win);
viewModel: {
data: {
nodename: '',
- configuration: true
+ configuration: true,
+ isInstalled: false
}
},
cbindData: {
nodename: undefined
},
- title: gettext('Installation'),
+ title: gettext('Setup'),
navigateNext: function() {
var tp = this.down('#wizcontent');
var atab = tp.getActiveTab();
cbind:{
nodename: '{nodename}'
},
+ viewModel: {}, // needed to inherit parent viewModel data
listeners: {
afterrender: function() {
var me = this;
- me.down('pveNoVncConsole').fireEvent('activate');
+ if (this.getViewModel().get('isInstalled')) {
+ this.mask("Ceph is already installed, click next to create your configuration.",['pve-static-mask']);
+ } else {
+ me.down('pveNoVncConsole').fireEvent('activate');
+ }
},
activate: function() {
var me = this;
type: 'vbox'
},
viewModel: {
- parent: null,
data: {
- cephVersion: 'luminous'
+ cephVersion: 'luminous',
+ isInstalled: false
},
formulas: {
buttonText: function (get){
- return gettext('Install Ceph-') + get('cephVersion');
+ if (get('isInstalled')) {
+ return gettext('Configure Ceph');
+ } else {
+ return gettext('Install Ceph-') + get('cephVersion');
+ }
+ },
+ windowText: function (get) {
+ if (get('isInstalled')) {
+ return '<p class="install-mask">' +
+ Ext.String.format(gettext('{0} is not initialized.'), 'Ceph') + ' '+
+ gettext('You need to create a initial config once.') + '</p>';
+ } else {
+ return '<p class="install-mask">' +
+ Ext.String.format(gettext('{0} is not installed on this node.'), 'Ceph') + '<br>' +
+ gettext('Would you like to install it now?') + '</p>';
+ }
}
}
},
items: [
{
- html: '<p class="install-mask">' + Ext.String.format(gettext('{0} is not installed on this node.'), 'Ceph') + '<br>' +
- gettext('Would you like to install it now?') + '</p>',
+ bind: {
+ html: '{windowText}'
+ },
border: false,
padding: 5,
bodyCls: 'install-mask'
bind: {
text: '{buttonText}'
},
+ viewModel: {},
cbind: {
nodename: '{nodename}'
},
var win = Ext.create('PVE.ceph.CephInstallWizard',{
nodename: me.nodename
});
+ win.getViewModel().set('isInstalled', this.getViewModel().get('isInstalled'));
win.show();
me.mon(win,'beforeClose', function(){
me.fireEvent("cephInstallWindowClosed");