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/05/19 12:10:21 UTC

[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #196: feat: add search feature

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



##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -46,11 +53,13 @@ const List: React.FC = () => {
     // TODO: need to check api response
     {
       title: '关联路由',

Review comment:
       just removed it, we don't have API support for it now.

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -1,16 +1,22 @@
-import React, { useRef } from 'react';
+import React, { useRef, useState } from 'react';
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
 import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
 import { Button, Modal, notification, Switch } from 'antd';
 import { history, useIntl } from 'umi';
 import { PlusOutlined } from '@ant-design/icons';
-
 import { fetchList as fetchSSLList, remove as removeSSL } from '@/services/ssl';
 import { SSL } from '@/models/ssl';
 import { ListItem } from '@/transforms/global';
 
+interface SearchParamsProps {
+  current: number | undefined;

Review comment:
       undefined?

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -1,16 +1,22 @@
-import React, { useRef } from 'react';
+import React, { useRef, useState } from 'react';
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
 import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
 import { Button, Modal, notification, Switch } from 'antd';
 import { history, useIntl } from 'umi';
 import { PlusOutlined } from '@ant-design/icons';
-
 import { fetchList as fetchSSLList, remove as removeSSL } from '@/services/ssl';
 import { SSL } from '@/models/ssl';
 import { ListItem } from '@/transforms/global';
 
+interface SearchParamsProps {
+  current: number | undefined;
+  pageSize: number | undefined;
+  'value-sni': string;

Review comment:
       🤔not a good practice...

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -46,11 +53,13 @@ const List: React.FC = () => {
     // TODO: need to check api response
     {
       title: '关联路由',
-      dataIndex: [],
+      dataIndex: 'relatedRouting',
+      hideInSearch: true,
     },
     {
       title: '过期时间',
-      dataIndex: [],
+      dataIndex: 'expireTime',

Review comment:
       🤔Please use `expiredAt` or `expiredTime` or `notAfter`, should have a consensus with APISIX.

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -46,11 +53,13 @@ const List: React.FC = () => {
     // TODO: need to check api response
     {
       title: '关联路由',
-      dataIndex: [],
+      dataIndex: 'relatedRouting',
+      hideInSearch: true,
     },
     {
       title: '过期时间',
-      dataIndex: [],
+      dataIndex: 'expireTime',

Review comment:
       🤔Please use `expiredAt` or `expiredTime` or `notAfter`, should have a consensus with APISIX.

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -74,11 +83,26 @@ const List: React.FC = () => {
     },
   ];
 
+  const fetchPageSSLList = (params: Partial<SearchParamsProps> | undefined) => {
+    if (list.length) {
+      const result = list.filter((_item) => {
+        if (params?.['value-sni']) {
+          return _item.value.sni.includes(params?.['value-sni']);

Review comment:
       if `params?.['value-sni']` doesn't exist, then `includes` method would return false.

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -74,11 +83,26 @@ const List: React.FC = () => {
     },
   ];
 
+  const fetchPageSSLList = (params: Partial<SearchParamsProps> | undefined) => {
+    if (list.length) {
+      const result = list.filter((_item) => {

Review comment:
       shadowed item?

##########
File path: src/pages/SSLModule/list/index.tsx
##########
@@ -74,11 +83,26 @@ const List: React.FC = () => {
     },
   ];
 
+  const fetchPageSSLList = (params: Partial<SearchParamsProps> | undefined) => {
+    if (list.length) {
+      const result = list.filter((_item) => {
+        if (params?.['value-sni']) {

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