File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed
frontend/app/components/capture_profile/capture_profile_dialog Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 116116 />
117117 </ mat-form-field >
118118 </ div >
119+
120+ < div >
121+ Extra Options:
122+ < div *ngFor ="let option of extraOptions; let i = index ">
123+ < mat-form-field >
124+ < input matInput placeholder ="Key " [(ngModel)] ="option.key " />
125+ </ mat-form-field >
126+ < mat-form-field >
127+ < input matInput placeholder ="Value " [(ngModel)] ="option.value " />
128+ </ mat-form-field >
129+ < button mat-button (click) ="removeExtraOption(i) "> Remove</ button >
130+ </ div >
131+ < button mat-button (click) ="addExtraOption() "> Add Option</ button >
132+ </ div >
119133 </ mat-expansion-panel >
120134 </ div >
121135</ mat-dialog-content >
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export class CaptureProfileDialog {
2424 deviceTracerLevel = '1' ;
2525 pythonTracerLevel = '0' ;
2626 delay = 0 ;
27+ extraOptions : Array < { key : string , value : string } > = [ ] ;
2728
2829 constructor ( private readonly dialogRef :
2930 MatDialogRef < CaptureProfileDialog > ) { }
@@ -37,7 +38,7 @@ export class CaptureProfileDialog {
3738 }
3839
3940 captureProfile ( ) {
40- this . dialogRef . close ( {
41+ const options : { [ key : string ] : string | number | boolean } = {
4142 serviceAddr : this . serviceAddr ,
4243 isTpuName : this . isTpuName ,
4344 duration : this . duration ,
@@ -47,10 +48,24 @@ export class CaptureProfileDialog {
4748 deviceTracerLevel : Number ( this . deviceTracerLevel ) ,
4849 pythonTracerLevel : Number ( this . pythonTracerLevel ) ,
4950 delay : this . delay ,
50- } ) ;
51+ } ;
52+
53+ for ( const option of this . extraOptions ) {
54+ options [ option . key ] = option . value ;
55+ }
56+
57+ this . dialogRef . close ( options ) ;
5158 }
5259
5360 close ( ) {
5461 this . dialogRef . close ( ) ;
5562 }
63+
64+ addExtraOption ( ) {
65+ this . extraOptions . push ( { key : '' , value : '' } ) ;
66+ }
67+
68+ removeExtraOption ( index : number ) {
69+ this . extraOptions . splice ( index , 1 ) ;
70+ }
5671}
You can’t perform that action at this time.
0 commit comments