Add web config

This commit is contained in:
Nirvana
2025-12-12 14:44:51 +01:00
parent e07c31605a
commit 8e82bd452a
2 changed files with 16 additions and 2 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ultimate Backend Configuration</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="./config.css">
<link rel="stylesheet" href="/config.css">
</head>
<body>
<div class="container">
@@ -148,6 +148,6 @@
</div>
</div>
<script src="./config.js"></script>
<script src="/config.js"></script>
</body>
</html>
+14
View File
@@ -1850,6 +1850,20 @@ class UltimateService:
response.content_type = 'text/html; charset=utf-8'
return self.config_html
@app.route('/config.css')
def serve_config_css():
"""Serve the CSS file"""
css_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'resources', 'web', 'config.css')
return send_file(css_path, mimetype='text/css')
@app.route('/config.js')
def serve_config_js():
"""Serve the JavaScript file"""
js_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'resources', 'web', 'config.js')
return send_file(js_path, mimetype='application/javascript')
@self.app.route('/')
def serve_root():
"""Redirect root to config page"""