]>
Commit | Line | Data |
---|---|---|
4616a55b TM |
1 | Ext.define('PVE.ceph.Install', { |
2 | extend: 'Ext.window.Window', | |
3 | xtype: 'pveCephInstallWindow', | |
4 | mixins: ['Proxmox.Mixin.CBind'], | |
5 | ||
6 | width: 220, | |
7 | header: false, | |
8 | resizable: false, | |
9 | draggable: false, | |
10 | modal: true, | |
11 | nodename: undefined, | |
12 | shadow: false, | |
13 | border: false, | |
14 | bodyBorder: false, | |
15 | closable: false, | |
16 | cls: 'install-mask', | |
17 | bodyCls: 'install-mask', | |
18 | layout: { | |
19 | align: 'stretch', | |
20 | pack: 'center', | |
f6710aac | 21 | type: 'vbox', |
4616a55b TM |
22 | }, |
23 | viewModel: { | |
4616a55b | 24 | data: { |
f6710aac | 25 | isInstalled: false, |
4616a55b TM |
26 | }, |
27 | formulas: { | |
8058410f | 28 | buttonText: function(get) { |
f992ef80 TM |
29 | if (get('isInstalled')) { |
30 | return gettext('Configure Ceph'); | |
31 | } else { | |
77d7cf37 | 32 | return gettext('Install Ceph'); |
f992ef80 TM |
33 | } |
34 | }, | |
8058410f | 35 | windowText: function(get) { |
f992ef80 | 36 | if (get('isInstalled')) { |
219293bd AL |
37 | return `<p class="install-mask"> |
38 | ${Ext.String.format(gettext('{0} is not initialized.'), 'Ceph')} | |
39 | ${gettext('You need to create an initial config once.')}</p>`; | |
f992ef80 | 40 | } else { |
7412755d | 41 | return '<p class="install-mask">' + |
f992ef80 TM |
42 | Ext.String.format(gettext('{0} is not installed on this node.'), 'Ceph') + '<br>' + |
43 | gettext('Would you like to install it now?') + '</p>'; | |
44 | } | |
f6710aac TL |
45 | }, |
46 | }, | |
4616a55b TM |
47 | }, |
48 | items: [ | |
49 | { | |
f992ef80 | 50 | bind: { |
f6710aac | 51 | html: '{windowText}', |
f992ef80 | 52 | }, |
4616a55b TM |
53 | border: false, |
54 | padding: 5, | |
f6710aac | 55 | bodyCls: 'install-mask', |
4616a55b TM |
56 | |
57 | }, | |
58 | { | |
59 | xtype: 'button', | |
60 | bind: { | |
f6710aac | 61 | text: '{buttonText}', |
4616a55b | 62 | }, |
f992ef80 | 63 | viewModel: {}, |
4616a55b | 64 | cbind: { |
f6710aac | 65 | nodename: '{nodename}', |
4616a55b TM |
66 | }, |
67 | handler: function() { | |
3405edbe TL |
68 | let view = this.up('pveCephInstallWindow'); |
69 | let wizzard = Ext.create('PVE.ceph.CephInstallWizard', { | |
70 | nodename: view.nodename, | |
4616a55b | 71 | }); |
3405edbe TL |
72 | wizzard.getViewModel().set('isInstalled', this.getViewModel().get('isInstalled')); |
73 | wizzard.show(); | |
74 | view.mon(wizzard, 'beforeClose', function() { | |
75 | view.fireEvent("cephInstallWindowClosed"); | |
76 | view.close(); | |
4616a55b | 77 | }); |
f6710aac TL |
78 | }, |
79 | }, | |
80 | ], | |
4616a55b | 81 | }); |