Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@
/>
</mat-form-field>
</div>

<div>
Extra Options:
<div *ngFor="let option of extraOptions; let i = index">
<mat-form-field>
<input matInput placeholder="Key" [(ngModel)]="option.key" />
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Value" [(ngModel)]="option.value" />
</mat-form-field>
<button mat-button (click)="removeExtraOption(i)">Remove</button>
</div>
<button mat-button (click)="addExtraOption()">Add Option</button>
</div>
</mat-expansion-panel>
</div>
</mat-dialog-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class CaptureProfileDialog {
deviceTracerLevel = '1';
pythonTracerLevel = '0';
delay = 0;
extraOptions: Array<{key: string, value: string}> = [];

constructor(private readonly dialogRef:
MatDialogRef<CaptureProfileDialog>) {}
Expand All @@ -37,7 +38,7 @@ export class CaptureProfileDialog {
}

captureProfile() {
this.dialogRef.close({
const options: {[key: string]: string|number|boolean} = {
serviceAddr: this.serviceAddr,
isTpuName: this.isTpuName,
duration: this.duration,
Expand All @@ -47,10 +48,24 @@ export class CaptureProfileDialog {
deviceTracerLevel: Number(this.deviceTracerLevel),
pythonTracerLevel: Number(this.pythonTracerLevel),
delay: this.delay,
});
};

for (const option of this.extraOptions) {
options[option.key] = option.value;
}

this.dialogRef.close(options);
}

close() {
this.dialogRef.close();
}

addExtraOption() {
this.extraOptions.push({key: '', value: ''});
}

removeExtraOption(index: number) {
this.extraOptions.splice(index, 1);
}
}