Server config information in the about dialog should be only visible to admin users. #6769
parent
9eb7c1cbea
commit
01d1e6f706
|
@ -59,26 +59,30 @@ def index():
|
||||||
info = {}
|
info = {}
|
||||||
# Get OS , NW.js, Browser details
|
# Get OS , NW.js, Browser details
|
||||||
browser, os_details, nwjs_version = detect_browser(request)
|
browser, os_details, nwjs_version = detect_browser(request)
|
||||||
|
admin = is_admin(current_user.email)
|
||||||
|
|
||||||
if nwjs_version:
|
if nwjs_version:
|
||||||
info['nwjs'] = nwjs_version
|
info['nwjs'] = nwjs_version
|
||||||
|
|
||||||
info['browser_details'] = browser
|
|
||||||
info['os_details'] = os_details
|
|
||||||
info['config_db'] = config.SQLITE_PATH
|
|
||||||
info['log_file'] = config.LOG_FILE
|
|
||||||
info['version'] = config.APP_VERSION
|
|
||||||
|
|
||||||
if config.SERVER_MODE:
|
if config.SERVER_MODE:
|
||||||
info['app_mode'] = gettext('Server')
|
info['app_mode'] = gettext('Server')
|
||||||
admin = is_admin(current_user.email)
|
|
||||||
info['admin'] = admin
|
|
||||||
else:
|
else:
|
||||||
info['app_mode'] = gettext('Desktop')
|
info['app_mode'] = gettext('Desktop')
|
||||||
|
|
||||||
|
info['browser_details'] = browser
|
||||||
|
info['version'] = config.APP_VERSION
|
||||||
|
info['admin'] = admin
|
||||||
info['current_user'] = current_user.email
|
info['current_user'] = current_user.email
|
||||||
|
|
||||||
|
if admin:
|
||||||
settings = ""
|
settings = ""
|
||||||
|
info['os_details'] = os_details
|
||||||
|
info['log_file'] = config.LOG_FILE
|
||||||
|
|
||||||
|
# If external datbase is used do not display SQLITE_PATH
|
||||||
|
if not config.CONFIG_DATABASE_URI:
|
||||||
|
info['config_db'] = config.SQLITE_PATH
|
||||||
|
|
||||||
for setting in dir(config):
|
for setting in dir(config):
|
||||||
if not setting.startswith('_') and setting.isupper() and \
|
if not setting.startswith('_') and setting.isupper() and \
|
||||||
setting not in ['CSRF_SESSION_KEY',
|
setting not in ['CSRF_SESSION_KEY',
|
||||||
|
|
|
@ -101,6 +101,7 @@ export default function AboutComponent() {
|
||||||
<InputLabel>{aboutData.browser_details}</InputLabel>
|
<InputLabel>{aboutData.browser_details}</InputLabel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
{ aboutData.os_details &&
|
||||||
<Grid container spacing={0} style={{marginBottom: '8px'}}>
|
<Grid container spacing={0} style={{marginBottom: '8px'}}>
|
||||||
<Grid item lg={3} md={3} sm={3} xs={12}>
|
<Grid item lg={3} md={3} sm={3} xs={12}>
|
||||||
<InputLabel style={{fontWeight: 'bold'}}>{gettext('Operating System')}</InputLabel>
|
<InputLabel style={{fontWeight: 'bold'}}>{gettext('Operating System')}</InputLabel>
|
||||||
|
@ -109,6 +110,8 @@ export default function AboutComponent() {
|
||||||
<InputLabel>{aboutData.os_details}</InputLabel>
|
<InputLabel>{aboutData.os_details}</InputLabel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
}
|
||||||
|
{ aboutData.config_db &&
|
||||||
<Grid container spacing={0} style={{marginBottom: '8px'}}>
|
<Grid container spacing={0} style={{marginBottom: '8px'}}>
|
||||||
<Grid item lg={3} md={3} sm={3} xs={12}>
|
<Grid item lg={3} md={3} sm={3} xs={12}>
|
||||||
<InputLabel style={{fontWeight: 'bold'}}>{gettext('pgAdmin Database File')}</InputLabel>
|
<InputLabel style={{fontWeight: 'bold'}}>{gettext('pgAdmin Database File')}</InputLabel>
|
||||||
|
@ -117,6 +120,8 @@ export default function AboutComponent() {
|
||||||
<InputLabel>{aboutData.config_db}</InputLabel>
|
<InputLabel>{aboutData.config_db}</InputLabel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
}
|
||||||
|
{ aboutData.log_file &&
|
||||||
<Grid container spacing={0} style={{marginBottom: '8px'}}>
|
<Grid container spacing={0} style={{marginBottom: '8px'}}>
|
||||||
<Grid item lg={3} md={3} sm={3} xs={12}>
|
<Grid item lg={3} md={3} sm={3} xs={12}>
|
||||||
<InputLabel style={{fontWeight: 'bold'}}>{gettext('Log File')}</InputLabel>
|
<InputLabel style={{fontWeight: 'bold'}}>{gettext('Log File')}</InputLabel>
|
||||||
|
@ -125,8 +130,8 @@ export default function AboutComponent() {
|
||||||
<InputLabel>{aboutData.log_file}</InputLabel>
|
<InputLabel>{aboutData.log_file}</InputLabel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
{ (aboutData.app_mode == 'Desktop' || (aboutData.app_mode == 'Server' && aboutData.admin)) &&
|
}
|
||||||
<>
|
{ aboutData.settings &&
|
||||||
<Box flexGrow="1" display="flex" flexDirection="column">
|
<Box flexGrow="1" display="flex" flexDirection="column">
|
||||||
<Box>
|
<Box>
|
||||||
<span style={{fontWeight: 'bold'}}>{gettext('Server Configuration')}</span>
|
<span style={{fontWeight: 'bold'}}>{gettext('Server Configuration')}</span>
|
||||||
|
@ -141,7 +146,6 @@ export default function AboutComponent() {
|
||||||
value={aboutData.settings}/>
|
value={aboutData.settings}/>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
|
||||||
}
|
}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue