Skip to content

Commit

Permalink
fix: update refer to view
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxiran committed Dec 11, 2020
1 parent b566cfe commit e37bf4e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ const AuthenticationView: React.FC<RouteModule.DebugViewProps> = (props) => {
props.form.setFieldsValue({ autyType: currentValue });
}}
>
<Radio value="none">none</Radio>
{AUTH_LIST.map((type) => (
<Radio value={type}>{type}</Radio>
<Radio value="none">None</Radio>
{AUTH_LIST.map((type,index) => (
<Radio key={`${type}_${index}`} value={type}>{type}</Radio>
))}
</Radio.Group>
</Form.Item>
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/Route/components/DebugViews/DebugDrawView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ const DebugDrawView: React.FC<RouteModule.DebugDrawProps> = (props) => {
}}
size="large"
>
{HTTP_METHOD_OPTION_LIST.map((method) => {
return <Option value={method}>{method}</Option>;
{HTTP_METHOD_OPTION_LIST.map((method, index) => {
return <Option key={`${method}_${index}`} value={method}>{method}</Option>;
})}
</Select>
<Search
Expand Down
13 changes: 7 additions & 6 deletions web/src/pages/Route/components/DebugViews/DebugParamsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ const DebugParamsView: React.FC<RouteModule.DebugViewProps> = (props) => {
<>
{fields.map((field, index) => (
<Row gutter={16}>
<Col span={1}>
<Col span={1} key={`col_${field.name}_${index}`}>
<Form.Item
name={[field.name, 'check']}
style={{ textAlign: 'right' }}
valuePropName="checked"
key={`formitem_${field.name}_${index}`}
>
{fields.length > 1 && index !== fields.length - 1 && <Checkbox />}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name={[field.name, 'key']}>
<Col span={8} key={`col_${field.name}_${index}`}>
<Form.Item name={[field.name, 'key']} key={`formitem_${field.name}_${index}`}>
<Input
placeholder={formatMessage({ id: 'page.route.input.placeholder.paramKey' })}
onChange={() => {
Expand All @@ -58,16 +59,16 @@ const DebugParamsView: React.FC<RouteModule.DebugViewProps> = (props) => {
/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name={[field.name, 'value']}>
<Col span={8} key={`col_${field.name}_${index}`}>
<Form.Item name={[field.name, 'value']} key={`formitem_${field.name}_${index}`}>
<Input
placeholder={formatMessage({
id: 'page.route.input.placeholder.paramValue',
})}
/>
</Form.Item>
</Col>
<Col>
<Col key={`col_${field.name}_${index}`}>
{fields.length > 1 && index !== fields.length - 1 && (
<MinusCircleOutlined onClick={() => remove(field.name)} />
)}
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/Route/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export const checkHostWithSSL = (hosts: string[]) =>
data: hosts,
});

export const debugRoute = (params: RouteModule.debugRequest) => {
export const debugRoute = (data: RouteModule.debugRequest) => {
return request('/debug-request-forwarding', {
method: 'post',
data: { ...params },
data,
});
};

0 comments on commit e37bf4e

Please sign in to comment.