Skip to content

Commit

Permalink
refactoring and better qrep page
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Nov 6, 2023
1 parent f02e916 commit fabf7ea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
29 changes: 9 additions & 20 deletions ui/app/mirrors/edit/[mirrorId]/syncStatusTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,15 @@ export const SyncStatusTable = ({ rows }: SyncStatusTableProps) => {
}}
header={
<TableRow>
<TableCell as='th'>
<Label as='label' style={{ fontWeight: 'bold' }}>
Batch ID
</Label>
</TableCell>
<TableCell as='th'>
<Label as='label' style={{ fontWeight: 'bold' }}>
Start Time
</Label>
</TableCell>
<TableCell as='th'>
<Label as='label' style={{ fontWeight: 'bold' }}>
End Time (Duration)
</Label>
</TableCell>
<TableCell as='th'>
<Label as='label' style={{ fontWeight: 'bold' }}>
Num Rows Synced
</Label>
</TableCell>
{['Batch ID', 'Start Time', 'End Time (Duration)', 'Rows Synced'].map(
(heading, index) => (
<TableCell as='th' key={index}>
<Label as='label' style={{ fontWeight: 'bold' }}>
{heading}
</Label>
</TableCell>
)
)}
</TableRow>
}
>
Expand Down
32 changes: 17 additions & 15 deletions ui/app/mirrors/status/qrep/[mirrorId]/qrepStatusTable.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import SearchBar from '@/components/Search';
import TimeLabel from '@/components/TimeComponent';
import { Button } from '@/lib/Button';
import { Checkbox } from '@/lib/Checkbox';
import { Icon } from '@/lib/Icon';
import { Label } from '@/lib/Label';
import { ProgressCircle } from '@/lib/ProgressCircle';
Expand All @@ -23,7 +23,7 @@ function TimeOrProgressBar({ time }: { time: Date | null }) {
if (time === null) {
return <ProgressCircle variant='determinate_progress_circle' />;
} else {
return <Label>{moment(time)?.format('YYYY-MM-DD HH:mm:ss')}</Label>;
return <TimeLabel timeVal={moment(time)?.format('YYYY-MM-DD HH:mm:ss')} />;
}
}

Expand All @@ -44,9 +44,6 @@ function RowPerPartition({

return (
<TableRow key={partitionId}>
<TableCell variant='button'>
<Checkbox />
</TableCell>
<TableCell>
<Label>{partitionId}</Label>
</TableCell>
Expand All @@ -57,7 +54,7 @@ function RowPerPartition({
<Label>{duration}</Label>
</TableCell>
<TableCell>
<Label>{moment(startTime)?.format('YYYY-MM-DD HH:mm:ss')}</Label>
<TimeLabel timeVal={moment(startTime)?.format('YYYY-MM-DD HH:mm:ss')} />
</TableCell>
<TableCell>
<Label>
Expand Down Expand Up @@ -154,15 +151,20 @@ export default function QRepStatusTable({
}}
header={
<TableRow>
<TableCell as='th' variant='button'>
<Checkbox variant='mixed' defaultChecked />
</TableCell>
<TableCell as='th'>Partition UUID</TableCell>
<TableCell as='th'>Run UUID</TableCell>
<TableCell as='th'>Duration</TableCell>
<TableCell as='th'>Start Time</TableCell>
<TableCell as='th'>End Time</TableCell>
<TableCell as='th'>Num Rows Synced</TableCell>
{[
'Partition UUID',
'Run UUID',
'Duration',
'Start Time',
'End Time',
'Num Rows Synced',
].map((heading, index) => (
<TableCell as='th' key={index}>
<Label as='label' style={{ fontWeight: 'bold' }}>
{heading}
</Label>
</TableCell>
))}
</TableRow>
}
>
Expand Down

0 comments on commit fabf7ea

Please sign in to comment.