Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some UI cleanup #779

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ui/app/dto/MirrorsDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ export type TableMapRow = {
exclude: string[];
selected: boolean;
};

export type SyncStatusRow = {
batchId: bigint;
startTime: Date;
endTime: Date | null;
numRows: number;
};
8 changes: 1 addition & 7 deletions ui/app/mirrors/edit/[mirrorId]/cdc.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { SyncStatusRow } from '@/app/dto/MirrorsDTO';
import TimeLabel from '@/components/TimeComponent';
import {
CDCMirrorStatus,
Expand Down Expand Up @@ -272,13 +273,6 @@ const Trigger = styled(
}
`;

type SyncStatusRow = {
batchId: number;
startTime: Date;
endTime: Date | null;
numRows: number;
};

type CDCMirrorStatusProps = {
cdc: CDCMirrorStatus;
rows: SyncStatusRow[];
Expand Down
8 changes: 1 addition & 7 deletions ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';
import { SyncStatusRow } from '@/app/dto/MirrorsDTO';
import MirrorInfo from '@/components/MirrorInfo';
import PeerButton from '@/components/PeerComponent';
import TimeLabel from '@/components/TimeComponent';
Expand All @@ -11,13 +12,6 @@ import moment from 'moment';
import MirrorValues from './configValues';
import TablePairs from './tablePairs';

type SyncStatusRow = {
batchId: number;
startTime: Date;
endTime: Date | null;
numRows: number;
};

type props = {
syncs: SyncStatusRow[];
mirrorConfig: FlowConnectionConfigs | undefined;
Expand Down
8 changes: 1 addition & 7 deletions ui/app/mirrors/edit/[mirrorId]/cdcGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
'use client';
import { SyncStatusRow } from '@/app/dto/MirrorsDTO';
import { formatGraphLabel, timeOptions } from '@/app/utils/graph';
import { Label } from '@/lib/Label';
import { BarChart } from '@tremor/react';
import { useEffect, useState } from 'react';
import ReactSelect from 'react-select';
import aggregateCountsByInterval from './aggregatedCountsByInterval';

type SyncStatusRow = {
batchId: number;
startTime: Date;
endTime: Date | null;
numRows: number;
};

function CdcGraph({ syncs }: { syncs: SyncStatusRow[] }) {
let [aggregateType, setAggregateType] = useState('hour');
const initialCount: [string, number][] = [];
Expand Down
2 changes: 1 addition & 1 deletion ui/app/mirrors/edit/[mirrorId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default async function EditMirror({
}

const rows = syncs.map((sync) => ({
batchId: sync.id,
batchId: sync.batch_id,
startTime: sync.start_time,
endTime: sync.end_time,
numRows: sync.rows_in_batch,
Expand Down
2 changes: 1 addition & 1 deletion ui/app/mirrors/edit/[mirrorId]/syncStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default async function SyncStatus({
});

const rows = syncs.map((sync) => ({
batchId: sync.id,
batchId: sync.batch_id,
startTime: sync.start_time,
endTime: sync.end_time,
numRows: sync.rows_in_batch,
Expand Down
7 changes: 1 addition & 6 deletions ui/app/mirrors/edit/[mirrorId]/syncStatusTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { SyncStatusRow } from '@/app/dto/MirrorsDTO';
import TimeLabel from '@/components/TimeComponent';
import { Button } from '@/lib/Button';
import { Icon } from '@/lib/Icon';
Expand All @@ -10,12 +11,6 @@ import { Table, TableCell, TableRow } from '@/lib/Table';
import moment from 'moment';
import { useMemo, useState } from 'react';
import ReactSelect from 'react-select';
type SyncStatusRow = {
batchId: number;
startTime: Date;
endTime: Date | null;
numRows: number;
};

type SyncStatusTableProps = {
rows: SyncStatusRow[];
Expand Down
5 changes: 3 additions & 2 deletions ui/app/mirrors/status/qrep/[mirrorId]/qrepConfigViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import prisma from '@/app/utils/prisma';
import { QRepConfig } from '@/grpc_generated/flow';
import { Badge } from '@/lib/Badge';
import { Icon } from '@/lib/Icon';
import { Label } from '@/lib/Label';
import { ProgressCircle } from '@/lib/ProgressCircle';

export const dynamic = 'force-dynamic';
Expand All @@ -27,9 +28,9 @@ export default async function QRepConfigViewer({

if (!configBuffer?.config_proto) {
return (
<div>
<div className='m-4' style={{ display: 'flex', alignItems: 'center' }}>
<ProgressCircle variant='determinate_progress_circle' />
Waiting for mirror to start...
<Label>Waiting for mirror to start...</Label>
</div>
);
}
Expand Down
Loading