From bb7e20199124b84de5d252ffe0371a5799feee42 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Fri, 4 Sep 2020 13:18:26 +0200 Subject: Add refresh action This action can be applied on single or multiple scopes. --- ogcp/templates/scopes.html | 3 +++ ogcp/views.py | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'ogcp') diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html index 4b9ff28..81124dd 100644 --- a/ogcp/templates/scopes.html +++ b/ogcp/templates/scopes.html @@ -38,6 +38,9 @@ formaction="{{ url_for('action_poweroff') }}" formmethod="post"> + + diff --git a/ogcp/views.py b/ogcp/views.py index 92e91b2..0772e33 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -70,3 +70,10 @@ def action_reboot(): payload = {'clients': list(ips)} g.server.post('/reboot', payload) return make_response("200 OK", 200) + +@app.route('/action/refresh', methods=['POST']) +def action_refresh(): + ips = parse_ips(request.form.to_dict()) + payload = {'clients': list(ips)} + g.server.post('/refresh', payload) + return make_response("200 OK", 200) -- cgit v1.2.3-18-g5258