diff --git a/app/modules/tools/common.py b/app/modules/tools/common.py index 6bce4a50..8ee29cae 100644 --- a/app/modules/tools/common.py +++ b/app/modules/tools/common.py @@ -5,14 +5,15 @@ import modules.roxywi.roxy as roxywi_mod import modules.server.server as server_mod -def get_services_status(): +def get_services_status(update_cur_ver=0): services = [] - services_name = sql.get_all_tools() + if update_cur_ver: + try: + update_cur_tool_versions() + except Exception as e: + raise Exception(f'error: Update current versions: {e}') - try: - update_cur_tool_versions() - except Exception as e: - raise Exception(f'error: Update current versions: {e}') + services_name = sql.get_all_tools() try: for s, v in services_name.items(): @@ -96,7 +97,10 @@ def update_cur_tool_version(tool_name: str) -> None: if service_ver in ('command', 'prometheus:', 'not'): service_ver = 0 - sql.update_tool_cur_version(tool_name, service_ver) + try: + sql.update_tool_cur_version(tool_name, service_ver) + except Exception: + pass def get_cur_tool_version(tool_name: str) -> str: diff --git a/app/routes/admin/routes.py b/app/routes/admin/routes.py index 437c39d5..9629edf3 100644 --- a/app/routes/admin/routes.py +++ b/app/routes/admin/routes.py @@ -61,7 +61,7 @@ def show_tools(): roxywi_auth.page_for_admin() lang = roxywi_common.get_user_lang_for_flask() try: - services = tools_common.get_services_status() + services = tools_common.get_services_status(update_cur_ver=1) except Exception as e: return str(e) diff --git a/app/templates/ajax/load_updateroxywi.html b/app/templates/ajax/load_updateroxywi.html index baf76eb7..c0c94cbf 100644 --- a/app/templates/ajax/load_updateroxywi.html +++ b/app/templates/ajax/load_updateroxywi.html @@ -78,6 +78,9 @@ {{lang.words.w_update|title()}} {% endif %} {% endif %} + {% if s.2['current_version'] == '0' %} + {{lang.words.install|title()}} + {% endif %}