]>
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 );
37 deactivate : function () {
38 if ( this . onlineHelp
) {
39 Ext
. GlobalEvents
. fireEvent ( 'proxmoxHideHelp' , this . onlineHelp
);
45 title
: gettext ( 'Installation' ),
49 nodename
: '{nodename}'
52 afterrender : function () {
54 me
. down ( 'pveNoVncConsole' ). fireEvent ( 'activate' );
56 activate : function () {
58 var nodename
= me
. nodename
;
59 me
. updateStore
= Ext
. create ( 'Proxmox.data.UpdateStore' , {
60 storeid
: 'ceph-status-' + nodename
,
64 url
: '/api2/json/nodes/' + nodename
+ '/ceph/status'
67 load : function ( rec
, response
, success
, operation
) {
68 var wizard
= me
. up ( '#wizcontent' );
69 var tabs
= wizard
. items
;
70 var lastTab
= tabs
. items
[ tabs
. length
- 1 ];
72 me
. updateStore
. stopUpdate ();
74 wizard
. setActiveTab ( lastTab
);
75 } else if ( operation
. error
. statusText
. match ( "not initialized" , "i" )) {
76 me
. updateStore
. stopUpdate ();
77 me
. down ( 'textfield' ). setValue ( 'success' );
78 } else if ( operation
. error
. statusText
. match ( "rados_connect failed" , "i" )) {
79 me
. updateStore
. stopUpdate ();
81 wizard
. setActiveTab ( lastTab
);
82 } else if (! operation
. error
. statusText
. match ( "not installed" , "i" )) {
83 Proxmox
. Utils
. setErrorMask ( me
, operation
. error
. statusText
);
88 me
. updateStore
. startUpdate ();
93 me
. updateStore
. stopUpdate ();
102 xtype
: 'pveNoVncConsole' ,
104 nodename
: '{nodename}'
110 name
: 'installSuccess' ,
120 title
: gettext ( 'Configuration' ),
121 onlineHelp
: 'chapter_pveceph' ,
123 nodename
: '{nodename}'
126 activate : function () {
127 this . up ( 'pveCephInstallWizard' ). down ( '#submit' ). setText ( gettext ( 'Next' ));
129 deactivate : function () {
130 this . up ( 'pveCephInstallWizard' ). down ( '#submit' ). setText ( gettext ( 'Finish' ));
135 xtype
: 'displayfield' ,
137 fieldLabel
: gettext ( 'Node' ),
146 vtype
: 'IPCIDRAddress' ,
148 fieldLabel
: 'Network IPv4/CIDR' ,
153 name
: 'cluster-network' ,
154 vtype
: 'IPCIDRAddress' ,
155 fieldLabel
: 'Cluster-Network IPv4/CIDR' ,
157 emptyText
: gettext ( 'default' )
162 xtype
: 'numberfield' ,
164 fieldLabel
: gettext ( 'Number of replicas' ),
169 emptyText
: gettext ( 'default' )
172 xtype
: 'numberfield' ,
174 fieldLabel
: gettext ( 'Minimum replicas' ),
179 emptyText
: gettext ( 'default' )
182 xtype
: 'numberfield' ,
184 fieldLabel
: 'Placement group bits' ,
189 emptyText
: gettext ( 'default' )
192 onGetValues : function ( values
) {
193 [ 'cluster-network' , 'size' , 'min_size' , 'pg_bits' ]. forEach ( function ( field
) {
194 if (! values
[ field
]) {
195 delete values
[ field
];
200 onSubmit : function () {
202 var wizard
= me
. up ( 'window' );
203 var kv
= wizard
. getValues ();
205 var nodename
= me
. nodename
;
207 Proxmox
. Utils
. API2Request ({
208 url
: '/nodes/' + nodename
+ '/ceph/init' ,
209 waitMsgTarget
: wizard
,
212 success : function () {
213 var tp
= me
. up ( '#wizcontent' );
214 var atab
= tp
. getActiveTab ();
216 var next
= tp
. items
. indexOf ( atab
) + 1 ;
217 var ntab
= tp
. items
. getAt ( next
);
220 tp
. setActiveTab ( ntab
);
223 failure : function ( response
, opts
) {
224 Ext
. Msg
. alert ( gettext ( 'Error' ), response
. htmlStatus
);
230 title
: gettext ( 'Success' ),
234 onlineHelp
: 'pve_ceph_install' ,
235 html
: '<h3>Installation successful!</h3>' +
236 '<p>The basic installation and configuration is completed, depending on your setup some of the following steps are required to start using Ceph:</p>' +
237 '<ul><li>Creating Ceph Monitors</li><li>Creating Ceph OSDs</li><li>Creating Ceph Pools</li></ul>' +
238 '<p>To learn more click on the help button below.</p>' ,
240 activate : function () {
241 // notify owning container that it should display a help button
242 if ( this . onlineHelp
) {
243 Ext
. GlobalEvents
. fireEvent ( 'proxmoxShowHelp' , this . onlineHelp
);
246 var tp
= this . up ( '#wizcontent' );
247 var idx
= tp
. items
. indexOf ( this )- 1 ;
248 for (; idx
>= 0 ; idx
--) {
249 var nc
= tp
. items
. getAt ( idx
);
255 deactivate : function () {
256 if ( this . onlineHelp
) {
257 Ext
. GlobalEvents
. fireEvent ( 'proxmoxHideHelp' , this . onlineHelp
);
261 onSubmit : function () {
262 var wizard
= this . up ( 'pveCephInstallWizard' );