]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/window/CephInstall.js
ui: schedule sim: denote if any simulation was done via empty text
[pve-manager.git] / www / manager6 / window / CephInstall.js
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: {
24 data: {
25 isInstalled: false,
26 },
27 formulas: {
28 buttonText: function(get) {
29 if (get('isInstalled')) {
30 return gettext('Configure Ceph');
31 } else {
32 return gettext('Install Ceph');
33 }
34 },
35 windowText: function(get) {
36 if (get('isInstalled')) {
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>`;
40 } else {
41 return '<p class="install-mask">' +
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 }
45 },
46 },
47 },
48 items: [
49 {
50 bind: {
51 html: '{windowText}',
52 },
53 border: false,
54 padding: 5,
55 bodyCls: 'install-mask',
56
57 },
58 {
59 xtype: 'button',
60 bind: {
61 text: '{buttonText}',
62 },
63 viewModel: {},
64 cbind: {
65 nodename: '{nodename}',
66 },
67 handler: function() {
68 let view = this.up('pveCephInstallWindow');
69 let wizzard = Ext.create('PVE.ceph.CephInstallWizard', {
70 nodename: view.nodename,
71 });
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();
77 });
78 },
79 },
80 ],
81 });