should be embeded now

This commit is contained in:
piair 2023-08-29 18:53:06 +02:00
parent 74ea8ee854
commit fa45d97576
4 changed files with 58 additions and 3 deletions

View File

@ -159,7 +159,7 @@ def change_password():
# handle login failed
@app.errorhandler(401)
def unauthorized(e):
return(render_template("login.html"))
return(redirect("login"))
# callback to reload the user object
@ -363,6 +363,10 @@ def logs():
print(configs)
return(render_template("logs.html", data=configs))
@app.route("/stats/", methods=["GET", "POST"])
def logs():
return(render_template("stats.html"))
@app.route('/download/<path:filename>', methods=['GET', 'POST'])

View File

@ -29,7 +29,7 @@
</tr>
<tr>
<td>
<button class="unselected" onclick="location.href = '/grafana';">stats</button>
<button class="unselected" onclick="location.href = '/stats';">stats</button>
</td>
</tr>
<tr>

View File

@ -0,0 +1,51 @@
{% extends "base.html" %}
{% block left_pannel %}
<table>
<tr>
<td>
<button class="unselected" onclick="location.href = '/override';">override</button>
</td>
</tr>
<tr>
<td>
<button class="unselected" onclick="location.href = '/config';">config</button>
</td>
</tr>
<tr>
<td>
<button class="unselected" onclick="location.href = '/discord';">discord</button>
</td>
</tr>
<tr>
<td>
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
</td>
</tr>
<tr>
<td>
<button class="selected" onclick="location.href = '/logs';">logs</button>
</td>
</tr>
<tr>
<td>
<button class="unselected" onclick="location.href = '/grafana';">stats</button>
</td>
</tr>
<tr>
<td>
<button class="unselected" onclick="location.href = '/settings';">settings</button>
</td>
</tr>
</table>
{% endblock %}
{% block content %}
{%if not current_user.is_authenticated %}
<button class="unselected" onclick="location.href = '/login';">login</button>
{% else %}
<iframe src="/grafana" width="100%" height="100%"></iframe>
{% endif %}
{%endblock %}

View File

@ -328,7 +328,7 @@ root_url = %(protocol)s://localhost:3000/grafana/
;cookie_samesite = lax
# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
;allow_embedding = false
allow_embedding = true
# Set to true if you want to enable http strict transport security (HSTS) response header.
# HSTS tells browsers that the site should only be accessed using HTTPS.