]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/ceph/CephInstallWizard.js
1 Ext
. define ( 'PVE.ceph.CephInstallWizard' , {
2 extend
: 'PVE.window.Wizard' ,
3 alias
: 'widget.pveCephInstallWizard' ,
4 mixins
: [ 'Proxmox.Mixin.CBind' ],
15 title
: gettext ( 'Installation' ),
18 title
: gettext ( 'Info' ),
22 onlineHelp
: 'chapter_pveceph' ,
23 html
: '<h3>Ceph?</h3>' +
24 '<blockquote cite="https://ceph.com/"><p>"<b>Ceph</b> is a unified, distributed storage system designed for excellent performance, reliability and scalability."</p></blockquote>' +
25 '<p><b>Ceph</b> is currently <b>not installed</b> on this node, click on the next button below to start the installation.' +
26 ' This wizard will guide you through the necessary steps, after the initial installation you will be offered to create a initial configuration.' +
27 ' The configuration step is only needed once per cluster and will be skipped if a config is already present.</p>' +
28 '<p>Please take a look at our documentation, by clicking the help button below, before starting the installation, if you want to gain deeper knowledge about Ceph visit <a href="http://docs.ceph.com/docs/master/">ceph.com</a>.</p>' ,
30 activate : function () {
31 // notify owning container that it should display a help button
32 if ( this . onlineHelp
) {
33 Ext
. GlobalEvents
. fireEvent ( 'proxmoxShowHelp' , this . onlineHelp
);
35 this . up ( 'pveCephInstallWizard' ). down ( '#back' ). hide ( true );
36 this . up ( 'pveCephInstallWizard' ). down ( '#next' ). setText ( gettext ( 'Start installation' ));
38 deactivate : function () {
39 if ( this . onlineHelp
) {
40 Ext
. GlobalEvents
. fireEvent ( 'proxmoxHideHelp' , this . onlineHelp
);
42 this . up ( 'pveCephInstallWizard' ). down ( '#next' ). setText ( gettext ( 'Next' ));
47 title
: gettext ( 'Installation' ),
51 nodename
: '{nodename}'
54 afterrender : function () {
56 me
. down ( 'pveNoVncConsole' ). fireEvent ( 'activate' );
58 activate : function () {
60 var nodename
= me
. nodename
;
61 me
. updateStore
= Ext
. create ( 'Proxmox.data.UpdateStore' , {
62 storeid
: 'ceph-status-' + nodename
,
66 url
: '/api2/json/nodes/' + nodename
+ '/ceph/status'
69 load : function ( rec
, response
, success
, operation
) {
70 var wizard
= me
. up ( '#wizcontent' );
71 var tabs
= wizard
. items
;
72 var lastTab
= tabs
. items
[ tabs
. length
- 1 ];
74 me
. updateStore
. stopUpdate ();
76 wizard
. setActiveTab ( lastTab
);
77 } else if ( operation
. error
. statusText
. match ( "not initialized" , "i" )) {
78 me
. updateStore
. stopUpdate ();
79 me
. down ( 'textfield' ). setValue ( 'success' );
80 } else if ( operation
. error
. statusText
. match ( "rados_connect failed" , "i" )) {
81 me
. updateStore
. stopUpdate ();
83 wizard
. setActiveTab ( lastTab
);
84 } else if (! operation
. error
. statusText
. match ( "not installed" , "i" )) {
85 Proxmox
. Utils
. setErrorMask ( me
, operation
. error
. statusText
);
90 me
. updateStore
. startUpdate ();
95 me
. updateStore
. stopUpdate ();
104 xtype
: 'pveNoVncConsole' ,
106 nodename
: '{nodename}'
112 name
: 'installSuccess' ,
122 title
: gettext ( 'Configuration' ),
123 onlineHelp
: 'chapter_pveceph' ,
125 nodename
: '{nodename}'
130 minreplicas
: undefined
134 activate : function () {
135 this . up ( 'pveCephInstallWizard' ). down ( '#submit' ). setText ( gettext ( 'Next' ));
137 deactivate : function () {
138 this . up ( 'pveCephInstallWizard' ). down ( '#submit' ). setText ( gettext ( 'Finish' ));
143 xtype
: 'displayfield' ,
145 fieldLabel
: gettext ( 'Node' ),
154 vtype
: 'IPCIDRAddress' ,
156 fieldLabel
: 'Public Network IP/CIDR' ,
161 name
: 'cluster-network' ,
162 vtype
: 'IPCIDRAddress' ,
163 fieldLabel
: 'Cluster Network IP/CIDR' ,
165 emptyText
: gettext ( 'Same as Public Network' )
170 xtype
: 'numberfield' ,
172 fieldLabel
: 'Number of replicas' ,
181 xtype
: 'numberfield' ,
183 fieldLabel
: 'Minimum replicas' ,
185 maxValue
: '{replicas}' ,
186 value
: '{minreplicas}'
190 setMaxValue : function ( value
) {
191 this . maxValue
= Ext
. Number
. from ( value
, 2 );
192 // allow enough to avoid split brains with max 'size', but more makes simply no sense
193 if ( this . maxValue
> 4 ) {
196 this . toggleSpinners ();
202 xtype
: 'numberfield' ,
204 fieldLabel
: 'Placement group bits' ,
212 onGetValues : function ( values
) {
213 [ 'cluster-network' , 'size' , 'min_size' , 'pg_bits' ]. forEach ( function ( field
) {
214 if (! values
[ field
]) {
215 delete values
[ field
];
220 onSubmit : function () {
222 var wizard
= me
. up ( 'window' );
223 var kv
= wizard
. getValues ();
225 var nodename
= me
. nodename
;
227 Proxmox
. Utils
. API2Request ({
228 url
: '/nodes/' + nodename
+ '/ceph/init' ,
229 waitMsgTarget
: wizard
,
232 success : function () {
233 var tp
= me
. up ( '#wizcontent' );
234 var atab
= tp
. getActiveTab ();
236 var next
= tp
. items
. indexOf ( atab
) + 1 ;
237 var ntab
= tp
. items
. getAt ( next
);
240 tp
. setActiveTab ( ntab
);
243 failure : function ( response
, opts
) {
244 Ext
. Msg
. alert ( gettext ( 'Error' ), response
. htmlStatus
);
250 title
: gettext ( 'Success' ),
254 onlineHelp
: 'pve_ceph_install' ,
255 html
: '<h3>Installation successful!</h3>' +
256 '<p>The basic installation and configuration is completed, depending on your setup some of the following steps are required to start using Ceph:</p>' +
257 '<ol><li>Create additional Ceph Monitors</li><li>Create Ceph OSDs</li><li>Create Ceph Pools</li></ol>' +
258 '<p>To learn more click on the help button below.</p>' ,
260 activate : function () {
261 // notify owning container that it should display a help button
262 if ( this . onlineHelp
) {
263 Ext
. GlobalEvents
. fireEvent ( 'proxmoxShowHelp' , this . onlineHelp
);
266 var tp
= this . up ( '#wizcontent' );
267 var idx
= tp
. items
. indexOf ( this )- 1 ;
268 for (; idx
>= 0 ; idx
--) {
269 var nc
= tp
. items
. getAt ( idx
);
275 deactivate : function () {
276 if ( this . onlineHelp
) {
277 Ext
. GlobalEvents
. fireEvent ( 'proxmoxHideHelp' , this . onlineHelp
);
281 onSubmit : function () {
282 var wizard
= this . up ( 'pveCephInstallWizard' );