diff --git a/ui/app/alert-config/page.tsx b/ui/app/alert-config/page.tsx index 7109efdb3e..16fce85f0f 100644 --- a/ui/app/alert-config/page.tsx +++ b/ui/app/alert-config/page.tsx @@ -22,7 +22,7 @@ const options: editor.IStandaloneEditorConstructionOptions = { scrollBeyondLastLine: false, }; -const ConfigJSONView = ({ config }: { config: string }) => { +export const ConfigJSONView = ({ config }: { config: string }) => { return ; }; diff --git a/ui/app/peers/[peerName]/omitKeys.ts b/ui/app/peers/[peerName]/omitKeys.ts new file mode 100644 index 0000000000..e87f1501ca --- /dev/null +++ b/ui/app/peers/[peerName]/omitKeys.ts @@ -0,0 +1,11 @@ +// sensitive keys +const omitKeys = [ + 'privateKey', // snowflake and bigquery + 'password', // postgres, metadatadb for non-dwh peers, snowflake + 'secretAccessKey', // s3/gcs + 'subscriptionId', // eventhub + 'privateKeyId', // bigquery + 'type', // peer type +]; + +export default omitKeys; diff --git a/ui/app/peers/[peerName]/page.tsx b/ui/app/peers/[peerName]/page.tsx index 61573365d5..5490ca99e6 100644 --- a/ui/app/peers/[peerName]/page.tsx +++ b/ui/app/peers/[peerName]/page.tsx @@ -2,7 +2,7 @@ import ReloadButton from '@/components/ReloadButton'; import { PeerSlotResponse, PeerStatResponse } from '@/grpc_generated/route'; import { Label } from '@/lib/Label'; import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; -import Link from 'next/link'; +import PeerDetails from './peerDetails'; import SlotTable from './slottable'; import StatTable from './stattable'; @@ -61,35 +61,22 @@ const PeerData = async ({ params: { peerName } }: DataConfigProps) => {
{peerName}
+ {slots && stats ? ( -
+
) : ( -
- We do not have stats to show for this peer at the moment. Please check - if your PostgreSQL peer is open for connections. Note that peer - replication slot information and stat activity is currently only - supported for PostgreSQL peers. +
+
)} diff --git a/ui/app/peers/[peerName]/peerDetails.tsx b/ui/app/peers/[peerName]/peerDetails.tsx new file mode 100644 index 0000000000..834c171b9a --- /dev/null +++ b/ui/app/peers/[peerName]/peerDetails.tsx @@ -0,0 +1,58 @@ +import { ConfigJSONView } from '@/app/alert-config/page'; +import { getTruePeer } from '@/app/api/peers/getTruePeer'; +import prisma from '@/app/utils/prisma'; +import { Label } from '@/lib/Label'; +import omitKeys from './omitKeys'; + +interface PeerDetailsProps { + peerName: string; +} + +const PeerDetails = async ({ peerName }: PeerDetailsProps) => { + const peer = await prisma.peers.findFirst({ + where: { + name: peerName, + }, + }); + const peerConfig = getTruePeer(peer!); + + return ( +
+
+
+
+ +
+
+ { + if (omitKeys.includes(key)) { + return undefined; + } + return value; + }, + 2 + )} + /> +
+
+
+
+ ); +}; +export default PeerDetails; diff --git a/ui/app/peers/[peerName]/slottable.tsx b/ui/app/peers/[peerName]/slottable.tsx index 39efae50ab..e78e036a05 100644 --- a/ui/app/peers/[peerName]/slottable.tsx +++ b/ui/app/peers/[peerName]/slottable.tsx @@ -6,7 +6,7 @@ import { tableStyle } from './style'; const SlotTable = ({ data }: { data: SlotInfo[] }) => { return ( -
+