]>
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', | |
21 | type: 'vbox' | |
22 | }, | |
23 | viewModel: { | |
4616a55b | 24 | data: { |
c3d9c698 | 25 | cephVersion: 'nautilus', |
f992ef80 | 26 | isInstalled: false |
4616a55b TM |
27 | }, |
28 | formulas: { | |
29 | buttonText: function (get){ | |
f992ef80 TM |
30 | if (get('isInstalled')) { |
31 | return gettext('Configure Ceph'); | |
32 | } else { | |
33 | return gettext('Install Ceph-') + get('cephVersion'); | |
34 | } | |
35 | }, | |
36 | windowText: function (get) { | |
37 | if (get('isInstalled')) { | |
7412755d | 38 | return '<p class="install-mask">' + |
f992ef80 TM |
39 | Ext.String.format(gettext('{0} is not initialized.'), 'Ceph') + ' '+ |
40 | gettext('You need to create a initial config once.') + '</p>'; | |
41 | } else { | |
7412755d | 42 | return '<p class="install-mask">' + |
f992ef80 TM |
43 | Ext.String.format(gettext('{0} is not installed on this node.'), 'Ceph') + '<br>' + |
44 | gettext('Would you like to install it now?') + '</p>'; | |
45 | } | |
4616a55b TM |
46 | } |
47 | } | |
48 | }, | |
49 | items: [ | |
50 | { | |
f992ef80 TM |
51 | bind: { |
52 | html: '{windowText}' | |
53 | }, | |
4616a55b TM |
54 | border: false, |
55 | padding: 5, | |
56 | bodyCls: 'install-mask' | |
57 | ||
58 | }, | |
59 | { | |
60 | xtype: 'button', | |
61 | bind: { | |
62 | text: '{buttonText}' | |
63 | }, | |
f992ef80 | 64 | viewModel: {}, |
4616a55b TM |
65 | cbind: { |
66 | nodename: '{nodename}' | |
67 | }, | |
68 | handler: function() { | |
69 | var me = this.up('pveCephInstallWindow'); | |
70 | var win = Ext.create('PVE.ceph.CephInstallWizard',{ | |
71 | nodename: me.nodename | |
72 | }); | |
f992ef80 | 73 | win.getViewModel().set('isInstalled', this.getViewModel().get('isInstalled')); |
4616a55b TM |
74 | win.show(); |
75 | me.mon(win,'beforeClose', function(){ | |
76 | me.fireEvent("cephInstallWindowClosed"); | |
77 | me.close(); | |
78 | }); | |
79 | ||
80 | } | |
81 | } | |
82 | ] | |
83 | }); |