Skip to content

Commit

Permalink
Add python version to hostinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskr97 committed Sep 7, 2021
1 parent 90fe514 commit d8bf164
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions crashserver/utility/hostinfo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import socket
import sys
import os


Expand All @@ -10,3 +11,8 @@ def is_inside_docker() -> bool:
@staticmethod
def get_hostname() -> str:
return socket.gethostname()

@staticmethod
def get_python_version():
info = sys.version_info
return "Python {}.{}.{}".format(info.major, info.minor, info.micro)
5 changes: 3 additions & 2 deletions res/templates/app/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,13 @@ <h5>Host</h5>
{{ settings_info_line("Server Port", settings.flask.web_port) }}
<hr>
<h5>Data Storage</h5>
{{ settings_info_line("AppData Path", settings.storage.data_root) }}
{{ settings_info_line("AppData Path", settings.storage.appdata) }}
{{ settings_info_line("Log Path", settings.storage.logs) }}
<hr>
<h5>Host Information</h5>
{{ settings_info_line("App Version", HostInfo.get_python_version()) }}
{{ settings_info_line("Hostname", HostInfo.get_hostname()) }}
{{ settings_info_line("Is Docker?", HostInfo.is_inside_docker()) }}
{{ settings_info_line('Under Docker?', "Yes" if HostInfo.is_inside_docker() else "No") }}
</div>

</div> <!-- END OF SETTINGS CONTENT-->
Expand Down

0 comments on commit d8bf164

Please sign in to comment.