- Rewrite theme system
- Fixes
This commit is contained in:
Takeus committed 2025-06-17 09:45:52 +02:00
1 parent 98ffa929ef
commit 1f32755ade
10 files changed
+40 -22

No files matched your search

+11 -4
View File
@@ -28,7 +28,6 @@ def dashboard():
for available_ip in Network.query.all():
available_alloc += int(available_ip.hosts)
print(app_theme)
return render_template(
'panel/dashboard.html',
title="Dashboard",
@@ -41,6 +40,14 @@ def dashboard():
available_alloc=available_alloc,
db_users=db_users,
Inventory=Inventory,
navcolor='dark',
app_theme=app_theme
)
navcolor='dark'
)
@base.route("/theme/<string:name>",methods=['GET','POST'])
@login_required
def change_theme(name):
if name in app_theme:
current_user.ui_theme = name
db.session.commit()
return redirect(url_for('base.dashboard'))
return 'Invalid theme name', 400