From 1ba7700a3f7f72e0b778a1b4af083231e1d6790c Mon Sep 17 00:00:00 2001 From: TossPig Date: Tue, 31 Oct 2023 01:50:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(connection):=20=E6=B7=BB=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=AB=99=E7=94=A8=E6=88=B7=E5=88=97=20(#437)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/index.ts | 1 + src/i18n/en.ts | 1 + src/i18n/zh.ts | 1 + src/pages/Connections.tsx | 8 ++++++++ 4 files changed, 11 insertions(+) diff --git a/src/constants/index.ts b/src/constants/index.ts index 9e81b53..6b82fd0 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -126,6 +126,7 @@ export enum CONNECTIONS_TABLE_ACCESSOR_KEY { SourceIP = 'sourceIP', SourcePort = 'sourcePort', Destination = 'destination', + InboundUser = 'inboundUser', } export const CONNECTIONS_TABLE_MAX_CLOSED_ROWS = 200 diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 6e59942..e0f3fe7 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -38,6 +38,7 @@ export default { sourceIP: 'Source IP', sourcePort: 'Source Port', destination: 'Destination', + inboundUser: 'Inbound User', close: 'Close', reset: 'Reset', dnsQuery: 'DNS Query', diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index 7a2c23b..f944657 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -40,6 +40,7 @@ export default { sourceIP: '源地址', sourcePort: '源端口', destination: '目标地址', + inboundUser: '入站用户', close: '关闭', reset: '重置', dnsQuery: 'DNS 查询', diff --git a/src/pages/Connections.tsx b/src/pages/Connections.tsx index 0ea1112..09f6f0c 100644 --- a/src/pages/Connections.tsx +++ b/src/pages/Connections.tsx @@ -242,6 +242,14 @@ export default () => { original.metadata.destinationIP || original.metadata.host, }, + { + header: () => t('inboundUser'), + accessorKey: CONNECTIONS_TABLE_ACCESSOR_KEY.InboundUser, + accessorFn: (original) => + original.metadata.inboundUser || + original.metadata.inboundName || + original.metadata.inboundPort, + }, ] const [grouping, setGrouping] = createSignal([])