From 9b51eef8f2c077bd3960a42f07f6562b67725325 Mon Sep 17 00:00:00 2001 From: liangling Date: Fri, 6 Dec 2024 17:17:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Profiling=20datasource=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=BC=80=E5=8F=91=20#=20Reviewed,=20transaction=20id:?= =?UTF-8?q?=2026091?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/condition-input.tsx | 13 +++--- src/profiling/src/components/query-editor.tsx | 2 +- src/profiling/src/datasource/datasource.ts | 44 ++++++++++++------- src/profiling/src/typings/metric.ts | 2 +- src/trace/src/datasource.ts | 17 +++---- 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/profiling/src/components/condition-input.tsx b/src/profiling/src/components/condition-input.tsx index a951d8c..a9c2281 100644 --- a/src/profiling/src/components/condition-input.tsx +++ b/src/profiling/src/components/condition-input.tsx @@ -34,7 +34,7 @@ import { map, merge, type Observable } from 'rxjs'; import type { ProfilingQuery } from '../typings/datasource'; import { CONDITION, type ICommonItem, type IConditionItem, STRING_CONDITION_METHOD_LIST } from '../typings/metric'; -import { DIM_NULL_ID } from '../typings/profile'; +// import { DIM_NULL_ID } from '../typings/profile'; import { t } from 'common/utils/utils'; import type DataSource from '../datasource/datasource'; @@ -121,7 +121,7 @@ const ConditionInput: React.FC = ({ datasource, filterList, keyList, onC ...item, key: v, method: getMethodList()[0].id, - value: [], + value: '', ...(i > 0 ? { condition: 'and' } : {}), }; } @@ -139,7 +139,7 @@ const ConditionInput: React.FC = ({ datasource, filterList, keyList, onC handleCommonChange(index, 'method', v); }; - const handleValueChange = (v: string[], index: number) => { + const handleValueChange = (v: string, index: number) => { const param = filterList.map((item, i) => { if (i === index) { return { @@ -231,6 +231,7 @@ const ConditionInput: React.FC = ({ datasource, filterList, keyList, onC } autoFocus={true} className={`condition-input-key-${index}`} + style={{ marginLeft: '-1px' }} defaultOpen={item.key === '' && !!keyList.length} defaultValue={item.key || undefined} dropdownMatchSelectWidth={140} @@ -290,21 +291,21 @@ const ConditionInput: React.FC = ({ datasource, filterList, keyList, onC className='condition-input-value' defaultValue={item.value} dropdownMatchSelectWidth={true} - mode='tags' placeholder={t('请输入')} showArrow={false} tokenSeparators={[',', '|', '\n', ' ', '\r\n', '\r']} onChange={v => handleValueChange(v, index)} onInputKeyDown={v => handleValueConditionKeyDown(v)} + showSearch={true} > - {needNUll(item.key) && ( + {/* {needNUll(item.key) && ( - )} + )} */} {dimensionValueMap[item.key]?.map?.(dim => (