Skip to content

Commit c35203a

Browse files
authored
chore: keep using English as comments & update plugin type (#1785)
1 parent c9d2bd3 commit c35203a

File tree

28 files changed

+115
-55
lines changed

28 files changed

+115
-55
lines changed

web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@ant-design/icons": "^4.0.0",
5353
"@ant-design/pro-layout": "^6.0.0",
5454
"@ant-design/pro-table": "2.30.1",
55-
"@api7-dashboard/ui": "^1.0.3",
5655
"@mrblenny/react-flow-chart": "^0.0.14",
5756
"@rjsf/antd": "2.2.0",
5857
"@rjsf/core": "2.2.0",
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
import React, { CSSProperties } from 'react';
18+
import { Divider, Tooltip } from 'antd';
19+
import { QuestionCircleOutlined } from '@ant-design/icons';
20+
21+
const PanelSection: React.FC<{
22+
title: string;
23+
style?: CSSProperties;
24+
id?: string;
25+
tooltip?: string;
26+
}> = ({ title, style, id, children, tooltip }) => {
27+
return (
28+
<div id={id}>
29+
<Divider orientation="left">
30+
{title}
31+
&nbsp;
32+
{tooltip && <Tooltip title={tooltip}><QuestionCircleOutlined /></Tooltip>}
33+
</Divider>
34+
<div style={style}>{children}</div>
35+
</div>
36+
);
37+
};
38+
39+
export default PanelSection;

web/src/components/Plugin/PluginPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
*/
1717
import React, { useEffect, useState } from 'react';
1818
import { Anchor, Layout, Card, Button, Form, Select, Alert } from 'antd';
19-
import { PanelSection } from '@api7-dashboard/ui';
2019
import { omit, orderBy } from 'lodash';
2120
import { useIntl } from 'umi';
2221

22+
import PanelSection from '@/components/PanelSection';
2323
import PluginDetail from './PluginDetail';
2424
import { fetchList, fetchPluginTemplateList } from './service';
2525
import { PLUGIN_ICON_LIST, PLUGIN_FILTER_LIST } from './data';

web/src/components/Plugin/data.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export enum PluginType {
3939
traffic = "traffic",
4040
serverless = "serverless",
4141
observability = "observability",
42-
logging = "logging",
4342
other = "other"
4443
}
4544

@@ -64,7 +63,7 @@ export const PLUGIN_LIST = {
6463
type: PluginType.authentication
6564
},
6665
"error-log-logger": {
67-
type: PluginType.logging
66+
type: PluginType.observability
6867
},
6968
"fault-injection": {
7069
type: PluginType.security
@@ -79,7 +78,7 @@ export const PLUGIN_LIST = {
7978
type: PluginType.other
8079
},
8180
"syslog": {
82-
type: PluginType.logging
81+
type: PluginType.observability
8382
},
8483
"traffic-split": {
8584
type: PluginType.traffic
@@ -88,13 +87,13 @@ export const PLUGIN_LIST = {
8887
type: PluginType.authentication
8988
},
9089
"kafka-logger": {
91-
type: PluginType.logging
90+
type: PluginType.observability
9291
},
9392
"limit-conn": {
9493
type: PluginType.traffic
9594
},
9695
"udp-logger": {
97-
type: PluginType.logging
96+
type: PluginType.observability
9897
},
9998
"zipkin": {
10099
type: PluginType.observability
@@ -104,7 +103,7 @@ export const PLUGIN_LIST = {
104103
hidden: true
105104
},
106105
"log-rotate": {
107-
type: PluginType.logging,
106+
type: PluginType.observability,
108107
hidden: true
109108
},
110109
"serverless-pre-function": {
@@ -166,16 +165,16 @@ export const PLUGIN_LIST = {
166165
type: PluginType.other
167166
},
168167
"http-logger": {
169-
type: PluginType.logging
168+
type: PluginType.observability
170169
},
171170
"openid-connect": {
172171
type: PluginType.authentication
173172
},
174173
"sls-logger": {
175-
type: PluginType.logging
174+
type: PluginType.observability
176175
},
177176
"tcp-logger": {
178-
type: PluginType.logging
177+
type: PluginType.observability
179178
},
180179
"uri-blocker": {
181180
type: PluginType.security

web/src/components/Plugin/locales/en-US.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export default {
2828
'component.plugin.traffic': 'Traffic Control',
2929
'component.plugin.serverless': 'Serverless',
3030
'component.plugin.observability': 'Tracing & Metrics & Logging',
31-
'component.plugin.logging': 'Logging',
3231
'component.plugin.other': 'Other',
3332

3433
// cors

web/src/components/Plugin/locales/zh-CN.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export default {
2828
'component.plugin.traffic': '流量控制',
2929
'component.plugin.serverless': '无服务器架构',
3030
'component.plugin.observability': '可观测性',
31-
'component.plugin.logging': '日志记录',
3231
'component.plugin.other': '其它',
3332

3433
// cors

web/src/components/RightContent/AvatarDropdown.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ export type GlobalHeaderRightProps = {
3434
menu?: boolean;
3535
};
3636

37-
/**
38-
* 退出登录,并且将当前的 url 保存
39-
*/
4037
const settings = async () => {
4138
history.replace({
4239
pathname: '/settings',

web/src/components/Upstream/UpstreamForm.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import React, { useState, forwardRef, useImperativeHandle, useEffect } from 'rea
1919
import { useIntl } from 'umi';
2020
import type { FormInstance } from 'antd/es/form';
2121

22-
import { PanelSection } from '@api7-dashboard/ui';
22+
import PanelSection from '@/components/PanelSection';
2323
import { transformRequest } from '@/pages/Upstream/transform';
2424
import PassiveCheck from './components/passive-check';
2525
import ActiveCheck from './components/active-check'
@@ -96,8 +96,6 @@ const UpstreamForm: React.FC<Props> = forwardRef(
9696
const targetData = list.find((item) => item.id === upstream_id) as UpstreamComponent.ResponseData
9797
if (targetData) {
9898
form.setFieldsValue(transformUpstreamDataFromRequest(targetData));
99-
} else {
100-
// TODO: 提示 upstream_id 找不到想要的数据
10199
}
102100
});
103101
}

web/src/components/Upstream/components/TLS.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ const TLSComponent: React.FC<Props> = ({ form, readonly }) => {
6969
required
7070
rules={[{ required: true, message: "" }, { max: 64 * 1024 }, { min: 128 }]}
7171
>
72-
<Input.TextArea disabled={readonly} minLength={128} maxLength={64 * 1024} rows={5} placeholder="请输入客户端证书" />
72+
<Input.TextArea disabled={readonly} minLength={128} maxLength={64 * 1024} rows={5} placeholder={formatMessage({id: 'component.upstream.fields.tls.client_cert.required'})} />
7373
</Form.Item>
7474
<Form.Item
7575
label={formatMessage({ id: 'component.upstream.fields.tls.client_key' })}
7676
name={["tls", "client_key"]}
7777
required
7878
rules={[{ required: true, message: "" }, { max: 64 * 1024 }, { min: 128 }]}
7979
>
80-
<Input.TextArea disabled={readonly} minLength={128} maxLength={64 * 1024} rows={5} placeholder="请输入客户端私钥" />
80+
<Input.TextArea disabled={readonly} minLength={128} maxLength={64 * 1024} rows={5} placeholder={formatMessage({id: 'component.upstream.fields.tls.client_key.required'})} />
8181
</Form.Item>
8282
</React.Fragment>
8383
)

web/src/components/Upstream/components/passive-check/Type.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const options = [
3535
}
3636
]
3737

38-
const ActiveCheckTypeComponent: React.FC<Props> = ({ readonly }) => {
38+
const PassiveCheckTypeComponent: React.FC<Props> = ({ readonly }) => {
3939
const { formatMessage } = useIntl()
4040

4141
return (
@@ -66,4 +66,4 @@ const ActiveCheckTypeComponent: React.FC<Props> = ({ readonly }) => {
6666
)
6767
}
6868

69-
export default ActiveCheckTypeComponent
69+
export default PassiveCheckTypeComponent

0 commit comments

Comments
 (0)