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