This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d26409e9 fix plugins display in list of routes (#2704)
4d26409e9 is described below

commit 4d26409e9f7819e20a65ff7ab5b877dedca82cdf
Author: incubator4 <aries0ro...@gmail.com>
AuthorDate: Sat Feb 4 23:35:08 2023 +0800

    fix plugins display in list of routes (#2704)
    
    Co-authored-by: litesun <su...@apache.org>
---
 web/src/pages/Route/List.tsx    | 8 ++++++++
 web/src/pages/Route/typing.d.ts | 1 +
 2 files changed, 9 insertions(+)

diff --git a/web/src/pages/Route/List.tsx b/web/src/pages/Route/List.tsx
index 63de96ed3..cbacd4f25 100755
--- a/web/src/pages/Route/List.tsx
+++ b/web/src/pages/Route/List.tsx
@@ -368,6 +368,7 @@ const Page: React.FC = () => {
     {
       title: formatMessage({ id: 'component.global.labels' }),
       dataIndex: 'labels',
+      width: 240,
       render: (_, record) => {
         return Object.keys(record.labels || {})
           .filter((item) => item !== 'API_VERSION')
@@ -550,6 +551,13 @@ const Page: React.FC = () => {
     {
       title: formatMessage({ id: 'menu.plugin' }),
       dataIndex: 'plugins',
+      width: 240,
+      render: (_, record) => {
+        const plugins = record.plugins || {};
+        return Object.keys(plugins).length > 0
+          ? Object.keys(plugins).map((key) => <Tag key={key}>{key}</Tag>)
+          : '-';
+      },
     },
   ];
 
diff --git a/web/src/pages/Route/typing.d.ts b/web/src/pages/Route/typing.d.ts
index 64c4bb723..234fc9feb 100644
--- a/web/src/pages/Route/typing.d.ts
+++ b/web/src/pages/Route/typing.d.ts
@@ -214,6 +214,7 @@ declare namespace RouteModule {
     create_time: number;
     update_time: number;
     status: number;
+    plugins: Record<string, any>;
   };
 
   type RouteStatus = 0 | 1;

Reply via email to