You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/06/04 00:27:16 UTC

[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #238: add: redirect

juzhiyuan commented on a change in pull request #238:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/238#discussion_r434926658



##########
File path: src/pages/Routes/components/Step1/RequestConfigView.tsx
##########
@@ -139,6 +142,38 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
       >
         <Checkbox.Group options={HTTP_METHOD_OPTION_LIST} disabled={disabled} />
       </Form.Item>
+      <Form.Item label="redirect" name="redirect" valuePropName="checked">
+        <Switch disabled={disabled} />
+      </Form.Item>
+      {step1Data.redirect && (
+        <>
+          <Form.Item label="强制 HTTPS" valuePropName="checked" name="forceHttps">
+            <Switch disabled={disabled || step1Data.protocols.includes('HTTPS')} />
+          </Form.Item>
+          {!step1Data.forceHttps && (
+            <Form.Item label="自定义参数" required>
+              <Row gutter={10}>
+                <Col>
+                  <Form.Item
+                    name="redirectURI"
+                    rules={[{ required: true, message: '请勾选输入 URI' }]}
+                  >
+                    <Input placeholder="请输入 URI" disabled={disabled} />
+                  </Form.Item>
+                </Col>
+                <Col span={6}>
+                  <Form.Item name="redirectCode" rules={[{ required: true, message: '请选择' }]}>

Review comment:
       ,

##########
File path: src/pages/Routes/constants.ts
##########
@@ -26,10 +26,13 @@ export const FORM_ITEM_WITHOUT_LABEL = {
 
 export const DEFAULT_STEP_1_DATA: RouteModule.Step1Data = {
   name: '',
+  desc: '',
   protocols: ['http', 'https'],
   websocket: false,
   hosts: [''],
   paths: [],
+  redirect: false,

Review comment:
       ,

##########
File path: src/pages/Routes/components/Step1/RequestConfigView.tsx
##########
@@ -139,6 +142,38 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
       >
         <Checkbox.Group options={HTTP_METHOD_OPTION_LIST} disabled={disabled} />
       </Form.Item>
+      <Form.Item label="redirect" name="redirect" valuePropName="checked">
+        <Switch disabled={disabled} />
+      </Form.Item>
+      {step1Data.redirect && (
+        <>
+          <Form.Item label="强制 HTTPS" valuePropName="checked" name="forceHttps">
+            <Switch disabled={disabled || step1Data.protocols.includes('HTTPS')} />
+          </Form.Item>
+          {!step1Data.forceHttps && (
+            <Form.Item label="自定义参数" required>
+              <Row gutter={10}>
+                <Col>
+                  <Form.Item
+                    name="redirectURI"
+                    rules={[{ required: true, message: '请勾选输入 URI' }]}

Review comment:
       ,




----------------------------------------------------------------
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:
users@infra.apache.org