guoqqqi commented on a change in pull request #1971: URL: https://github.com/apache/apisix-dashboard/pull/1971#discussion_r667315919
########## File path: web/src/components/Plugin/UI/request-id.tsx ########## @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import React from 'react'; +import type { FormInstance } from 'antd/es/form'; +import { Form, Input, Switch } from 'antd'; +import { useIntl } from 'umi'; + +type Props = { + form: FormInstance; +}; + +const FORM_ITEM_LAYOUT = { + labelCol: { + span: 7, + }, + wrapperCol: { + span: 18 + }, +}; + +const RequestId: React.FC<Props> = ({ form }) => { + const { formatMessage } = useIntl(); + return ( + <Form + form={form} + {...FORM_ITEM_LAYOUT} + > + <Form.Item + label="header_name" + name="header_name" + initialValue="X-Request-Id" + rules={[{ + message: `${formatMessage({ id: 'component.global.pleaseEnter' })} header_name` + }]} + tooltip={formatMessage({ id: 'component.pluginForm.request-id.heade_name.tooltip' })} Review comment: ```suggestion tooltip={formatMessage({ id: 'component.pluginForm.request-id.header_name.tooltip' })} ``` ########## File path: web/src/components/Plugin/locales/en-US.ts ########## @@ -89,4 +89,8 @@ export default { 'component.pluginForm.limit-count.redis_cluster_nodes.tooltip': 'When using redis-cluster policy,This property is a list of addresses of Redis cluster service nodes (at least two nodes).', 'component.pluginForm.limit-count.redis_cluster_name.tooltip': 'When using redis-cluster policy, this property is the name of Redis cluster service nodes.', 'component.pluginForm.limit-count.atLeast2Characters.rule': 'Please enter at least 2 characters', + + // request-id + 'component.pluginForm.request-id.header_name.tooltip': 'Request ID header name', Review comment: Please keep the key consistent -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
