File tree Expand file tree Collapse file tree 6 files changed +35
-42
lines changed
src/pybind/mgr/dashboard/frontend/src/app
shared/components/text-label-list Expand file tree Collapse file tree 6 files changed +35
-42
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ import { MultiClusterFormComponent } from './multi-cluster/multi-cluster-form/mu
8484import { MultiClusterListComponent } from './multi-cluster/multi-cluster-list/multi-cluster-list.component' ;
8585import { DashboardV3Module } from '../dashboard-v3/dashboard-v3.module' ;
8686import { MultiClusterDetailsComponent } from './multi-cluster/multi-cluster-details/multi-cluster-details.component' ;
87+ import { TextLabelListComponent } from '~/app/shared/components/text-label-list/text-label-list.component' ;
8788
8889@NgModule ( {
8990 imports : [
@@ -117,7 +118,8 @@ import { MultiClusterDetailsComponent } from './multi-cluster/multi-cluster-deta
117118 ListModule ,
118119 ToggletipModule ,
119120 IconModule ,
120- TagModule
121+ TagModule ,
122+ TextLabelListComponent
121123 ] ,
122124 declarations : [
123125 MonitorComponent ,
Original file line number Diff line number Diff line change 556556 </ div >
557557 </ div >
558558
559- < div class ="form-group row ">
560- < label class ="cd-col-form-label "
561- for ="custom_dns ">
562- < span i18n > Custom DNS</ span >
563- < cd-helper i18n >
564- < span > Comma separated list of DNSs.</ span >
565- < br >
566- < span > A list of IP addresses that will be used as the DNS servers for a Samba container.</ span >
567- </ cd-helper >
568- </ label >
569- < div class ="cd-col-form-input ">
570- < input id ="custom_dns "
571- class ="form-control "
572- type ="text "
573- formControlName ="custom_dns "
574- placeholder ="192.168.76.204 "
575- i18n-placeholder >
576- </ div >
559+ < div class ="form-item ">
560+ < cd-text-label-list formControlName ="custom_dns "
561+ label ="Custom DNS "
562+ helperText ="IP addresses that will be used as the DNS servers for a Samba container. "
563+ placeholder ="192.168.76.204 ">
564+ </ cd-text-label-list >
577565 </ div >
578566
579567 < div class ="form-group row ">
Original file line number Diff line number Diff line change @@ -539,7 +539,10 @@ x4Ea7kGVgx9kWh5XjWz9wjZvY49UKIT5ppIAWPMbLl3UpfckiuNhTA==
539539 unmanaged : false ,
540540 service_id : 'foo' ,
541541 cluster_id : 'cluster_foo' ,
542- config_uri : 'rados://.smb/foo/scc.toml'
542+ config_uri : 'rados://.smb/foo/scc.toml' ,
543+ custom_dns : null ,
544+ join_sources : undefined ,
545+ user_sources : undefined
543546 } ) ;
544547 } ) ;
545548 } ) ;
Original file line number Diff line number Diff line change @@ -1213,7 +1213,7 @@ export class ServiceFormComponent extends CdForm implements OnInit {
12131213 ( serviceSpec [ 'features' ] = serviceSpec [ 'features' ] || [ ] ) . push ( feature ) ;
12141214 }
12151215 }
1216- serviceSpec [ 'custom_dns' ] = values [ 'custom_dns' ] ?. trim ( ) ;
1216+ serviceSpec [ 'custom_dns' ] = values [ 'custom_dns' ] ;
12171217 serviceSpec [ 'join_sources' ] = values [ 'join_sources' ] ?. trim ( ) ;
12181218 serviceSpec [ 'user_sources' ] = values [ 'user_sources' ] ?. trim ( ) ;
12191219 serviceSpec [ 'include_ceph_users' ] = values [ 'include_ceph_users' ] ?. trim ( ) ;
Original file line number Diff line number Diff line change 22 < cds-text-label [helperText] ="helperText && $index === values.length - 1 ? helperText : null "
33 i18n-helperText
44 i18n >
5- < div class ="cds-input-group ">
6- < input cdsText
7- type ="text "
8- [placeholder] ="placeholder "
9- [value] ="value "
10- (input) ="onInputChange($index, $event.target.value) "/>
11- @if ($index > 0 ) {
12- < cds-icon-button kind ="ghost "
13- (click) ="deleteInput($index) "
14- size ="md ">
15- < cd-icon type ="trash "> </ cd-icon >
16- </ cds-icon-button >
17- }
18- </ div >
19- {{$index === 0 ? label : ''}}
5+ < div class ="cds-input-group ">
6+ < input cdsText
7+ type ="text "
8+ [placeholder] ="placeholder "
9+ [value] ="value "
10+ (input) ="onInputChange($index, $event.target.value) " />
11+ @if ($index > 0 ) {
12+ < cds-icon-button kind ="ghost "
13+ (click) ="deleteInput($index) "
14+ size ="md ">
15+ < cd-icon type ="trash "> </ cd-icon >
16+ </ cds-icon-button >
17+ }
18+ </ div >
19+ {{$index === 0 ? label : ''}}
2020 </ cds-text-label >
2121}
Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ import { ComponentsModule } from '../components.module';
2727 ]
2828} )
2929export class TextLabelListComponent implements ControlValueAccessor {
30- @ Input ( )
31- label : string = '' ;
32- @ Input ( )
33- helperText : string = '' ;
34- @ Input ( )
35- placeholder : string = '' ;
30+ // Label for the text list.
31+ @ Input ( ) label : string = '' ;
32+ // Optional helper text that appears under the label.
33+ @ Input ( ) helperText : string = '' ;
34+ // Value displayed if no item is present.
35+ @ Input ( ) placeholder : string = '' ;
3636
3737 values : string [ ] = [ '' ] ;
3838 disabled : boolean = false ;
You can’t perform that action at this time.
0 commit comments