Fix Server Log minor UI issues.

This commit is contained in:
Khushboo Vashi 2024-07-18 09:40:49 +05:30
parent 3b4fa40253
commit c9cc5257c7
3 changed files with 14 additions and 16 deletions

View File

@ -76,6 +76,7 @@ Click the *Configuration* tab to get the server configuration details.
Click the *Logs* tab to get the server logs. Click the *Logs* tab to get the server logs.
* Use the Log Format switch to select the format you want. Text/Plain, JSON and CSV are supported. * Use the Log Format switch to select the format you want. Text/Plain, JSON and CSV are supported.
The enable/disable state of the log format depends on the Postgresql.conf setting.
* Use the Logs in tabular format? switch if you want to see the logs in a tabular format. * Use the Logs in tabular format? switch if you want to see the logs in a tabular format.
Click the *System Statistics* tab to get the statistics for the system: Click the *System Statistics* tab to get the statistics for the system:

View File

@ -66,6 +66,9 @@ const Root = styled('div')(({theme}) => ({
width: '100%', width: '100%',
minHeight: '400px', minHeight: '400px',
padding: '4px', padding: '4px',
'& .Dashboard-cardHeader': {
padding: '8px',
},
'& .Dashboard-mainTabs': { '& .Dashboard-mainTabs': {
...theme.mixins.panelBorder.all, ...theme.mixins.panelBorder.all,
height: '100%', height: '100%',
@ -75,10 +78,9 @@ const Root = styled('div')(({theme}) => ({
color: theme.palette.error.main color: theme.palette.error.main
}, },
'& .Dashboard-download': { '& .Dashboard-download': {
alignSelf: 'end',
'& .Dashboard-downloadButton': { '& .Dashboard-downloadButton': {
width: '35px', width: '40px',
height:'30px' height:'30px !important',
}, },
}, },
'& .Dashboard-textArea': { '& .Dashboard-textArea': {
@ -87,9 +89,6 @@ const Root = styled('div')(({theme}) => ({
'& .RefreshButtons': { '& .RefreshButtons': {
display: 'flex', display: 'flex',
}, },
'& .Mui-disabled': {
pointerEvents: 'auto',
},
}, },
}, },
}, },
@ -823,10 +822,8 @@ function Dashboard({
let _format = res.data; let _format = res.data;
let _frm = [ let _frm = [
{'label': gettext('Text'), 'value': 'T', 'disabled': !_format.includes('stderr')}, {'label': gettext('Text'), 'value': 'T', 'disabled': !_format.includes('stderr')},
{'label': gettext('JSON'), 'value': 'J', 'disabled': !_format.includes('jsonlog'), {'label': gettext('JSON'), 'value': 'J', 'disabled': !_format.includes('jsonlog')},
tooltip: gettext('Enable JSON logging from postgresql.conf.')}, {'label': gettext('CSV'), 'value': 'C', 'disabled': !_format.includes('csvlog')}
{'label': gettext('CSV'), 'value': 'C', 'disabled': !_format.includes('csvlog'),
tooltip: gettext('Enable CSV logging from postgres.conf.')}
]; ];
setLogConfigFormat(_frm); setLogConfigFormat(_frm);
}) })
@ -886,7 +883,7 @@ function Dashboard({
}) })
.then((res) => { .then((res) => {
if (res.data && res.data['logs_disabled']) { if (res.data && res.data['logs_disabled']) {
setSsMsg(gettext('Please enable the logging to view the server logs.')); setSsMsg(gettext('Please enable the logging to view the server logs or check the log file is in place or not.'));
} else { } else {
setDashData(parseData(res.data)); setDashData(parseData(res.data));
} }
@ -966,7 +963,7 @@ function Dashboard({
label: gettext('Table based logs'), label: gettext('Table based logs'),
}; };
const CustomLogHeader = () => { const CustomLogHeader = () => {
return ( <Box className='Dashboard-cardHeader' display="flex" flexDirection="column"> return ( <Box className='Dashboard-cardHeader' display="flex" flexDirection="row">
<FormInputToggle <FormInputToggle
label={gettext('Log Format')} label={gettext('Log Format')}
className='Dashboard-searchInput' className='Dashboard-searchInput'
@ -977,10 +974,10 @@ function Dashboard({
options={logConfigFormat} options={logConfigFormat}
controlProps={CustomLogHeaderLabel} controlProps={CustomLogHeaderLabel}
labelGridBasis={3} labelGridBasis={3}
controlGridBasis={6} controlGridBasis={3}
></FormInputToggle> ></FormInputToggle>
<FormInputSwitch <FormInputSwitch
label={gettext('Logs in tabular format ?')} label={gettext('Tabular format?')}
labelPlacement="end" labelPlacement="end"
className='Dashboard-searchInput' className='Dashboard-searchInput'
value={logCol} value={logCol}
@ -990,7 +987,7 @@ function Dashboard({
}} }}
controlProps={CustomLogHeaderLabel} controlProps={CustomLogHeaderLabel}
labelGridBasis={3} labelGridBasis={3}
controlGridBasis={6} controlGridBasis={3}
></FormInputSwitch> ></FormInputSwitch>
<div className='Dashboard-download'><PgIconButton <div className='Dashboard-download'><PgIconButton
size="xs" size="xs"

View File

@ -198,7 +198,7 @@ export function NotifierProvider({ pgAdmin, pgWindow, getInstance, children, onR
// if open in a window, then create your own Snackbar // if open in a window, then create your own Snackbar
// if pgAdmin is opened inside an iframe then it also same as new window. // if pgAdmin is opened inside an iframe then it also same as new window.
if(window.self == window.top || (window.self != window.top && pgWindow != window )) { if(window.self == window.top || (window.self != window.top && pgWindow == window )) {
return ( return (
<Root> <Root>
<SnackbarProvider <SnackbarProvider