11<template lang="pug">
2- a-layout.full-height-layout ( style ="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08); height: calc(100vh - 30px)" )
2+ a-layout.full-height-layout.pipefile-view (
3+ style ="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08); height: calc(100vh - 30px)"
4+ )
35 a-layout-sider( style ="width: 45%" : resize- directions= "['right']" )
46 a-card.light-editor-card ( :bordered ="false" )
57 template( #title )
@@ -49,7 +51,7 @@ a-layout.full-height-layout(style="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
4951 div
5052 .full-width-height-editor.pipeline-editor ( :class ="editorHeightClass" )
5153 YMLEditorSimple( v-model ="currFile.content" style ="width: 100%; height: 100%" )
52- a-layout-content.content-wrapper ( style ="display: flex; flex-direction: column; gap: 24px; padding-bottom: 22px" )
54+ a-layout-content.content-wrapper ( style ="display: flex; flex-direction: column; padding-bottom: 22px" )
5355 a-card.light-editor-card ( title ="Input" : bordered= "false" )
5456 template( #extra )
5557 a-space
@@ -63,7 +65,7 @@ a-layout.full-height-layout(style="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
6365 a-option( value ="application/json" ) json
6466 a-option( value ="application/x-ndjson" ) ndjson
6567
66- a-button( size ="small" @click ="handleDebug" ) Test
68+ a-button( size ="small" type = "primary" @click ="handleDebug" ) Test
6769
6870 template( #title )
6971 .card-title-with-description
@@ -82,7 +84,7 @@ a-layout.full-height-layout(style="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
8284 :indent-with-tab ="true"
8385 :tabSize ="2"
8486 )
85-
87+ .section-divider
8688 a-card.light-editor-card.output ( title ="Output" : bordered= "false" )
8789 template( #extra )
8890 a-radio-group.output-view-toggle ( v-model ="outputViewMode" type ="button" size ="small" )
@@ -94,17 +96,38 @@ a-layout.full-height-layout(style="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
9496 .card-title Output
9597 .card-description Processed logs displayed here. Logs that ingested via API will follow this structure.
9698
99+ // Semantic Type Legend
100+ .semantic-legend (
101+ v-if ="outputViewMode === 'table' && parsedOutputData.records && parsedOutputData.records.rows.length > 0"
102+ )
103+ .legend-items
104+ .legend-item
105+ .legend-color.field
106+ .legend-label Field
107+ .legend-item
108+ .legend-color.tag
109+ .legend-label Tag
110+ .legend-item
111+ .legend-color.timestamp
112+ .legend-label Timestamp
113+
97114 a-empty(
98115 v-if ="parsedOutputData.records && parsedOutputData.records.rows.length === 0"
99- style ="border: 1px solid var(--color-border); border-radius: 2px; height: 100%; display: flex; align-items: center; justify-content: center; margin-top: 8px; flex: 1"
116+ style ="border: 1px solid var(--color-border); border-radius: 2px; height: 100%; display: flex; align-items: center; justify-content: center; flex: 1"
100117 description ="No parsed data. Click Test to see results."
101118 )
102119
103120 // Table View
104121 .output-table (
105122 v-if ="outputViewMode === 'table' && parsedOutputData.records && parsedOutputData.records.rows.length > 0"
106123 )
107- DataGrid( :data ="parsedOutputData" : has- header= "false" )
124+ DataTable(
125+ :data ="tableData"
126+ :columns ="tableColumns"
127+ :loading ="false"
128+ :show-context-menu ="false"
129+ :wrap-line ="true"
130+ )
108131
109132 // JSON View
110133 .full-width-height-editor (
@@ -129,7 +152,10 @@ a-layout.full-height-layout(style="box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
129152 import { json } from ' @codemirror/lang-json'
130153 import { create , list , del , debugContent , getByName } from ' @/api/pipeline'
131154 import type { PipeFile } from ' @/api/pipeline'
155+ import type { ColumnType } from ' @/types/query'
132156 import router from ' @/router'
157+ import DataTable from ' @/components/data-table/index.vue'
158+ import { toObj } from ' ../query/until'
133159
134160 const emit = defineEmits ([' refresh' , ' del' ])
135161 const props = defineProps <{
@@ -290,6 +316,10 @@ transform:
290316 type: ' table' ,
291317 })
292318
319+ // DataTable specific variables
320+ const tableData = ref <Array <any >>([])
321+ const tableColumns = ref <Array <ColumnType >>([])
322+
293323 function handleDebug() {
294324 debugContent (currFile .content , debugForm .content , selectedContentType .value ).then ((result ) => {
295325 debugResponse .value = JSON .stringify (result [0 ], null , 2 )
@@ -300,7 +330,7 @@ transform:
300330 })
301331 const schema = result [0 ].schema || []
302332
303- // Parse response for DataGrid format
333+ // Parse response for DataGrid format (keep for compatibility)
304334 parsedOutputData .value = {
305335 records: {
306336 rows ,
@@ -318,6 +348,19 @@ transform:
318348 key: Date .now (),
319349 type: ' table' ,
320350 }
351+
352+ // Update DataTable format
353+ const schemas = schema .map ((col ) => ({
354+ name: col .name ,
355+ title: col .name ,
356+ data_type: col .data_type || ' String' ,
357+ semantic_type: col .colume_type ,
358+ }))
359+
360+ tableColumns .value = schemas
361+ tableData .value = rows .map ((row , index ) => {
362+ return toObj (row , schemas , index , null )
363+ })
321364 })
322365 }
323366
@@ -378,7 +421,6 @@ transform:
378421 }
379422 :deep(.arco-card-header ) {
380423 flex-shrink : 0 ;
381- margin-top : 12px ;
382424 }
383425 }
384426
@@ -441,4 +483,109 @@ transform:
441483 overflow : hidden ;
442484 }
443485 }
486+
487+ // ===================
488+ // SEMANTIC TYPE STYLES
489+ // ===================
490+
491+ // Define semantic type colors as CSS variables at component level
492+ .pipefile-view {
493+ --semantic-field-bg : #f6ffed ;
494+ --semantic-field-text : #36b174 ;
495+ --semantic-field-legend : #36b174 ;
496+
497+ --semantic-tag-bg : #fff7e6 ;
498+ --semantic-tag-text : #e1b84d ;
499+ --semantic-tag-legend : #e1b84d ;
500+
501+ --semantic-timestamp-bg : #e6f4ff ;
502+ --semantic-timestamp-text : #417aff ;
503+ --semantic-timestamp-legend : #417aff ;
504+ font-size : 13px ;
505+ }
506+
507+ .semantic-legend {
508+ display : flex ;
509+ align-items : center ;
510+ gap : 16px ;
511+ margin-bottom : 12px ;
512+ justify-content : flex-end ;
513+
514+ .legend-title {
515+ font-size : 12px ;
516+ font-weight : 600 ;
517+ color : var (--color-text-2 );
518+ }
519+
520+ .legend-items {
521+ display : flex ;
522+ gap : 16px ;
523+ }
524+
525+ .legend-item {
526+ display : flex ;
527+ align-items : center ;
528+ gap : 6px ;
529+
530+ .legend-color {
531+ width : 12px ;
532+ height : 12px ;
533+ border-radius : 2px ;
534+ border : 1px solid var (--color-border-3 );
535+
536+ & .field {
537+ background-color : var (--semantic-field-legend );
538+ }
539+
540+ & .tag {
541+ background-color : var (--semantic-tag-legend );
542+ }
543+
544+ & .timestamp {
545+ background-color : var (--semantic-timestamp-legend );
546+ }
547+ }
548+
549+ .legend-label {
550+ font-size : 12px ;
551+ color : var (--color-text-2 );
552+ }
553+ }
554+ }
555+
556+ .output-table {
557+ :deep(.arco-table-th-title ) {
558+ .timestamp {
559+ background-color : var (--semantic-timestamp-bg );
560+ color : var (--semantic-timestamp-text );
561+ padding : 2px 4px ;
562+ }
563+
564+ .field {
565+ background-color : var (--semantic-field-bg );
566+ color : var (--semantic-field-text );
567+ padding : 2px 4px ;
568+ }
569+
570+ .tag {
571+ background-color : var (--semantic-tag-bg );
572+ color : var (--semantic-tag-text );
573+ padding : 2px 4px ;
574+ }
575+ }
576+ :deep(.arco-table-size-medium .arco-table-td ) {
577+ font-size : 13px ;
578+ }
579+ }
580+ .light-editor-card :deep(.arco-card-header ) {
581+ border-bottom : 1px solid var (--color-border );
582+ height : 70px ;
583+ }
584+ .section-divider {
585+ height : 6px ;
586+ background : var (--color-neutral-3 );
587+ border : none ;
588+ margin : 10px 0 0 ;
589+ position : relative ;
590+ }
444591 </style >
0 commit comments