]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/window/CephInstall.js
fixup trailing whitespaces
[pve-manager.git] / www / manager6 / window / CephInstall.js
1 /*jslint confusion: true*/
2 Ext.define('PVE.ceph.Install', {
3 extend: 'Ext.window.Window',
4 xtype: 'pveCephInstallWindow',
5 mixins: ['Proxmox.Mixin.CBind'],
6
7 width: 220,
8 header: false,
9 resizable: false,
10 draggable: false,
11 modal: true,
12 nodename: undefined,
13 shadow: false,
14 border: false,
15 bodyBorder: false,
16 closable: false,
17 cls: 'install-mask',
18 bodyCls: 'install-mask',
19 layout: {
20 align: 'stretch',
21 pack: 'center',
22 type: 'vbox'
23 },
24 viewModel: {
25 data: {
26 cephVersion: 'luminous',
27 isInstalled: false
28 },
29 formulas: {
30 buttonText: function (get){
31 if (get('isInstalled')) {
32 return gettext('Configure Ceph');
33 } else {
34 return gettext('Install Ceph-') + get('cephVersion');
35 }
36 },
37 windowText: function (get) {
38 if (get('isInstalled')) {
39 return '<p class="install-mask">' +
40 Ext.String.format(gettext('{0} is not initialized.'), 'Ceph') + ' '+
41 gettext('You need to create a initial config once.') + '</p>';
42 } else {
43 return '<p class="install-mask">' +
44 Ext.String.format(gettext('{0} is not installed on this node.'), 'Ceph') + '<br>' +
45 gettext('Would you like to install it now?') + '</p>';
46 }
47 }
48 }
49 },
50 items: [
51 {
52 bind: {
53 html: '{windowText}'
54 },
55 border: false,
56 padding: 5,
57 bodyCls: 'install-mask'
58
59 },
60 {
61 xtype: 'button',
62 bind: {
63 text: '{buttonText}'
64 },
65 viewModel: {},
66 cbind: {
67 nodename: '{nodename}'
68 },
69 handler: function() {
70 var me = this.up('pveCephInstallWindow');
71 var win = Ext.create('PVE.ceph.CephInstallWizard',{
72 nodename: me.nodename
73 });
74 win.getViewModel().set('isInstalled', this.getViewModel().get('isInstalled'));
75 win.show();
76 me.mon(win,'beforeClose', function(){
77 me.fireEvent("cephInstallWindowClosed");
78 me.close();
79 });
80
81 }
82 }
83 ]
84 });