mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 02:46:56 +00:00
(feature)(webapp) add query mode in parse tip and change query modes query to METRIC and TAG (#425)
This commit is contained in:
@@ -91,6 +91,7 @@ export type ChatContextType = {
|
||||
elementMatches: any[];
|
||||
nativeQuery: boolean;
|
||||
queryMode: string;
|
||||
queryType: 'METRIC' | 'TAG' | 'OTHER';
|
||||
dimensionFilters: FilterItemType[];
|
||||
properties: any;
|
||||
sqlInfo: SqlInfoType;
|
||||
|
||||
@@ -94,6 +94,7 @@ const ParseTip: React.FC<Props> = ({
|
||||
metrics,
|
||||
aggType,
|
||||
queryMode,
|
||||
queryType,
|
||||
properties,
|
||||
entity,
|
||||
elementMatches,
|
||||
@@ -151,6 +152,14 @@ const ParseTip: React.FC<Props> = ({
|
||||
<div className={itemValueClass}>{modelName}</div>
|
||||
</div>
|
||||
)}
|
||||
{(queryType === 'METRIC' || queryType === 'TAG') && (
|
||||
<div className={`${prefixCls}-tip-item`}>
|
||||
<div className={`${prefixCls}-tip-item-name`}>查询模式:</div>
|
||||
<div className={itemValueClass}>
|
||||
{queryType === 'METRIC' ? '指标模式' : '标签模式'}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!queryMode?.includes('ENTITY') &&
|
||||
metrics &&
|
||||
metrics.length > 0 &&
|
||||
|
||||
@@ -25,6 +25,10 @@ const DimensionSection: React.FC<Props> = ({
|
||||
|
||||
const defaultDimensions = dimensions.slice(0, DEFAULT_DIMENSION_COUNT);
|
||||
|
||||
if (defaultDimensions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`${prefixCls}-section`}>
|
||||
<div className={`${prefixCls}-title`}>{isSecondDrillDown ? '二级' : '推荐'}下钻维度:</div>
|
||||
|
||||
@@ -126,10 +126,10 @@ export const layout: RunTimeLayoutConfig = (params) => {
|
||||
rightContentRender: () => <RightContent />,
|
||||
disableContentMargin: true,
|
||||
menuHeaderRender: undefined,
|
||||
childrenRender: (dom) => {
|
||||
childrenRender: (dom: any) => {
|
||||
return (
|
||||
<div
|
||||
style={{ height: location.pathname.includes('chat') ? 'calc(100vh - 48px)' : undefined }}
|
||||
style={{ height: location.pathname.includes('chat') ? 'calc(100vh - 56px)' : undefined }}
|
||||
>
|
||||
{dom}
|
||||
{history.location.pathname !== '/chat' && !isMobile && (
|
||||
|
||||
@@ -241,7 +241,7 @@ const ToolModal: React.FC<Props> = ({ editTool, onSaveTool, onCancel }) => {
|
||||
</FormItem>
|
||||
)}
|
||||
{toolType === AgentToolTypeEnum.RULE && (
|
||||
<FormItem name="queryModes" label="查询模式">
|
||||
<FormItem name="queryTypes" label="查询模式">
|
||||
<Select
|
||||
placeholder="请选择查询模式"
|
||||
options={QUERY_MODE_LIST}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
.agent {
|
||||
height: calc(100vh - 48px);
|
||||
height: calc(100vh - 56px);
|
||||
}
|
||||
|
||||
.agentsSection {
|
||||
padding: 20px 40px;
|
||||
background: #fff;
|
||||
height: calc(100vh - 48px);
|
||||
height: calc(100vh - 56px);
|
||||
|
||||
.sectionTitle {
|
||||
font-size: 24px;
|
||||
|
||||
@@ -11,17 +11,6 @@ export enum AgentToolTypeEnum {
|
||||
INTERPRET = 'INTERPRET'
|
||||
}
|
||||
|
||||
export enum QueryModeEnum {
|
||||
ENTITY_DETAIL = 'ENTITY_DETAIL',
|
||||
ENTITY_LIST_FILTER = 'ENTITY_LIST_FILTER',
|
||||
ENTITY_ID = 'ENTITY_ID',
|
||||
METRIC_ENTITY = 'METRIC_ENTITY',
|
||||
METRIC_FILTER = 'METRIC_FILTER',
|
||||
METRIC_GROUPBY = 'METRIC_GROUPBY',
|
||||
METRIC_MODEL = 'METRIC_MODEL',
|
||||
METRIC_ORDERBY = 'METRIC_ORDERBY'
|
||||
}
|
||||
|
||||
export const AGENT_TOOL_TYPE_LIST = [
|
||||
{
|
||||
label: '规则语义解析',
|
||||
@@ -41,38 +30,19 @@ export const AGENT_TOOL_TYPE_LIST = [
|
||||
},
|
||||
]
|
||||
|
||||
export enum QueryModeEnum {
|
||||
METRIC = 'METRIC',
|
||||
TAG = 'TAG'
|
||||
}
|
||||
|
||||
export const QUERY_MODE_LIST = [
|
||||
{
|
||||
label: '实体明细(查询维度信息)',
|
||||
value: QueryModeEnum.ENTITY_DETAIL
|
||||
label: '指标模式',
|
||||
value: QueryModeEnum.METRIC
|
||||
},
|
||||
{
|
||||
label: '实体圈选',
|
||||
value: QueryModeEnum.ENTITY_LIST_FILTER
|
||||
},
|
||||
{
|
||||
label: '实体查询(按ID查询)',
|
||||
value: QueryModeEnum.ENTITY_ID
|
||||
},
|
||||
{
|
||||
label: '指标查询(带实体)',
|
||||
value: QueryModeEnum.METRIC_ENTITY
|
||||
},
|
||||
{
|
||||
label: '指标查询(带条件)',
|
||||
value: QueryModeEnum.METRIC_FILTER
|
||||
},
|
||||
{
|
||||
label: '指标查询(按维度分组)',
|
||||
value: QueryModeEnum.METRIC_GROUPBY
|
||||
},
|
||||
{
|
||||
label: '指标查询(不带条件)',
|
||||
value: QueryModeEnum.METRIC_MODEL
|
||||
},
|
||||
{
|
||||
label: '按指标排序',
|
||||
value: QueryModeEnum.METRIC_ORDERBY
|
||||
label: '标签模式',
|
||||
value: QueryModeEnum.TAG
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user