This commit is contained in:
mcinj 2022-05-20 23:42:42 -04:00
parent 3005228416
commit 6a5e679aec
3 changed files with 15 additions and 6 deletions

View file

@ -11,7 +11,8 @@
<strong><nav> <strong><nav>
<ul class="menu"> <ul class="menu">
<li><a href="{{ url_for('config') }}">Config</a></li> <li><a href="{{ url_for('config') }}">Config</a></li>
<li><a href="{{ url_for('logs') }}">Logs</a></li> <li><a href="{{ url_for('log_info') }}">Info Logs</a></li>
<li><a href="{{ url_for('log_debug') }}">Debug Logs</a></li>
</ul> </ul>
</nav></strong> </nav></strong>
</div> </div>

View file

@ -11,7 +11,8 @@
<strong><nav> <strong><nav>
<ul class="menu"> <ul class="menu">
<li><a href="{{ url_for('config') }}">Config</a></li> <li><a href="{{ url_for('config') }}">Config</a></li>
<li><a href="{{ url_for('logs') }}">Logs</a></li> <li><a href="{{ url_for('log_info') }}">Info Logs</a></li>
<li><a href="{{ url_for('log_debug') }}">Debug Logs</a></li>
</ul> </ul>
</nav></strong> </nav></strong>
</div> </div>

View file

@ -1,3 +1,4 @@
import os
import threading import threading
from threading import Thread from threading import Thread
@ -38,13 +39,19 @@ class WebServerThread(threading.Thread):
@app.route(f"{self.app_root}") @app.route(f"{self.app_root}")
def config(): def config():
with open('../config/config.ini', 'r') as f: with open(f"{os.getenv('BOT_CONFIG_DIR', './config')}/config.ini", 'r') as f:
content = f.read() content = f.read()
return render_template('configuration.html', content=content) return render_template('configuration.html', content=content)
@app.route(f"{self.app_root}log") @app.route(f"{self.app_root}log_info")
def logs(): def log_info():
with open('../config/info.log', 'r') as f: with open(f"{os.getenv('BOT_CONFIG_DIR', './config')}/info.log", 'r') as f:
content = f.read()
return render_template('log.html', content=content)
@app.route(f"{self.app_root}log_debug")
def log_debug():
with open(f"{os.getenv('BOT_CONFIG_DIR', './config')}/debug.log", 'r') as f:
content = f.read() content = f.read()
return render_template('log.html', content=content) return render_template('log.html', content=content)