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