Remove useless settings pages

This commit is contained in:
Michał 2023-04-20 13:57:37 +00:00
parent 5f58575fd5
commit f3e1afa0bc
6 changed files with 3 additions and 90 deletions

View file

@ -16,14 +16,7 @@
</div> </div>
</div> </div>
<div class="settings-nav">
<a href="{{ url_for('settings.general') }}" class="settings-nav__item {% block settings_general %}{% endblock %}">General</a>
<a href="{{ url_for('settings.server') }}" class="settings-nav__item {% block settings_server %}{% endblock %}">Server</a>
<a href="{{ url_for('settings.account') }}" class="settings-nav__item {% block settings_account %}{% endblock %}">Account</a>
<a href="{{ url_for('settings.logs') }}" class="settings-nav__item {% block settings_logs %}{% endblock %}">Logs</a>
</div>
<div class="settings-content"> <div class="settings-content">
{% block settings_content %}{% endblock %} <h1>Gwa Gwa</h1>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,12 +0,0 @@
{% extends 'settings/settings_layout.html' %}
{% block settings_account %}settings-nav__item-selected{% endblock %}
{% block settings_content %}
<h2>Account</h2>
<p>Is session fresh?</p>
{% if fresh %}
<p>Yes</p>
{% else %}
<p>No</p>
{% endif %}
{% endblock %}

View file

@ -1,6 +0,0 @@
{% extends 'settings/settings_layout.html' %}
{% block settings_general %}settings-nav__item-selected{% endblock %}
{% block settings_content %}
<h2>General</h2>
{% endblock %}

View file

@ -1,30 +0,0 @@
{% extends 'settings/settings_layout.html' %}
{% block settings_logs %}settings-nav__item-selected{% endblock %}
{% block settings_content %}
<h2>Logs</h2>
<div class="settings-list" id="logs">
<div class="log" style="display:flex;flex-direction:row;gap:0.5rem;"></div>
</div>
{% endblock %}
{% block script %}
<script>
const output = document.getElementById('logs');
setInterval(function() {
$.ajax({
url: '{{ url_for('api.logfile') }}',
type: 'GET',
dataType: "json",
success: function(response) {
// for each item in response, log to console
response.forEach(function(item) {
console.log(item);
});
}
});
}, 1000); // 10 seconds
</script>
{% endblock %}

View file

@ -1,6 +0,0 @@
{% extends 'settings/settings_layout.html' %}
{% block settings_server %}settings-nav__item-selected{% endblock %}
{% block settings_content %}
<h2>Server</h2>
{% endblock %}

View file

@ -4,6 +4,7 @@ OnlyLegs - Settings page
from flask import Blueprint, render_template from flask import Blueprint, render_template
from flask_login import login_required from flask_login import login_required
blueprint = Blueprint("settings", __name__, url_prefix="/settings") blueprint = Blueprint("settings", __name__, url_prefix="/settings")
@ -13,31 +14,4 @@ def general():
""" """
General settings page General settings page
""" """
return render_template("settings/general.html") return render_template("settings.html")
@blueprint.route("/server")
@login_required
def server():
"""
Server settings page
"""
return render_template("settings/server.html")
@blueprint.route("/account")
@login_required
def account():
"""
Account settings page
"""
return render_template("settings/account.html")
@blueprint.route("/logs")
@login_required
def logs():
"""
Logs settings page
"""
return render_template("settings/logs.html")