summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2021-11-03 09:30:36 +0100
committerJavier Sánchez Parra <jsanchez@soleta.eu>2021-11-08 11:42:59 +0100
commit792e4ed3ddcc0812fb97ff31560ec8b1fa39abc3 (patch)
tree67b7659aec273c7b0d032defacae594b18b1e296 /ogcp
parent7faa607131dd0124a5f1d4e804126e8063f1f9c9 (diff)
Add legacy real-time log
Clients in ogLive offer a web page with lighttpd that shows a real-time log. This commit links this log in ogcp. Future patches will deprecate this log functionality in favour of more robust solutions.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/templates/commands.html2
-rw-r--r--ogcp/views.py12
2 files changed, 14 insertions, 0 deletions
diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html
index b965867..df84ab0 100644
--- a/ogcp/templates/commands.html
+++ b/ogcp/templates/commands.html
@@ -42,5 +42,7 @@
form="scopesForm" formaction="{{ url_for('action_mode') }}" formmethod="get">
<input class="btn btn-light" type="submit" value="{{ _('Log') }}"
form="scopesForm" formaction="{{ url_for('action_legacy_log') }}" formmethod="get">
+ <input class="btn btn-light" type="submit" value="{{ _('Real time log') }}"
+ form="scopesForm" formaction="{{ url_for('action_legacy_rt_log') }}" formmethod="get">
{% endblock %}
diff --git a/ogcp/views.py b/ogcp/views.py
index 0b5b934..06f28b2 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -860,3 +860,15 @@ def action_legacy_log():
else:
return redirect(url_for('commands'))
+@app.route('/action/rt-log', methods=['GET'])
+@login_required
+def action_legacy_rt_log():
+ ips = parse_elements(request.args.to_dict())
+ if not validate_elements(ips, max_len=1):
+ return redirect(url_for('commands'))
+ ip = ips.pop()
+ scheme = "http://"
+ rt_log_path = "/cgi-bin/httpd-log.sh"
+ rt_log_url = scheme + ip + rt_log_path
+ return redirect(rt_log_url)
+