modified: templates/index.html
modified: templates/logs.html
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Panel</title>
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container mt-5">
|
||||
<h1 class="text-center">Discord Bot Admin Panel</h1>
|
||||
@@ -17,15 +19,21 @@
|
||||
{{ "Running" if bot_running else "Stopped" }}
|
||||
</span>
|
||||
</p>
|
||||
<a href="{{ url_for('start') }}" class="btn btn-primary btn-block {{ 'disabled' if bot_running else '' }}">Start Bot</a>
|
||||
<a href="{{ url_for('stop') }}" class="btn btn-danger btn-block {{ 'disabled' if not bot_running else '' }}">Stop Bot</a>
|
||||
<a href="{{ url_for('start') }}"
|
||||
class="btn btn-primary btn-block {{ 'disabled' if bot_running else '' }}">Start Bot</a>
|
||||
<a href="{{ url_for('stop') }}"
|
||||
class="btn btn-danger btn-block {{ 'disabled' if not bot_running else '' }}">Stop Bot</a>
|
||||
<a href="{{ url_for('settings') }}" class="btn btn-secondary btn-block">Settings</a>
|
||||
<a href="{{ url_for('users') }}" class="btn btn-info btn-block">User Management</a>
|
||||
<a href="{{ url_for('logout') }}" class="btn btn-outline-secondary btn-block">Logout</a>
|
||||
<h5 class="card-title">Bot Statistics</h5>
|
||||
<p class="card-text">Total Messages Processed: {{ total_messages }}</p>
|
||||
<p class="card-text">Most Used Command: {{ most_used_command }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,11 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bot Logs</title>
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container mt-5">
|
||||
<h1 class="text-center">Bot Logs</h1>
|
||||
@@ -15,18 +17,19 @@
|
||||
<a href="{{ url_for('download_logs') }}" class="btn btn-secondary mb-3">Download Logs</a>
|
||||
<button class="btn btn-warning mb-3" onclick="archiveLogs()">Archive Logs</button>
|
||||
|
||||
<script>
|
||||
function archiveLogs() {
|
||||
fetch('{{ url_for("archive_logs") }}', { method: "POST" })
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
alert(data.message);
|
||||
refreshLogs();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function archiveLogs() {
|
||||
fetch('{{ url_for("archive_logs") }}', { method: "POST" })
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
alert(data.message);
|
||||
refreshLogs();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<pre id="log-content" style="height: 500px; overflow-y: scroll; background-color: #f8f9fa; padding: 10px; border: 1px solid #ddd;"></pre>
|
||||
<pre id="log-content"
|
||||
style="height: 500px; overflow-y: scroll; background-color: #f8f9fa; padding: 10px; border: 1px solid #ddd;"></pre>
|
||||
<a href="{{ url_for('index') }}" class="btn btn-secondary btn-block mt-3">Back to Dashboard</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,4 +48,5 @@
|
||||
window.onload = refreshLogs;
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user