diff --git a/ui/app/mirrors/edit/[mirrorId]/cdc.tsx b/ui/app/mirrors/edit/[mirrorId]/cdc.tsx index d70ba3b4fa..02202922cc 100644 --- a/ui/app/mirrors/edit/[mirrorId]/cdc.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/cdc.tsx @@ -106,7 +106,10 @@ const SnapshotStatusTable = ({ status }: SnapshotStatusProps) => ( - diff --git a/ui/app/mirrors/edit/[mirrorId]/page.tsx b/ui/app/mirrors/edit/[mirrorId]/page.tsx index ce3ccab474..e2c5e6596a 100644 --- a/ui/app/mirrors/edit/[mirrorId]/page.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/page.tsx @@ -2,6 +2,7 @@ import { MirrorStatusResponse } from '@/grpc_generated/route'; import { Header } from '@/lib/Header'; import { LayoutMain } from '@/lib/Layout'; import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; +import { redirect } from 'next/navigation'; import { Suspense } from 'react'; import { CDCMirror } from './cdc'; import SyncStatus from './syncStatus'; @@ -39,6 +40,8 @@ export default async function EditMirror({ let syncStatusChild = <>; if (mirrorStatus.cdcStatus) { syncStatusChild = ; + } else { + redirect(`/mirrors/status/qrep/${mirrorId}`); } return ( diff --git a/ui/app/mirrors/edit/[mirrorId]/syncStatusTable.tsx b/ui/app/mirrors/edit/[mirrorId]/syncStatusTable.tsx index 06abcc67ce..d26ef70a6e 100644 --- a/ui/app/mirrors/edit/[mirrorId]/syncStatusTable.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/syncStatusTable.tsx @@ -76,7 +76,10 @@ export const SyncStatusTable = ({ rows }: SyncStatusTableProps) => { - diff --git a/ui/app/mirrors/page.tsx b/ui/app/mirrors/page.tsx index 6c40108f07..9cbb00035b 100644 --- a/ui/app/mirrors/page.tsx +++ b/ui/app/mirrors/page.tsx @@ -170,7 +170,10 @@ async function QRepFlows() { - + + + Active + ))} diff --git a/ui/app/mirrors/status/qrep/[mirrorId]/page.tsx b/ui/app/mirrors/status/qrep/[mirrorId]/page.tsx index 131d788ee6..a3fed7e0e9 100644 --- a/ui/app/mirrors/status/qrep/[mirrorId]/page.tsx +++ b/ui/app/mirrors/status/qrep/[mirrorId]/page.tsx @@ -1,8 +1,11 @@ import prisma from '@/app/utils/prisma'; import { Header } from '@/lib/Header'; import { LayoutMain } from '@/lib/Layout'; +import QRepConfigViewer from './qrepConfigViewer'; import QRepStatusTable, { QRepPartitionStatus } from './qrepStatusTable'; +export const dynamic = 'force-dynamic'; + type QRepMirrorStatusProps = { params: { mirrorId: string }; }; @@ -37,6 +40,7 @@ export default async function QRepMirrorStatus({ return (
{mirrorId}
+
); diff --git a/ui/app/mirrors/status/qrep/[mirrorId]/qrepConfigViewer.tsx b/ui/app/mirrors/status/qrep/[mirrorId]/qrepConfigViewer.tsx new file mode 100644 index 0000000000..05fffd9570 --- /dev/null +++ b/ui/app/mirrors/status/qrep/[mirrorId]/qrepConfigViewer.tsx @@ -0,0 +1,43 @@ +import prisma from '@/app/utils/prisma'; +import { QRepConfig } from '@/grpc_generated/flow'; +import { Badge } from '@/lib/Badge'; +import { Icon } from '@/lib/Icon'; + +export const dynamic = 'force-dynamic'; + +type QRepConfigViewerProps = { + mirrorId: string; +}; + +export default async function QRepConfigViewer({ + mirrorId, +}: QRepConfigViewerProps) { + const configBuffer = await prisma.qrep_runs.findFirst({ + select: { + config_proto: true, + }, + where: { + flow_name: mirrorId, + config_proto: { + not: null, + }, + }, + }); + + if (!configBuffer?.config_proto) { + return
Config Unavailable
; + } + + let qrepConfig = QRepConfig.decode(configBuffer.config_proto); + + return ( +
+ + +
+ {qrepConfig.initialCopyOnly ? 'Initial Load' : 'Continuous Sync'} +
+
+
+ ); +} diff --git a/ui/app/mirrors/status/qrep/[mirrorId]/qrepStatusTable.tsx b/ui/app/mirrors/status/qrep/[mirrorId]/qrepStatusTable.tsx index c50c145de1..e90038d45c 100644 --- a/ui/app/mirrors/status/qrep/[mirrorId]/qrepStatusTable.tsx +++ b/ui/app/mirrors/status/qrep/[mirrorId]/qrepStatusTable.tsx @@ -117,7 +117,10 @@ export default function QRepStatusTable({ > - -