-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Better postgres peer page (#732)
- Displays connection string for postgres peer - Search bar for query in stats table --------- Co-authored-by: Kaushik Iska <[email protected]>
- Loading branch information
1 parent
2752413
commit ed514f4
Showing
6 changed files
with
241 additions
and
172 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { SlotInfo } from '@/grpc_generated/route'; | ||
import { Label } from '@/lib/Label'; | ||
import { Table, TableCell, TableRow } from '@/lib/Table'; | ||
import { SlotNameDisplay } from './helpers'; | ||
import { tableStyle } from './style'; | ||
|
||
const SlotTable = ({ data }: { data: SlotInfo[] }) => { | ||
return ( | ||
<div style={{ height: '30%', marginTop: '2rem', marginBottom: '1rem' }}> | ||
<Label | ||
as='label' | ||
variant='subheadline' | ||
style={{ marginBottom: '1rem', fontWeight: 'bold' }} | ||
> | ||
Replication Slot Information | ||
</Label> | ||
<div style={tableStyle}> | ||
<Table | ||
header={ | ||
<TableRow> | ||
{[ | ||
'Slot Name', | ||
'Active', | ||
'Redo LSN', | ||
'Restart LSN', | ||
'Lag (In MB)', | ||
].map((heading, index) => ( | ||
<TableCell as='th' key={index}> | ||
<Label | ||
as='label' | ||
style={{ fontWeight: 'bold', fontSize: 14 }} | ||
> | ||
{heading} | ||
</Label> | ||
</TableCell> | ||
))} | ||
</TableRow> | ||
} | ||
> | ||
{data.map(({ slotName, active, redoLSN, restartLSN, lagInMb }) => { | ||
return ( | ||
<TableRow key={slotName}> | ||
<TableCell> | ||
<SlotNameDisplay slotName={slotName} /> | ||
</TableCell> | ||
<TableCell> | ||
<Label as='label' style={{ fontSize: 14 }}> | ||
{active ? 'Yes' : 'No'} | ||
</Label> | ||
</TableCell> | ||
<TableCell> | ||
<Label as='label' style={{ fontSize: 14 }}> | ||
{redoLSN} | ||
</Label> | ||
</TableCell> | ||
<TableCell> | ||
<Label as='label' style={{ fontSize: 14 }}> | ||
{restartLSN} | ||
</Label> | ||
</TableCell> | ||
<TableCell> | ||
<Label as='label' style={{ fontSize: 14 }}> | ||
{lagInMb < 0 ? 0 : lagInMb} | ||
</Label> | ||
</TableCell> | ||
</TableRow> | ||
); | ||
})} | ||
</Table> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SlotTable; |
Oops, something went wrong.