diff --git a/app/modules/db/sql.py b/app/modules/db/sql.py index 60441a43..773a75f2 100755 --- a/app/modules/db/sql.py +++ b/app/modules/db/sql.py @@ -26,7 +26,7 @@ def get_setting(param, **kwargs): except Exception: pass - if user_group == '' or param == 'lists_path' or param == 'ssl_local_path': + if user_group == '' or param in ('lists_path', 'ssl_local_path', 'proxy'): user_group = 1 if kwargs.get('all'): diff --git a/app/modules/roxywi/roxy.py b/app/modules/roxywi/roxy.py index 50d9cdcb..4348b1fc 100644 --- a/app/modules/roxywi/roxy.py +++ b/app/modules/roxywi/roxy.py @@ -187,9 +187,8 @@ def action_service(action: str, service: str) -> None: return is_in_docker = is_docker() - if action == 'stop': - cmd = f"sudo systemctl disable {service} --now" - elif action in ("start", "restart"): + cmd = f"sudo systemctl disable {service} --now" + if action in ("start", "restart"): cmd = f"sudo systemctl {action} {service} --now" if not sql.select_user_status(): print( diff --git a/app/options.py b/app/options.py index 818103a6..eeef9462 100644 --- a/app/options.py +++ b/app/options.py @@ -1125,7 +1125,7 @@ if form.getvalue('updategroup') is not None: else: try: sql.update_group(name, descript, group_id) - roxywi_common.logging(f'Roxy-WI server', f'The {name} has been updated', roxywi=1, login=1) + roxywi_common.logging('Roxy-WI server', f'The {name} has been updated', roxywi=1, login=1) except Exception as e: print('error: ' + str(e)) @@ -2501,7 +2501,7 @@ if form.getvalue('load_update_hapwi'): import modules.roxywi.roxy as roxy env = Environment(loader=FileSystemLoader('templates')) - template = env.get_template('ajax/load_updatehapwi.html') + template = env.get_template('ajax/load_updateroxywi.html') versions = roxy.versions() checker_ver = roxy.check_new_version('checker') diff --git a/app/templates/ajax/load_services.html b/app/templates/ajax/load_services.html index 28d92273..cb6f3739 100644 --- a/app/templates/ajax/load_services.html +++ b/app/templates/ajax/load_services.html @@ -13,8 +13,14 @@ {{s.0[0]|upper}}{{s.0[1:]}} - {% if 'is not installed' in s.3 %} - Install + {% if 'is not installed' in s.3 or not s.3 %} + {% if s.0 in ('prometheus', 'grafana-server') %} + Install + {% elif s.0 in ('rabbitmq-server', 'fail2ban') %} + Install + {% else %} + Install + {% endif %} {% else %} diff --git a/app/templates/ajax/load_updatehapwi.html b/app/templates/ajax/load_updateroxywi.html similarity index 90% rename from app/templates/ajax/load_updatehapwi.html rename to app/templates/ajax/load_updateroxywi.html index 5ba7c7e8..e78223d4 100644 --- a/app/templates/ajax/load_updatehapwi.html +++ b/app/templates/ajax/load_updateroxywi.html @@ -136,7 +136,13 @@ Update {% endif %} {% else %} - Install + {% if s.0 in ('prometheus', 'grafana-server') %} + Install + {% elif s.0 in ('rabbitmq-server', 'fail2ban') %} + Install + {% else %} + Install + {% endif %} {% endif %} diff --git a/app/templates/include/admin_settings.html b/app/templates/include/admin_settings.html index 52f9007d..11f74c4e 100644 --- a/app/templates/include/admin_settings.html +++ b/app/templates/include/admin_settings.html @@ -22,6 +22,9 @@ {% endif %} {% set section.section = set.section %} + {% if page == "servers.py" and (set.param == 'proxy') %} + + {% else %} {{set.param}} @@ -67,6 +70,7 @@ {% endif %} + {% endif %} {% endfor %} diff --git a/inc/script.js b/inc/script.js index f380bae2..b83cfd1d 100644 --- a/inc/script.js +++ b/inc/script.js @@ -1667,3 +1667,6 @@ function show_pretty_ansible_error(data) { return data; } } +function openTab(tabId) { + $( "#tabs" ).tabs( "option", "active", tabId ); +}