Skip to content
Draft
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/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
"@emotion/sheet": "^1.4.0",
"@fluentui/keyboard-key": "^0.4.23",
"@fortawesome/fontawesome-free": "latest",
"@mui/icons-material": "^7.3.10",
"@mui/material": "^7.3.10",
"@mui/x-date-pickers": "^8.28.3",
"@mui/icons-material": "^9.0.0",
"@mui/material": "^9.0.0",
"@mui/x-date-pickers": "^9.0.2",
"@nozbe/microfuzz": "^1.0.0",
"@projectstorm/react-diagrams": "^7.0.4",
"@simonwep/pickr": "^1.9.1",
Expand Down
15 changes: 13 additions & 2 deletions web/pgadmin/about/static/js/AboutComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,22 @@ export default function AboutComponent() {
</Grid>
}
{ aboutData.settings &&
<Box flexGrow="1" display="flex" flexDirection="column" minHeight="0">
<Box
sx={{
flexGrow: '1',
display: 'flex',
flexDirection: 'column',
minHeight: '0'
}}>
<Box>
<InputLabel style={{fontWeight: 'bold'}}>{gettext('pgAdmin Server Configuration')}</InputLabel>
</Box>
<Box flexGrow="1" paddingTop="1px" minHeight="0">
<Box
sx={{
flexGrow: '1',
paddingTop: '1px',
minHeight: '0'
}}>
<InputSQL value={aboutData.settings}
controlProps={{
readonly: true,
Expand Down
12 changes: 6 additions & 6 deletions web/pgadmin/browser/static/js/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ _.extend(pgBrowser.keyboardNavigation, {
hotkeys.unbind();
if (prefStore.version > 0) {
this.keyboardShortcut = {
...(prefStore.getPreferences('browser', 'main_menu_file')?.value) && {'file_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_file')?.value)},
...(prefStore.getPreferences('browser', 'main_menu_object')?.value) && {'object_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_object')?.value)},
...(prefStore.getPreferences('browser', 'main_menu_tools')?.value) && {'tools_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_tools')?.value)},
...(prefStore.getPreferences('browser', 'main_menu_help')?.value) && {'help_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_help')?.value)},
...((prefStore.getPreferences('browser', 'main_menu_file')?.value) && {'file_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_file')?.value)}),
...((prefStore.getPreferences('browser', 'main_menu_object')?.value) && {'object_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_object')?.value)}),
...((prefStore.getPreferences('browser', 'main_menu_tools')?.value) && {'tools_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_tools')?.value)}),
...((prefStore.getPreferences('browser', 'main_menu_help')?.value) && {'help_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'main_menu_help')?.value)}),
'left_tree_shortcut': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'browser_tree')?.value),
'tabbed_panel_backward': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'tabbed_panel_backward')?.value),
'tabbed_panel_forward': commonUtils.parseShortcutValue(prefStore.getPreferences('browser', 'tabbed_panel_forward')?.value),
Expand All @@ -56,11 +56,11 @@ _.extend(pgBrowser.keyboardNavigation, {

};
this.shortcutMethods = {
...(prefStore.getPreferences('browser', 'main_menu_file')?.value) && {'bindMainMenu': {
...((prefStore.getPreferences('browser', 'main_menu_file')?.value) && {'bindMainMenu': {
'shortcuts': [this.keyboardShortcut.file_shortcut,
this.keyboardShortcut.object_shortcut, this.keyboardShortcut.tools_shortcut,
this.keyboardShortcut.help_shortcut],
}}, // Main menu
}}), // Main menu
'bindRightPanel': {'shortcuts': [this.keyboardShortcut.tabbed_panel_backward, this.keyboardShortcut.tabbed_panel_forward, this.keyboardShortcut.close_tab_panel]}, // Main window panels
'bindLeftTree': {'shortcuts': this.keyboardShortcut.left_tree_shortcut}, // Main menu,
'bindSubMenuQueryTool': {'shortcuts': this.keyboardShortcut.sub_menu_query_tool}, // Sub menu - Open Query Tool,
Expand Down
88 changes: 50 additions & 38 deletions web/pgadmin/dashboard/static/js/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -948,41 +948,48 @@ function Dashboard({
label: gettext('Table based logs'),
};
const CustomLogHeader = () => {
return ( <Box className='Dashboard-cardHeader' display="flex" flexDirection="row">
<FormInputToggle
label={gettext('Log Format')}
className='Dashboard-searchInput'
value={logFormat}
onChange={(val) => {
setLogFormat(val);
}}
options={logConfigFormat}
controlProps={CustomLogHeaderLabel}
labelGridBasis={3}
controlGridBasis={3}
></FormInputToggle>
<FormInputSwitch
label={gettext('Tabular format?')}
labelPlacement="end"
className='Dashboard-searchInput'
value={logCol}
onChange={(e) => {
setDashData([]);
setLogCol(e.target.checked);
}}
controlProps={CustomLogHeaderLabel}
labelGridBasis={3}
controlGridBasis={3}
></FormInputSwitch>
<div className='Dashboard-download'><PgIconButton
size="xs"
className='Dashboard-downloadButton'
icon={<GetAppRoundedIcon />}
onClick={downloadServerLogs}
aria-label="Download"
title={gettext('Download logs ')}
></PgIconButton></div>
</Box>);
return (
<Box
className='Dashboard-cardHeader'
sx={{
display: 'flex',
flexDirection: 'row'
}}>
<FormInputToggle
label={gettext('Log Format')}
className='Dashboard-searchInput'
value={logFormat}
onChange={(val) => {
setLogFormat(val);
}}
options={logConfigFormat}
controlProps={CustomLogHeaderLabel}
labelGridBasis={3}
controlGridBasis={3}
></FormInputToggle>
<FormInputSwitch
label={gettext('Tabular format?')}
labelPlacement="end"
className='Dashboard-searchInput'
value={logCol}
onChange={(e) => {
setDashData([]);
setLogCol(e.target.checked);
}}
controlProps={CustomLogHeaderLabel}
labelGridBasis={3}
controlGridBasis={3}
></FormInputSwitch>
<div className='Dashboard-download'><PgIconButton
size="xs"
className='Dashboard-downloadButton'
icon={<GetAppRoundedIcon />}
onClick={downloadServerLogs}
aria-label="Download"
title={gettext('Download logs ')}
></PgIconButton></div>
</Box>
);
};


Expand Down Expand Up @@ -1021,7 +1028,7 @@ function Dashboard({
};

return (
(<Root>
<Root>
{sid && serverConnected ? (
<Box className='Dashboard-dashboardPanel'>
<Box className='Dashboard-panelContent'>
Expand Down Expand Up @@ -1133,7 +1140,12 @@ function Dashboard({
</TabPanel>
{/* System Statistics */}
<TabPanel value={mainTabVal} index={4} classNameRoot='Dashboard-tabPanel systemStorage'>
<Box height="100%" display="flex" flexDirection="column">
<Box
sx={{
height: '100%',
display: 'flex',
flexDirection: 'column'
}}>
{ssMsg === 'installed' && did === ldid ?
<ErrorBoundary>
<Box>
Expand Down Expand Up @@ -1203,7 +1215,7 @@ function Dashboard({
</Box>
</Box>
) : showDefaultContents() }
</Root>)
</Root>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ export default function LogReplication({treeNodeInfo, pageVisible}) {
}, [pageVisible ]);

return (
<Box height="100%" display="flex" flexDirection="column">
<Box
sx={{
height: '100%',
display: 'flex',
flexDirection: 'column'
}}>
<SectionContainer
titleExtras={<RefreshButton onClick={()=>{
getReplicationData('replication_stats', setReplicationStats);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,12 @@ export default function PGDReplication({preferences, treeNodeInfo, pageVisible,
const replicationLagBytesData = useMemo(()=>transformData(replicationLagBytes, preferences['pgd_replication_lag_refresh'], theme.name), [replicationLagBytes, theme.name]);

return (
<Box height="100%" display="flex" flexDirection="column">
<Box
sx={{
height: '100%',
display: 'flex',
flexDirection: 'column'
}}>
<Grid container spacing={0.5}>
<Grid size={{ md: 6 }}>
<ChartContainer id='sessions-graph' title={gettext('Replication lag (Time)')}
Expand Down
20 changes: 17 additions & 3 deletions web/pgadmin/dashboard/static/js/SystemStats/CpuDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ export default function CpuDetails({preferences, sid, did, pageVisible, enablePo
}, enablePoll ? pollDelay : -1);

return (
<Box display="flex" flexDirection="column" height="100%">
<Box
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%'
}}>
<div data-testid='graph-poll-delay' style={{display: 'none'}}>{pollDelay}</div>
{chartDrawnOnce &&
<CPUWrapper
Expand Down Expand Up @@ -217,7 +222,12 @@ export function CPUWrapper(props) {
lineBorderWidth: props.lineBorderWidth,
}), [props.showTooltip, props.showDataPoints, props.lineBorderWidth]);
return (
<Box display="flex" flexDirection="column" height="100%">
<Box
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%'
}}>
<Grid container spacing={0.5} sx={{marginBottom: '4px'}}>
<Grid size={{ md: 6 }}>
<ChartContainer id='cu-graph' title={gettext('CPU usage')} datasets={props.cpuUsageInfo.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
Expand All @@ -230,7 +240,11 @@ export function CPUWrapper(props) {
</ChartContainer>
</Grid>
</Grid>
<Box flexGrow={1} minHeight={0}>
<Box
sx={{
flexGrow: 1,
minHeight: 0
}}>
<SectionContainer title={gettext('Process CPU usage')}>
<PgTable
columns={props.tableHeader}
Expand Down
20 changes: 17 additions & 3 deletions web/pgadmin/dashboard/static/js/SystemStats/Memory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ export default function Memory({preferences, sid, did, pageVisible, enablePoll=t
});
}, enablePoll ? pollDelay : -1);
return (
<Box display="flex" flexDirection="column" height="100%">
<Box
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%'
}}>
<div data-testid='graph-poll-delay' style={{display: 'none'}}>{pollDelay}</div>
{chartDrawnOnce &&
<MemoryWrapper
Expand Down Expand Up @@ -224,7 +229,12 @@ export function MemoryWrapper(props) {
}), [props.showTooltip, props.showDataPoints, props.lineBorderWidth]);

return (
<Box display="flex" flexDirection="column" height="100%">
<Box
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%'
}}>
<Grid container spacing={0.5} sx={{marginBottom: '4px'}}>
<Grid size={{ md: 6 }}>
<ChartContainer id='m-graph' title={gettext('Memory')} datasets={props.memoryUsageInfo.datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
Expand All @@ -239,7 +249,11 @@ export function MemoryWrapper(props) {
</ChartContainer>
</Grid>
</Grid>
<Box flexGrow={1} minHeight={0}>
<Box
sx={{
flexGrow: 1,
minHeight: 0
}}>
<SectionContainer title={gettext('Process memory usage')}>
<PgTable
columns={props.tableHeader}
Expand Down
4 changes: 3 additions & 1 deletion web/pgadmin/dashboard/static/js/SystemStats/Storage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ export function StorageWrapper(props) {
</Grid>
{Object.keys(props.ioInfo).map((drive) => (
<SectionContainer key={drive} title={drive} style={{minHeight: 'unset', height: 'auto', marginBottom: '0.5px'}}>
<Grid container spacing={0.5} p={0.5}>
<Grid container spacing={0.5} sx={{
p: 0.5
}}>
{Object.keys(props.ioInfo[drive]).map((type, innerKeyIndex) => (
<Grid key={`${type}-${innerKeyIndex}`} size={{ md: 4, sm: 6 }}>
<ChartContainer id={`io-graph-${type}`} title={getChartContainerTitle(type)} datasets={transformData(props.ioInfo[drive][type], props.ioRefreshRate).datasets} errorMsg={props.errorMsg} isTest={props.isTest}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default function ChartContainer(props) {

return (
<StyledCard elevation={0} data-testid="chart-container">
<CardHeader title={<Box display="flex" justifyContent="space-between">
<CardHeader title={<Box
sx={{
display: 'flex',
justifyContent: 'space-between'
}}>
<div id={props.id}>{props.title}</div>
<div className='ChartContainer-chartLegend'>
<div style={{display: 'flex', flexWrap: 'wrap'}}>
Expand Down
10 changes: 8 additions & 2 deletions web/pgadmin/dashboard/static/js/components/SectionContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
import { Box } from '@mui/material';
import { Resizable } from 're-resizable';

const StyledBox = styled(Box)(({theme}) => ({
const StyledBox = styled('div')(({theme}) => ({
...theme.mixins.panelBorder.all,
display: 'flex',
flexDirection: 'column',
Expand Down Expand Up @@ -48,7 +48,13 @@ export default function SectionContainer({title, titleExtras, children, style, r
{titleExtras}
</div>
</Box>
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
<Box
sx={{
height: '100%',
display: 'flex',
flexDirection: 'column',
minHeight: 0
}}>
{children}
</Box>
</>
Expand Down
2 changes: 1 addition & 1 deletion web/pgadmin/llm/static/js/AIReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ marked.setOptions({
});


const StyledBox = styled(Box)(({ theme }) => ({
const StyledBox = styled('div')(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
height: '100%',
Expand Down
2 changes: 1 addition & 1 deletion web/pgadmin/llm/static/js/SecurityReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ marked.setOptions({
});


const StyledBox = styled(Box)(({ theme }) => ({
const StyledBox = styled('div')(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
height: '100%',
Expand Down
19 changes: 15 additions & 4 deletions web/pgadmin/misc/bgprocess/static/js/BgProcessNotify.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
import gettext from 'sources/gettext';
import pgAdmin from 'sources/pgadmin';

const StyledBox = styled(Box)(({theme}) => ({
const StyledBox = styled('div')(({theme}) => ({
borderRadius: theme.shape.borderRadius,
padding: '0.25rem 1rem 1rem',
minWidth: '325px',
Expand Down Expand Up @@ -46,13 +46,24 @@ const AUTO_HIDE_DURATION = 10000; // In milliseconds
function ProcessNotifyMessage({title, desc, onClose, onViewProcess, success=true, dataTestSuffix=''}) {
return (
<StyledBox className={(success ? 'BgProcessNotify-containerSuccess' : 'BgProcessNotify-containerError')} data-test={'process-popup-' + dataTestSuffix}>
<Box display="flex" justifyContent="space-between" className='BgProcessNotify-containerHeader'>
<Box marginRight={'1rem'}>{title}</Box>
<Box
className='BgProcessNotify-containerHeader'
sx={{
display: 'flex',
justifyContent: 'space-between'
}}>
<Box sx={{
marginRight: '1rem'
}}>{title}</Box>
<PgIconButton size="xs" noBorder icon={<CloseIcon />} onClick={onClose} title={'Close'} className={success ? 'BgProcessNotify-iconSuccess' : 'BgProcessNotify-iconError'} />
</Box>
<Box className='BgProcessNotify-containerBody'>
<Box>{desc}</Box>
<Box marginTop={'1rem'} display="flex">
<Box
sx={{
marginTop: '1rem',
display: 'flex'
}}>
<DefaultButton startIcon={<DescriptionOutlinedIcon />} onClick={()=>{
onViewProcess();
onClose();
Expand Down
Loading
Loading