Skip to content

Commit f574ae1

Browse files
committed
Merge branch 'main' of github.com:n9e/fe into main
2 parents db70196 + 26fe1f3 commit f574ae1

11 files changed

Lines changed: 52 additions & 42 deletions

File tree

src/components/pageLayout/PageLayoutWithTabs/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,16 @@ const PageLayout: React.FC<IPageLayoutProps> = ({ icon, title, rightArea, introI
117117
)}
118118
<Menu.Item
119119
onClick={() => {
120-
Logout().then(() => {
120+
Logout().then((res) => {
121121
localStorage.removeItem(AccessTokenKey);
122122
localStorage.removeItem('refresh_token');
123123
localStorage.removeItem('curBusiId');
124-
history.push('/login');
124+
// 如果 res.dat 是一个字符串,表示重定向 URL,则直接跳转到该 URL
125+
if (res.dat && typeof res.dat === 'string') {
126+
window.location.href = res.dat;
127+
} else {
128+
history.push('/login');
129+
}
125130
});
126131
}}
127132
>

src/pages/alertRules/Form/components/Triggers/Triggers.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*
1616
*/
1717

18-
import React, { useContext, useEffect } from 'react';
19-
import { Form, Card, Space, Switch, Button } from 'antd';
18+
import React, { useContext } from 'react';
19+
import { Form, Card, Space, Switch, Button, Alert } from 'antd';
2020
import { PlusOutlined, CloseCircleOutlined, CheckCircleOutlined } from '@ant-design/icons';
2121
import _ from 'lodash';
2222
import { useTranslation } from 'react-i18next';
@@ -108,6 +108,7 @@ export default function index(props: IProps) {
108108
{t('trigger.exp_trigger_disable')}
109109
</Space>
110110
<Inhibit triggersKey='triggers' />
111+
<Alert type='info' message={t('trigger.threshold_tip')} />
111112
<Form.List {...prefixField} name={[...prefixName, 'triggers']} initialValue={initialValue}>
112113
{(fields, { add, remove }) => (
113114
<>

src/pages/alertRules/locale/en_US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ const en_US = {
299299
join_type_placeholder: 'Select join operation',
300300
on: 'Label key',
301301
},
302+
threshold_tip: 'Please ensure that all variables have data and their labels are consistent, otherwise threshold judgment cannot be performed.',
302303
},
303304
nodata_trigger: {
304305
title: 'No data',

src/pages/alertRules/locale/ja_JP.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ const ja_JP = {
294294
join_type_placeholder: '集合操作を選択',
295295
on: 'ラベル名',
296296
},
297+
threshold_tip: 'すべての変数にデータがあり、それらのラベルが一致していることを確認してください。そうしないと、閾値判断を行うことができません。',
297298
},
298299
nodata_trigger: {
299300
title: 'データなしトリガー',

src/pages/alertRules/locale/ru_RU.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ const ru_RU = {
298298
join_type_placeholder: 'Пожалуйста, выберите операцию над наборами',
299299
on: 'Имя метки',
300300
},
301+
threshold_tip: 'Пожалуйста, убедитесь, что все переменные имеют данные и их метки совпадают, иначе пороговая проверка не будет выполнена.',
301302
},
302303
nodata_trigger: {
303304
title: 'Отсутствие данных',

src/pages/alertRules/locale/zh_CN.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ const zh_CN = {
295295
join_type_placeholder: '请选择集合操作',
296296
on: '标签名',
297297
},
298+
threshold_tip: '请确保所有变量均有数据,且它们的标签一致,否则无法进行阈值判断。',
298299
},
299300
nodata_trigger: {
300301
title: '数据缺失',

src/pages/alertRules/locale/zh_HK.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ const zh_HK = {
295295
join_type_placeholder: '選擇集合操作',
296296
on: '標籤名',
297297
},
298+
threshold_tip: '請確保所有變量均有數據,且它們的標籤一致,否則無法進行閾值判斷。',
298299
},
299300
nodata_trigger: {
300301
title: '無數據告警',

src/pages/dashboard/Editor/QueryEditor/Elasticsearch/GroupBy/Terms.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function Terms({ prefixField, fieldsOptions, values }) {
5454
</Col>
5555
<Col span={6}>
5656
<InputGroupWithFormItem label={t('datasource:es.terms.min_value')}>
57-
<Form.Item {...prefixField} name={[prefixField.name, 'min_value']} noStyle>
57+
<Form.Item {...prefixField} name={[prefixField.name, 'min_doc_count']} noStyle>
5858
<InputNumber style={{ width: '100%' }} />
5959
</Form.Item>
6060
</InputGroupWithFormItem>
@@ -71,7 +71,7 @@ export default function Terms({ prefixField, fieldsOptions, values }) {
7171
</Col>
7272
<Col span={6}>
7373
<InputGroupWithFormItem label='OrderBy'>
74-
<Form.Item {...prefixField} name={[prefixField.name, 'orderBy']}>
74+
<Form.Item {...prefixField} name={[prefixField.name, 'order_by']}>
7575
<Select>
7676
<Select.Option value='_key'>Term value</Select.Option>
7777
<Select.Option value='_count'>Count</Select.Option>

src/pages/dashboard/Renderer/datasource/elasticsearch/queryBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ export function getSeriesQuery(target: ElasticsearchQuery, intervalkey: string)
122122
field: aggDef.field,
123123
size: aggDef.size || 10,
124124
order: {
125-
[aggDef.orderBy || '_key']: aggDef.order || 'desc',
125+
[aggDef.order_by || '_key']: aggDef.order || 'desc',
126126
},
127-
min_doc_count: aggDef.min_value || 1,
127+
min_doc_count: aggDef.min_doc_count || 1,
128128
};
129129
break;
130130
}

src/pages/dashboard/Renderer/datasource/elasticsearch/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export interface ElasticsearchQuery {
1111
group_by: {
1212
cate: string;
1313
field?: string;
14-
min_value?: number;
14+
min_doc_count?: number;
1515
size?: number;
1616
order?: string;
17-
orderBy?: string;
17+
order_by?: string;
1818
}[];
1919
start: number;
2020
end: number;

0 commit comments

Comments
 (0)