mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed OS detail issue for Linux and MacOS Big Sur. Fixes #6231.
This commit is contained in:
parent
4bc4ca1ba9
commit
a0deab901d
@ -39,4 +39,3 @@ gssapi==1.6.*
|
|||||||
flask-socketio>=5.0.1
|
flask-socketio>=5.0.1
|
||||||
eventlet==0.30.2
|
eventlet==0.30.2
|
||||||
httpagentparser==1.9.*
|
httpagentparser==1.9.*
|
||||||
user_agents==2.2.*
|
|
||||||
|
@ -20,6 +20,7 @@ import config
|
|||||||
import httpagentparser
|
import httpagentparser
|
||||||
from pgadmin.model import User
|
from pgadmin.model import User
|
||||||
from user_agents import parse
|
from user_agents import parse
|
||||||
|
import platform
|
||||||
|
|
||||||
MODULE_NAME = 'about'
|
MODULE_NAME = 'about'
|
||||||
|
|
||||||
@ -110,17 +111,15 @@ def detect_browser(request):
|
|||||||
"""This function returns the browser and os details"""
|
"""This function returns the browser and os details"""
|
||||||
nwjs_version = None
|
nwjs_version = None
|
||||||
agent = request.environ.get('HTTP_USER_AGENT')
|
agent = request.environ.get('HTTP_USER_AGENT')
|
||||||
user_agent = parse(agent)
|
os_details = parse(platform.platform()).ua_string
|
||||||
|
|
||||||
if 'Nwjs' in agent:
|
if 'Nwjs' in agent:
|
||||||
agent = agent.split('-')
|
agent = agent.split('-')
|
||||||
nwjs_version = agent[0].split(':')[1]
|
nwjs_version = agent[0].split(':')[1]
|
||||||
browser = 'Chromium' + ' ' + agent[2]
|
browser = 'Chromium' + ' ' + agent[2]
|
||||||
os_details = user_agent.os.family + ' ' + user_agent.os.version_string
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
browser = httpagentparser.detect(agent)
|
browser = httpagentparser.detect(agent)
|
||||||
os_details = user_agent.os.family + ' ' + user_agent.os.version_string
|
|
||||||
if not browser:
|
if not browser:
|
||||||
browser = agent.split('/')[0]
|
browser = agent.split('/')[0]
|
||||||
else:
|
else:
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<div class="col-sm-3"><b>{{ _('Server Configuration') }}</b></div>
|
<div class="col-sm-3"><b>{{ _('Server Configuration') }}</b></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-9"><textarea rows="7" cols="85" style="width:120%; height: 120%; white-space: pre-wrap;" readonly>{{ info.settings|safe }}</textarea></div>
|
<div class="col-sm-9"><textarea rows="7" cols="85" style="width:120%; height: auto; white-space: pre-wrap;" readonly>{{ info.settings|safe }}</textarea></div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user