From 74b9e9b8a9693b0e238c69eef6b2aab0f2b78af7 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Tue, 12 May 2020 20:57:05 +0200 Subject: [PATCH] v4.3.0.0 Changelog: https://haproxy-wi.org/changelog.py#4_3 --- app/options.py | 11 +++++++++ app/templates/admin.html | 51 ++++++++++++++++++++++++++++++++++++++++ app/templates/base.html | 1 + app/users.py | 12 ++++++++++ inc/awesome.css | 5 ++++ inc/overview.js | 2 +- inc/script.js | 11 ++++++++- inc/users.js | 35 +++++++++++++++++++++++++++ index.html | 3 +++ 9 files changed, 129 insertions(+), 2 deletions(-) diff --git a/app/options.py b/app/options.py index 1a7f7063..96c6fe7e 100644 --- a/app/options.py +++ b/app/options.py @@ -132,6 +132,17 @@ if form.getvalue('action_waf') is not None and serv is not None: funct.ssh_command(serv, commands) +if form.getvalue('action_service') is not None: + action = form.getvalue('action_service') + if action == 'stop': + cmd="sudo systemctl disable %s --now" % serv + elif action == "start": + cmd="sudo systemctl enable %s --now" % serv + elif action == "restart": + cmd="sudo systemctl restart %s --now" % serv + output, stderr = funct.subprocess_execute(cmd) + funct.logging('localhost', ' The service '+serv+ 'was '+action+'ed', haproxywi=1, login=1) + if act == "overviewHapserverBackends": from jinja2 import Environment, FileSystemLoader env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True) diff --git a/app/templates/admin.html b/app/templates/admin.html index e6c6f100..1c0f5def 100644 --- a/app/templates/admin.html +++ b/app/templates/admin.html @@ -17,6 +17,7 @@
  • SSH credentials
  • Checker
  • Settings
  • +
  • Services
  • Update
  • Backup
  • {% include 'include/login.html' %} @@ -437,6 +438,53 @@ +
    + + + + + + + {% for s in services %} + + + + + + {% endfor %} +
    + Service + + Actions + Description
    + {% if s.1.0 == 'active' %} + + {% else %} + {% if s.1.0 == 'inactive' or s.1.0 == 'failed' %} + + {% else %} + + {% endif %} + {% endif %} + {{s.0}} + + + + + + + + + + + + {{ s.2 }} +
    +
    + You can read about services here +
    +
    +
    {% set current_ver = versions.0 %} {% set new_ver = versions.1 %} @@ -597,6 +645,9 @@ +