]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: ceph: differentiate between install & configure only
authorTim Marx <t.marx@proxmox.com>
Fri, 29 Mar 2019 11:42:43 +0000 (12:42 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 29 Mar 2019 12:07:36 +0000 (13:07 +0100)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
www/manager6/Utils.js
www/manager6/ceph/CephInstallWizard.js
www/manager6/window/CephInstall.js

index d8e6f275fd53aa260e00d23253df0918a0137694..ffa6970a8002d61cf1ee459ea8262d80b2be5e7e 100644 (file)
@@ -1138,9 +1138,11 @@ Ext.define('PVE.Utils', { utilities: {
            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);
index 968b1294b528d358288e9bce1ddc0ae2239cd7a3..a9ab0c246500b26b8ccf767983723de1b1412693 100644 (file)
@@ -8,13 +8,14 @@ Ext.define('PVE.ceph.CephInstallWizard', {
        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();
@@ -63,10 +64,15 @@ Ext.define('PVE.ceph.CephInstallWizard', {
                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;
index cd38dd0b92269fcb76d05b24885452f8a2b93e39..bb5046a697653bc7a616bb23bc20b5755fa90780 100644 (file)
@@ -22,20 +22,36 @@ Ext.define('PVE.ceph.Install', {
        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'
@@ -46,6 +62,7 @@ Ext.define('PVE.ceph.Install', {
            bind: {
                text: '{buttonText}'
            },
+           viewModel: {},
            cbind: {
                nodename: '{nodename}'
            },
@@ -54,6 +71,7 @@ Ext.define('PVE.ceph.Install', {
                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");