@@ -12,7 +12,7 @@ import {MnWizardService} from './mn.wizard.service.js';
1212import { MnLifeCycleHooksToStream } from './mn.core.js' ;
1313import { MnPoolsService } from './mn.pools.service.js' ;
1414import { MnAdminService } from "./mn.admin.service.js" ;
15- import { first } from '/ui/web_modules/rxjs/operators.js' ;
15+ import { first , combineLatest } from '/ui/web_modules/rxjs/operators.js' ;
1616import { FormGroup , FormControl } from '/ui/web_modules/@angular/forms.js' ;
1717import { Component , ChangeDetectionStrategy } from '/ui/web_modules/@angular/core.js' ;
1818
@@ -68,7 +68,9 @@ class MnWizardComponent extends MnLifeCycleHooksToStream {
6868 newClusterConfig . get ( "services" ) . addControl ( "field" , servicesToGroup ( services , null ) ) ;
6969 } ) ;
7070
71- mnPoolsService . stream . isEnterprise . pipe ( first ( ) )
71+ let isEnterpriseStream = mnPoolsService . stream . isEnterprise . pipe ( first ( ) ) ;
72+
73+ isEnterpriseStream
7274 . subscribe ( function ( isEnterprise ) {
7375 var storageMode = isEnterprise ? "plasma" : "forestdb" ;
7476 newClusterConfig . get ( "storageMode" ) . setValue ( storageMode ) ;
@@ -81,12 +83,26 @@ class MnWizardComponent extends MnLifeCycleHooksToStream {
8183 mnWizardService . initialValues . storageMode = storageMode ;
8284 } ) ;
8385
84- mnWizardService . stream . initHddStorage . pipe ( first ( ) )
85- . subscribe ( function ( initHdd ) {
86- newClusterConfig . get ( "clusterStorage.storage" ) . patchValue ( initHdd ) ;
87- joinCluster . get ( "clusterStorage.storage" ) . patchValue ( initHdd ) ;
86+ mnWizardService . stream . initHddStorage
87+ . pipe ( first ( ) ,
88+ combineLatest ( isEnterpriseStream ) )
89+ . subscribe ( function ( [ initHdd , isEnterprise ] ) {
90+ setStorageConfigValues ( newClusterConfig , initHdd , isEnterprise ) ;
91+ setStorageConfigValues ( joinCluster , initHdd , isEnterprise ) ;
8892
8993 mnWizardService . initialValues . clusterStorage = initHdd ;
9094 } ) ;
95+
96+ function setStorageConfigValues ( config , initHdd , isEnterprise ) {
97+ if ( isEnterprise ) {
98+ initHdd . cbas_path . forEach ( ( dir , index ) => {
99+ config . get ( 'clusterStorage.storage.cbas_path' )
100+ . setControl ( index , new FormControl ( null ) , {
101+ emitEvent : false
102+ } ) ;
103+ } ) ;
104+ }
105+ config . get ( "clusterStorage.storage" ) . patchValue ( initHdd ) ;
106+ }
91107 }
92108}
0 commit comments