This repository was archived by the owner on Jul 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,16 @@ <h2 class="tim-text-title">
7171 </ mat-form-field >
7272
7373 < mat-checkbox formControlName ="Tty "
74- style ="margin-left:8px; "> TTY</ mat-checkbox >
74+ style ="margin-left:8px; ">
75+ TTY
76+ </ mat-checkbox >
77+
78+ < ng-container formGroupName ="HostConfig ">
79+ < mat-checkbox formControlName ="AutoRemove "
80+ style ="margin-left:8px; ">
81+ Auto Remove
82+ </ mat-checkbox >
83+ </ ng-container >
7584 </ div >
7685 < div >
7786 < button mat-raised-button
@@ -84,4 +93,6 @@ <h2 class="tim-text-title">
8493 </ div >
8594 </ mat-card >
8695
87- </ form >
96+ </ form >
97+
98+ < pre > {{form.value|json}}</ pre >
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ export class ContainerCreateComponent implements OnInit {
4949
5050 public ngOnInit ( ) {
5151 this . form = this . containerForm . createForm ( this . initialConfig ) ;
52- console . log ( this . form . getRawValue ( ) ) ;
5352 if ( this . disableImage ) {
5453 const imgCtrl = this . form . get ( 'Image' ) ;
5554 imgCtrl . disable ( ) ;
@@ -62,7 +61,6 @@ export class ContainerCreateComponent implements OnInit {
6261
6362 public launch ( ) {
6463 const data = this . containerForm . formToData ( this . form ) ;
65- console . log ( data ) ;
6664 const job = this . dockerJobs . createContainer ( data ) ;
6765 this . created . emit ( job ) ;
6866 }
Original file line number Diff line number Diff line change @@ -123,6 +123,16 @@ export class ContainerFormService {
123123 form . setControl ( 'Cmd' , this . fb . control ( null ) ) ;
124124 form . setControl ( 'Tty' , this . fb . control ( data . Tty ) ) ;
125125
126+ if ( ! data . HostConfig ) {
127+ form . setControl ( 'HostConfig' , this . fb . group ( { } ) ) ;
128+ }
129+
130+ // Setup some healthy deaults if not provided
131+ if ( ! data . HostConfig
132+ || typeof data . HostConfig . AutoRemove !== 'boolean' ) {
133+ ( form . get ( 'HostConfig' ) as FormGroup ) . setControl ( 'AutoRemove' , this . fb . control ( true ) ) ;
134+ }
135+
126136 if ( typeof data . Tty !== 'boolean' ) {
127137 form . get ( 'Tty' ) . setValue ( true ) ;
128138 }
You can’t perform that action at this time.
0 commit comments