Skip to content
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
6 changes: 3 additions & 3 deletions web/pgadmin/dashboard/static/js/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ function Dashboard({
{!_.isUndefined(preferences) && preferences.show_activity && (
<Fragment>
<CustomRefresh refresh={refresh} setRefresh={setRefresh}/>
<SectionContainer title={gettext('Sessions')} style={{height: 'auto', minHeight: '200px', maxHeight:'400px', paddingBottom: '20px'}}>
<SectionContainer title={gettext('Sessions')}>
<PgTable
caveTable={false}
tableNoBorder={false}
Expand All @@ -1074,15 +1074,15 @@ function Dashboard({
schema={activeQSchemaObj}
></PgTable>
</SectionContainer>
<SectionContainer title={gettext('Locks')} style={{height: 'auto', minHeight: '200px', maxHeight:'400px', paddingBottom: '20px'}}>
<SectionContainer title={gettext('Locks')}>
<PgTable
caveTable={false}
tableNoBorder={false}
columns={databaseLocksColumns}
data={(dashData?.[0]?.['locks']) || []}
></PgTable>
</SectionContainer>
<SectionContainer title={gettext('Prepared Transactions')} style={{height: 'auto', minHeight: '200px', maxHeight:'400px', paddingBottom: '20px'}}>
<SectionContainer title={gettext('Prepared Transactions')}>
<PgTable
caveTable={false}
tableNoBorder={false}
Expand Down
38 changes: 27 additions & 11 deletions web/pgadmin/dashboard/static/js/components/SectionContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import React from 'react';
import { styled } from '@mui/material/styles';
import PropTypes from 'prop-types';
import { Box } from '@mui/material';
import { Resizable } from 're-resizable';

const StyledBox = styled(Box)(({theme}) => ({
...theme.mixins.panelBorder.all,
display: 'flex',
flexDirection: 'column',
overflow: 'hidden !important',
height: '100%',
height: 'auto',
width: '100%',
minHeight: '400px',
borderRadius: theme.shape.borderRadius,
'& .SectionContainer-cardHeader': {
backgroundColor: theme.otherVars.tableBg,
Expand All @@ -32,20 +32,36 @@ const StyledBox = styled(Box)(({theme}) => ({
width: '100%',
}
},
// Added this to remove the borders from pgrt.
'& .pgrt': {
borderRight: 'none !important',
borderLeft: 'none !important',
borderBottom: 'none !important',
},
}));

export default function SectionContainer({title, titleExtras, children, style}) {
return (
<StyledBox className='SectionContainer-root' style={style}>
<Box className='SectionContainer-cardHeader' title={title}>
<div className='SectionContainer-cardTitle'>{title}</div>
<div style={{marginLeft: 'auto'}}>
{titleExtras}
</div>
</Box>
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
{children}
</Box>
<Resizable
enable={{ bottom: true }}
defaultSize={{ height: 'auto', width: '100%' }}
minHeight={25}
style={{
display: 'flex',
flexDirection: 'column'
}}
>
<Box className='SectionContainer-cardHeader' title={title}>
<div className='SectionContainer-cardTitle'>{title}</div>
<div style={{marginLeft: 'auto'}}>
{titleExtras}
</div>
</Box>
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
{children}
</Box>
</Resizable>
</StyledBox>
);
}
Expand Down
Loading