juzhiyuan commented on a change in pull request #1201:
URL: https://github.com/apache/apisix-dashboard/pull/1201#discussion_r552286684
##########
File path: web/src/pages/Route/components/DebugViews/DebugDrawView.tsx
##########
@@ -233,7 +258,54 @@ const DebugDrawView: React.FC<RouteModule.DebugDrawProps>
= (props) => {
</TabPane>
{showBodyTab && (
<TabPane tab={formatMessage({ id:
'page.route.TabPane.bodyParams' })} key="body">
- <DebugParamsView form={bodyForm} />
+ <Radio.Group onChange={(e) => {setBodyType(e.target.value)}}
value={bodyType}>
+ <Radio value="none">None</Radio>
+ {
+ DEBUG_BODY_TYPE_SUPPORTED.map((type) => (
+ <Radio value={type} key={type}>{type}</Radio>
+ ))
+ }
+ </Radio.Group>
+ {bodyType === 'raw input' && <Select
Review comment:
aha, `enum` is useful here :)
##########
File path: web/src/pages/Route/components/DebugViews/DebugDrawView.tsx
##########
@@ -48,32 +50,55 @@ const DebugDrawView: React.FC<RouteModule.DebugDrawProps> =
(props) => {
const [responseCode, setResponseCode] = useState<string>();
const [loading, setLoading] = useState(false);
const [codeMirrorHeight, setCodeMirrorHeight] = useState<number |
string>(50);
+ const bodyCodeMirrorRef = useRef<any>(null);
+ const [bodyType, setBodyType] = useState('none');
const methodWithoutBody = ['GET', 'HEAD'];
+ const [bodyCodeMirrorMode, setBodyCodeMirrorMode] =
useState(DEBUG_BODY_CODEMIRROR_MODE_SUPPORTED[0].mode)
const resetForms = () => {
queryForm.setFieldsValue(DEFAULT_DEBUG_PARAM_FORM_DATA);
bodyForm.setFieldsValue(DEFAULT_DEBUG_PARAM_FORM_DATA);
headerForm.setFieldsValue(DEFAULT_DEBUG_PARAM_FORM_DATA);
authForm.setFieldsValue(DEFAULT_DEBUG_AUTH_FORM_DATA);
setResponseCode(`${formatMessage({ id:
'page.route.debug.showResultAfterSendRequest' })}`);
+ setBodyType('none');
Review comment:
would better use `enum` for a clear description
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]