From 4d26409e9f7819e20a65ff7ab5b877dedca82cdf Mon Sep 17 00:00:00 2001 From: incubator4 Date: Sat, 4 Feb 2023 23:35:08 +0800 Subject: [PATCH] fix plugins display in list of routes (#2704) Co-authored-by: litesun --- 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 63de96ed38..cbacd4f259 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) => {key}) + : '-'; + }, }, ]; diff --git a/web/src/pages/Route/typing.d.ts b/web/src/pages/Route/typing.d.ts index 64c4bb723a..234fc9feb4 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; }; type RouteStatus = 0 | 1;