Browse Source

v6.3.2.0

Changelog: https://roxy-wi.org/changelog#6_3_2
pull/355/head
Pavel Loginov 2 years ago
parent
commit
ef1eb88342
  1. 2
      app/modules/db/sql.py
  2. 5
      app/modules/roxywi/roxy.py
  3. 4
      app/options.py
  4. 10
      app/templates/ajax/load_services.html
  5. 8
      app/templates/ajax/load_updateroxywi.html
  6. 4
      app/templates/include/admin_settings.html
  7. 3
      inc/script.js

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

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

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

10
app/templates/ajax/load_services.html

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

8
app/templates/ajax/load_updatehapwi.html → app/templates/ajax/load_updateroxywi.html

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

4
app/templates/include/admin_settings.html

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

3
inc/script.js

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

Loading…
Cancel
Save