Skip to content

Commit

Permalink
Add database url to system info page
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Oct 10, 2024
1 parent 31277ec commit ccdc45f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mycodo/mycodo_flask/routes_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
DEPENDENCY_LOG_FILE, DOCKER_CONTAINER,
FRONTEND_PID_FILE, HTTP_ACCESS_LOG_FILE,
HTTP_ERROR_LOG_FILE, IMPORT_LOG_FILE,
KEEPUP_LOG_FILE, LOGIN_LOG_FILE, MYCODO_VERSION,
RESTORE_LOG_FILE, THEMES_DARK, UPGRADE_LOG_FILE)
KEEPUP_LOG_FILE, LOGIN_LOG_FILE, MYCODO_DB_PATH,
MYCODO_VERSION, RESTORE_LOG_FILE, THEMES_DARK,
UPGRADE_LOG_FILE)
from mycodo.config_devices_units import MEASUREMENTS
from mycodo.databases.models import (PID, AlembicVersion, Camera, Conversion,
CustomController, DeviceMeasurements,
Expand Down Expand Up @@ -730,6 +731,7 @@ def page_info():
gpio_readall=gpio_output,
database_version=database_version,
correct_database_version=correct_database_version,
database_url=MYCODO_DB_PATH,
df=df_output,
dmesg_output=dmesg_output,
free=free_output,
Expand Down
15 changes: 14 additions & 1 deletion mycodo/mycodo_flask/templates/pages/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
{% set help_page = ["https://kizniche.github.io/Mycodo/System-Information/", _('System Information')] %}

{% block title %} - {{_('System Information')}}{% endblock %}

{% block head %}
<style>
.hide {
color: black;
background-color: black;
}

.hide:hover {
color: #4E9258;
background-color: inherit;
}
</style>
{% endblock %}
{% block body %}
<!-- Route: /info -->
<div class="container">
Expand All @@ -17,6 +29,7 @@
{%- if database_version == correct_database_version -%}<span style="color: #4E9258; font-weight: bold;">{{database_version}}</span>
{%- else -%}<span style="color: #F70D1A; font-weight: bold;">{{database_version}}</span> (Incorrect Version. Should be {{correct_database_version}}) <a href="https://kizniche.github.io/Mycodo/Troubleshooting/#incorrect-database-version"><span style="font-size: 16px" class="fas fa-question-circle"></span></a>
{%- endif -%}
<br>{{_('Database URL')}}: <span class="hide" style="font-weight: bold;">{{database_url}}</span>
<br>{{_('Daemon Status')}}:&nbsp
{%- if daemon_status == "alive" %}<span style="color: #4E9258; font-weight: bold;">{{_('Running')}}</span>
{%- else %}<span style="color: #F70D1A; font-weight: bold;">{{_('Not Running')}}</span> <a href="https://kizniche.github.io/Mycodo/Troubleshooting/#daemon-not-running"><span style="font-size: 16px" class="fas fa-question-circle"></span></a>
Expand Down

0 comments on commit ccdc45f

Please sign in to comment.