Files
Discord-ai-chatbot/templates/logs.html
2024-09-03 13:45:33 +02:00

39 lines
1.5 KiB
HTML

<!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>
<div class="card mt-4">
<div class="card-body">
<button class="btn btn-primary mb-3" onclick="refreshLogs()">Refresh Logs</button>
<a href="{{ url_for('download_logs') }}" class="btn btn-secondary mb-3">Download Logs</a>
<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>
</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>
<script>
function refreshLogs() {
fetch('{{ url_for("get_logs") }}')
.then(response => response.json())
.then(data => {
document.getElementById("log-content").textContent = data.logs;
});
}
window.onload = refreshLogs;
</script>
</body>
</html>