diff --git a/apps/zui/src/components/data-format-select.tsx b/apps/zui/src/components/data-format-select.tsx index 9a415e0b2b..7b32bac8f8 100644 --- a/apps/zui/src/components/data-format-select.tsx +++ b/apps/zui/src/components/data-format-select.tsx @@ -9,6 +9,7 @@ export function DataFormatOptions() { + diff --git a/apps/zui/src/domain/results/utils/prep-export-query.ts b/apps/zui/src/domain/results/utils/prep-export-query.ts index 31652bd58b..27b5a1ce3d 100644 --- a/apps/zui/src/domain/results/utils/prep-export-query.ts +++ b/apps/zui/src/domain/results/utils/prep-export-query.ts @@ -22,6 +22,7 @@ function cutColumns(query: string, api: ZuiApi) { } function maybeFuse(query: string, format: string) { - if (format === "csv" || format === "arrows") query += " | fuse" + if (format === "csv" || format == "tsv" || format === "arrows") + query += " | fuse" return query } diff --git a/apps/zui/src/js/components/ExportModal.tsx b/apps/zui/src/js/components/ExportModal.tsx index 3bda6395bc..cb15be72b4 100644 --- a/apps/zui/src/js/components/ExportModal.tsx +++ b/apps/zui/src/js/components/ExportModal.tsx @@ -75,6 +75,10 @@ const ExportModal = ({onClose}) => { +
+ + +
diff --git a/apps/zui/src/test/shared/data/sample.tsv b/apps/zui/src/test/shared/data/sample.zeektsv similarity index 100% rename from apps/zui/src/test/shared/data/sample.tsv rename to apps/zui/src/test/shared/data/sample.zeektsv diff --git a/packages/zed-js/src/client/types.ts b/packages/zed-js/src/client/types.ts index ee7b1a807c..fa9ccd1e0c 100644 --- a/packages/zed-js/src/client/types.ts +++ b/packages/zed-js/src/client/types.ts @@ -7,6 +7,7 @@ export type ResponseFormat = | 'csv' | 'json' | 'ndjson' + | 'tsv' | 'vng' | 'zeek' | 'zjson' @@ -69,6 +70,7 @@ export type LoadFormat = | 'json' | 'line' | 'parquet' + | 'tsv' | 'vng' | 'zeek' | 'zjson' @@ -82,6 +84,7 @@ export type LoadContentType = | 'application/json' | 'application/x-line' | 'application/x-parquet' + | 'text/tab-separated-values' | 'application/x-vng' | 'application/x-zeek' | 'application/x-zjson' diff --git a/packages/zed-js/src/client/utils.ts b/packages/zed-js/src/client/utils.ts index 38ae0f58b9..b2af4b92a7 100644 --- a/packages/zed-js/src/client/utils.ts +++ b/packages/zed-js/src/client/utils.ts @@ -36,6 +36,7 @@ export function accept(format: ResponseFormat) { csv: 'text/csv', json: 'application/json', ndjson: 'application/x-ndjson', + tsv: 'text/tab-separated-values', vng: 'application/x-vng', zeek: 'application/x-zeek', zjson: 'application/x-zjson', diff --git a/packages/zui-player/README.md b/packages/zui-player/README.md index f08ab99795..b458eb269d 100644 --- a/packages/zui-player/README.md +++ b/packages/zui-player/README.md @@ -51,7 +51,7 @@ import { getPath } from 'zui-test-data'; play('Preview & Load', (app, test) => { test('create new pool, change key, type ', async () => { - await app.dropFile(getPath('sample.tsv')); + await app.dropFile(getPath('sample.zeektsv')); await app.click('button', 'Pool Settings'); await app.fill('Pool Key', 'my_new_key'); await app.press('Enter'); diff --git a/packages/zui-player/tests/export.spec.ts b/packages/zui-player/tests/export.spec.ts index bd7884f344..efeaf37369 100644 --- a/packages/zui-player/tests/export.spec.ts +++ b/packages/zui-player/tests/export.spec.ts @@ -11,6 +11,7 @@ const formats = [ { label: 'CSV', expectedSize: 10851 }, { label: 'JSON', expectedSize: 13659 }, { label: 'NDJSON', expectedSize: 13657 }, + { label: 'TSV', expectedSize: 10797 }, { label: 'VNG', expectedSize: 8053 }, { label: 'Zeek', expectedSize: 10138 }, { label: 'ZJSON', expectedSize: 18007 }, @@ -23,7 +24,7 @@ test.describe('Export tests', () => { test.beforeAll(async () => { await app.init(); - await app.createPool([getPath('sample.tsv')]); + await app.createPool([getPath('sample.zeektsv')]); await app.click('button', 'Query Pool'); await app.query('sort ts, _path'); }); diff --git a/packages/zui-player/tests/ingest.spec.ts b/packages/zui-player/tests/ingest.spec.ts index 1c2de16109..78147e6380 100644 --- a/packages/zui-player/tests/ingest.spec.ts +++ b/packages/zui-player/tests/ingest.spec.ts @@ -31,7 +31,7 @@ test.describe('Ingest tests', () => { test.beforeAll(async () => { await app.init(); - await app.createPool([getPath('sample.tsv')]); + await app.createPool([getPath('sample.zeektsv')]); await app.click('button', 'Query Pool'); }); diff --git a/packages/zui-player/tests/preview-and-load.spec.ts b/packages/zui-player/tests/preview-and-load.spec.ts index 4a74ea6180..667f307d1d 100644 --- a/packages/zui-player/tests/preview-and-load.spec.ts +++ b/packages/zui-player/tests/preview-and-load.spec.ts @@ -3,7 +3,7 @@ import { getPath } from 'zui-test-data'; play('Preview & Load', (app, test) => { test('create new pool, change key, type ', async () => { - await app.dropFile(getPath('sample.tsv')); + await app.dropFile(getPath('sample.zeektsv')); await app.click('button', 'Pool Settings'); await app.fill('Pool Key', 'my_new_key'); await app.press('Enter'); diff --git a/packages/zui-player/tests/queries.spec.ts b/packages/zui-player/tests/queries.spec.ts index 43c7f2c83c..e2c95ecbdc 100644 --- a/packages/zui-player/tests/queries.spec.ts +++ b/packages/zui-player/tests/queries.spec.ts @@ -7,7 +7,7 @@ test.describe('Query tests', () => { test.beforeAll(async () => { await app.init(); - await app.createPool([getPath('sample.tsv')]); + await app.createPool([getPath('sample.zeektsv')]); await app.click('button', 'Query Pool'); }); @@ -26,9 +26,9 @@ test.describe('Query tests', () => { nodes.map((n) => n.innerText.trim().replaceAll(/\s+/g, ' ')) ); const expected = [ - "from 'sample.tsv' | 3 now", - "from 'sample.tsv' | 2 now", - "from 'sample.tsv' | 1 now", + "from 'sample.zeektsv' | 3 now", + "from 'sample.zeektsv' | 2 now", + "from 'sample.zeektsv' | 1 now", ]; expect(entries).toEqual(expected); }); diff --git a/packages/zui-test-data/data/sample.tsv b/packages/zui-test-data/data/sample.zeektsv similarity index 100% rename from packages/zui-test-data/data/sample.tsv rename to packages/zui-test-data/data/sample.zeektsv