Skip to content

Commit 91e8c2a

Browse files
Profiler Teamcopybara-github
authored andcommitted
Add modifiable tqx parameter to CSV export module.
PiperOrigin-RevId: 858685588
1 parent b8d26f0 commit 91e8c2a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

frontend/app/components/controls/export_as_csv/export_as_csv.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ export class ExportAsCsv {
1414
@Input() tool = '';
1515
@Input() sessionId = '';
1616
@Input() host = '';
17+
@Input() tqx = '';
1718

1819
dataService: DataServiceV2Interface = inject(DATA_SERVICE_INTERFACE_TOKEN);
1920

2021
exportDataAsCSV() {
21-
this.dataService.exportDataAsCSV(this.sessionId, this.tool, this.host);
22+
this.dataService.exportDataAsCSV(
23+
this.sessionId, this.tool, this.host, this.tqx);
2224
}
2325
}

frontend/app/services/data_service_v2/data_service_v2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ export class DataServiceV2 implements DataServiceV2Interface {
369369
window.history.replaceState({}, '', newUrl);
370370
}
371371

372-
exportDataAsCSV(sessionId: string, tool: string, host: string) {
372+
exportDataAsCSV(sessionId: string, tool: string, host: string, tqx = '') {
373373
let params = this.getHttpParamsWithPath();
374374
params = params.set('run', sessionId)
375375
.set('tag', tool)
376376
.set('host', host)
377-
.set('tqx', 'out:csv;');
377+
.set('tqx', 'out:csv;' + tqx);
378378
windowOpen(
379379
window, this.pathPrefix + DATA_CSV_API + '?' + params.toString(),
380380
'_blank');

frontend/app/services/data_service_v2/data_service_v2_interface.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ export interface DataServiceV2Interface {
101101
getSearchParams(): URLSearchParams;
102102
setSearchParams(searchParams: URLSearchParams): void;
103103

104-
exportDataAsCSV(sessionId: string, tool: string, host: string): void;
104+
// Export tool data for the given session as a CSV.
105+
// tqx: additional query parameters to pass to the server. The format should
106+
// be a semicolon-separated list of key-value pairs, for example,
107+
// "key1:value1;key2:value2".
108+
exportDataAsCSV(sessionId: string, tool: string, host: string, tqx?: string):
109+
void;
105110

106111
getDataByModuleNameAndMemorySpace(
107112
tool: string,

0 commit comments

Comments
 (0)