Changelog: https://roxy-wi.org/changelog#6_3_2
pull/355/head
Pavel Loginov 2022-12-24 14:13:10 +03:00
parent 116897d824
commit ef1eb88342
7 changed files with 27 additions and 9 deletions

View File

@ -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'):

View File

@ -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(

View File

@ -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')

View File

@ -13,8 +13,14 @@
{{s.0[0]|upper}}{{s.0[1:]}}
</td>
<td class="padding10 first-collumn">
{% if 'is not installed' in s.3 %}
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('{{s.0}}', 'install')" title="Install {{service_name}}">Install</a>
{% if 'is not installed' in s.3 or not s.3 %}
{% if s.0 in ('prometheus', 'grafana-server') %}
<a class="ui-button ui-widget ui-corner-all" onclick="openTab(10)" title="Install {{service_name}}">Install</a>
{% elif s.0 in ('rabbitmq-server', 'fail2ban') %}
<a class="ui-button ui-widget ui-corner-all" href="https://roxy-wi/services/{{s.0.split('-')[0]}}" title="Install {{s.0|title()}}" target="_blank">Install</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('{{s.0}}', 'install')" title="Install {{service_name}}">Install</a>
{% endif %}
{% else %}
<a id="start-{{ s.0 }}" class="start" title="Start and enable {{s.0}} service">
<span class="service-start" onclick="confirmAjaxServiceAction('start', '{{s.0}}')"></span>

View File

@ -136,7 +136,13 @@
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('{{s.0}}')" title="Update {{service_name}}">Update</a>
{% endif %}
{% else %}
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('{{s.0}}', 'install')" title="Install {{service_name}}">Install</a>
{% if s.0 in ('prometheus', 'grafana-server') %}
<a class="ui-button ui-widget ui-corner-all" onclick="openTab(10)" title="Install {{service_name}}">Install</a>
{% elif s.0 in ('rabbitmq-server', 'fail2ban') %}
<a class="ui-button ui-widget ui-corner-all" href="https://roxy-wi/services/{{s.0.split('-')[0]}}" title="Install {{s.0|title()}}" target="_blank">Install</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all" onclick="updateService('{{s.0}}', 'install')" title="Install {{service_name}}">Install</a>
{% endif %}
{% endif %}
</td>
<td colspan="2">

View File

@ -22,6 +22,9 @@
</tr>
{% endif %}
{% set section.section = set.section %}
{% if page == "servers.py" and (set.param == 'proxy') %}
<!-- continue -->
{% else %}
<tr class="{{ loop.cycle('odd', 'even') }} {{set.section}}-section" style="display: none">
<td class="addName">
{{set.param}}
@ -67,6 +70,7 @@
</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</tbody>
</table>

View File

@ -1667,3 +1667,6 @@ function show_pretty_ansible_error(data) {
return data;
}
}
function openTab(tabId) {
$( "#tabs" ).tabs( "option", "active", tabId );
}