diff --git a/src/components/ConnectionsTableOrderingModal.tsx b/src/components/ConnectionsTableOrderingModal.tsx
index fbbf84f6..63683ac3 100644
--- a/src/components/ConnectionsTableOrderingModal.tsx
+++ b/src/components/ConnectionsTableOrderingModal.tsx
@@ -95,41 +95,40 @@ export const ConnectionsTableOrderingModal = (props: {
}
return (
- <>
-
-
-
-
-
-
-
- {(key) => }
-
-
-
-
- {t(activeKey()!)}
-
-
-
+
+
+
+
+
+
+ {(key) => }
+
+
+
+
+ {t(activeKey()!)}
+
+
+
-
{
- props.onOrderChange(CONNECTIONS_TABLE_INITIAL_COLUMN_ORDER)
- props.onVisibleChange(CONNECTIONS_TABLE_INITIAL_COLUMN_VISIBILITY)
- }}
- >
- {t('reset')}
-
-
-
-
+ {
+ props.onOrderChange(CONNECTIONS_TABLE_INITIAL_COLUMN_ORDER)
+ props.onVisibleChange(CONNECTIONS_TABLE_INITIAL_COLUMN_VISIBILITY)
+ }}
+ >
+ {t('reset')}
+
- >
+
+
+
)
}
diff --git a/src/constants/index.ts b/src/constants/index.ts
index 22f78de8..07187e84 100644
--- a/src/constants/index.ts
+++ b/src/constants/index.ts
@@ -110,6 +110,7 @@ export enum LANG {
}
export enum CONNECTIONS_TABLE_ACCESSOR_KEY {
+ Details = 'details',
Close = 'close',
ID = 'ID',
Type = 'type',
diff --git a/src/i18n/en.ts b/src/i18n/en.ts
index 6400d92c..43858d18 100644
--- a/src/i18n/en.ts
+++ b/src/i18n/en.ts
@@ -74,4 +74,5 @@ export default {
all: 'All',
sequence: 'Sequence',
payload: 'Payload',
+ details: 'Details',
}
diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts
index 77df36f3..3bf5a257 100644
--- a/src/i18n/zh.ts
+++ b/src/i18n/zh.ts
@@ -73,4 +73,5 @@ export default {
all: '全部',
sequence: '序列号',
payload: '内容',
+ details: '详情',
}
diff --git a/src/pages/Connections.tsx b/src/pages/Connections.tsx
index 58e63fe6..f7fd5cec 100644
--- a/src/pages/Connections.tsx
+++ b/src/pages/Connections.tsx
@@ -3,6 +3,7 @@ import { useI18n } from '@solid-primitives/i18n'
import { makePersisted } from '@solid-primitives/storage'
import {
IconCircleX,
+ IconInfoCircle,
IconPlayerPause,
IconPlayerPlay,
IconSettings,
@@ -25,7 +26,7 @@ import {
} from '@tanstack/solid-table'
import byteSize from 'byte-size'
import dayjs from 'dayjs'
-import { For, createMemo, createSignal } from 'solid-js'
+import { Component, For, Show, createMemo, createSignal } from 'solid-js'
import { twMerge } from 'tailwind-merge'
import { Button, ConnectionsTableOrderingModal } from '~/components'
import {
@@ -35,6 +36,7 @@ import {
} from '~/constants'
import { formatTimeFromNow } from '~/helpers'
import {
+ allConnections,
tableSize,
tableSizeClassName,
useConnections,
@@ -50,6 +52,34 @@ enum ActiveTab {
closedConnections = 'closedConnections',
}
+const ConnectionDetailsModal: Component<{
+ selectedConnectionID?: string
+}> = (props) => {
+ return (
+
+
+
+
+
+ {JSON.stringify(
+ allConnections.find(
+ ({ id }) => id === props.selectedConnectionID,
+ ),
+ null,
+ 2,
+ )}
+
+
+
+
+
+
+
+ )
+}
+
export default () => {
const [t] = useI18n()
const request = useRequest()
@@ -75,7 +105,33 @@ export default () => {
},
)
+ const [selectedConnectionID, setSelectedConnectionID] = createSignal
()
+
const columns = createMemo[]>(() => [
+ {
+ header: () => t('details'),
+ enableGrouping: false,
+ enableSorting: false,
+ accessorKey: CONNECTIONS_TABLE_ACCESSOR_KEY.Details,
+ cell: ({ row }) => (
+
+ {
+ setSelectedConnectionID(row.original.id)
+
+ const modal = document.querySelector(
+ '#connections-table-details-modal',
+ ) as HTMLDialogElement | null
+
+ modal?.showModal()
+ }}
+ >
+
+
+
+ ),
+ },
{
header: () => t('close'),
enableGrouping: false,
@@ -293,21 +349,19 @@ export default () => {
-
+ {
+ const modal = document.querySelector(
+ '#connections-table-ordering-modal',
+ ) as HTMLDialogElement | null
+
+ modal?.showModal()
+ }}
+ >
-
+
-
-