Download web_panel.py from luci18/animebot: direct link, hf CLI and curl.
- Browser
- Download file 23.9 kB
-
https://huggingface.co/luci18/animebot/resolve/main/web_panel.py
- Command line
-
hf download hf://luci18/animebot/web_panel.py
-
curl -L -o web_panel.py https://huggingface.co/luci18/animebot/resolve/main/web_panel.py
23.9 kB
| """Web admin panel for Anime Encoder Bot.""" | |
| import os | |
| import json | |
| from datetime import datetime, timedelta | |
| from functools import wraps | |
| from pathlib import Path | |
| from flask import Flask, render_template, jsonify, request, redirect, url_for, session, flash | |
| from werkzeug.security import check_password_hash, generate_password_hash | |
| from config import Config | |
| from bot.database import db | |
| from bot.stats import stats_manager | |
| from bot.task_queue import task_queue | |
| app = Flask(__name__) | |
| app.secret_key = os.getenv('FLASK_SECRET_KEY', 'dev-secret-key-change-in-production') | |
| # Admin credentials (should be set via environment variables in production) | |
| ADMIN_USERNAME = os.getenv('ADMIN_USERNAME', 'admin') | |
| ADMIN_PASSWORD_HASH = os.getenv('ADMIN_PASSWORD_HASH', | |
| generate_password_hash('admin')) # Default: change in production! | |
| def login_required(f): | |
| """Decorator to require login for routes.""" | |
| def decorated_function(*args, **kwargs): | |
| if 'logged_in' not in session: | |
| return redirect(url_for('login')) | |
| return f(*args, **kwargs) | |
| return decorated_function | |
| def owner_required(f): | |
| """Decorator to require owner access.""" | |
| def decorated_function(*args, **kwargs): | |
| if 'logged_in' not in session: | |
| return redirect(url_for('login')) | |
| if session.get('user_id') != Config.OWNER_ID: | |
| flash('Owner access required', 'error') | |
| return redirect(url_for('dashboard')) | |
| return f(*args, **kwargs) | |
| return decorated_function | |
| def login(): | |
| """Login page.""" | |
| if request.method == 'POST': | |
| username = request.form.get('username') | |
| password = request.form.get('password') | |
| if username == ADMIN_USERNAME and check_password_hash(ADMIN_PASSWORD_HASH, password): | |
| session['logged_in'] = True | |
| session['user_id'] = Config.OWNER_ID | |
| session['username'] = username | |
| return redirect(url_for('dashboard')) | |
| else: | |
| flash('Invalid credentials', 'error') | |
| return render_template_string(LOGIN_TEMPLATE) | |
| def logout(): | |
| """Logout.""" | |
| session.clear() | |
| return redirect(url_for('login')) | |
| def dashboard(): | |
| """Main dashboard.""" | |
| stats = stats_manager.get_bot_stats() | |
| queue_status = task_queue.get_queue_status() | |
| return render_template_string(DASHBOARD_TEMPLATE, | |
| stats=stats, | |
| queue=queue_status, | |
| now=datetime.now()) | |
| def api_stats(): | |
| """API endpoint for stats.""" | |
| return jsonify(stats_manager.get_bot_stats()) | |
| def api_user_stats(user_id): | |
| """API endpoint for user stats.""" | |
| return jsonify(stats_manager.get_user_stats(user_id)) | |
| def api_queue(): | |
| """API endpoint for queue status.""" | |
| return jsonify(task_queue.get_queue_status()) | |
| def api_clear_queue(): | |
| """Clear queue (owner only).""" | |
| try: | |
| # Clear download queue | |
| while not task_queue.download_queue.empty(): | |
| try: | |
| task_queue.download_queue.get_nowait() | |
| task_queue.download_queue.task_done() | |
| except: | |
| break | |
| # Clear encode queue | |
| while not task_queue.encode_queue.empty(): | |
| try: | |
| task_queue.encode_queue.get_nowait() | |
| task_queue.encode_queue.task_done() | |
| except: | |
| break | |
| return jsonify({"success": True, "message": "Queues cleared"}) | |
| except Exception as e: | |
| return jsonify({"success": False, "error": str(e)}), 500 | |
| def users(): | |
| """User management page.""" | |
| # Get all users with their stats | |
| user_list = [] | |
| for user in db.users.find().sort("created_at", -1).limit(100): | |
| user_id = user.get("user_id") | |
| stats = stats_manager.get_user_stats(user_id) | |
| user_list.append({ | |
| "user_id": user_id, | |
| "username": user.get("username", "Unknown"), | |
| "created_at": user.get("created_at"), | |
| "stats": stats | |
| }) | |
| return render_template_string(USERS_TEMPLATE, users=user_list) | |
| def tasks(): | |
| """Task management page.""" | |
| # Get recent tasks | |
| recent_downloads = list(db.downloads.find().sort("created_at", -1).limit(50)) | |
| recent_encodes = list(db.encodes.find().sort("created_at", -1).limit(50)) | |
| return render_template_string(TASKS_TEMPLATE, | |
| downloads=recent_downloads, | |
| encodes=recent_encodes) | |
| def settings(): | |
| """Bot settings page (owner only).""" | |
| if request.method == 'POST': | |
| # Update settings (in a real app, you'd save these to a config file or DB) | |
| flash('Settings updated (demo only)', 'success') | |
| return render_template_string(SETTINGS_TEMPLATE, config=Config) | |
| def leaderboard(): | |
| """User leaderboard page.""" | |
| period = request.args.get('period', 'all') | |
| leaders = stats_manager.get_leaderboard(period) | |
| return render_template_string(LEADERBOARD_TEMPLATE, | |
| leaders=leaders, | |
| period=period) | |
| # HTML Templates (embedded for simplicity) | |
| LOGIN_TEMPLATE = """ | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Login - Anime Encoder Bot Admin</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; background: #1a1a2e; color: #fff; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } | |
| .login-box { background: #16213e; padding: 40px; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.3); } | |
| h1 { text-align: center; margin-bottom: 30px; } | |
| input { width: 100%; padding: 12px; margin: 10px 0; border: none; border-radius: 5px; background: #0f3460; color: #fff; } | |
| button { width: 100%; padding: 12px; background: #e94560; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; } | |
| button:hover { background: #c73e54; } | |
| .error { color: #e94560; text-align: center; margin-top: 10px; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="login-box"> | |
| <h1>π¬ Admin Login</h1> | |
| <form method="POST"> | |
| <input type="text" name="username" placeholder="Username" required> | |
| <input type="password" name="password" placeholder="Password" required> | |
| <button type="submit">Login</button> | |
| </form> | |
| {% with messages = get_flashed_messages(with_categories=true) %} | |
| {% if messages %} | |
| {% for category, message in messages %} | |
| <p class="error">{{ message }}</p> | |
| {% endfor %} | |
| {% endif %} | |
| {% endwith %} | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| DASHBOARD_TEMPLATE = """ | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Dashboard - Anime Encoder Bot</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; background: #1a1a2e; color: #fff; margin: 0; } | |
| .navbar { background: #16213e; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; } | |
| .navbar a { color: #fff; text-decoration: none; margin: 0 15px; } | |
| .navbar a:hover { color: #e94560; } | |
| .container { padding: 30px; max-width: 1400px; margin: 0 auto; } | |
| .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; } | |
| .stat-card { background: #16213e; padding: 20px; border-radius: 10px; } | |
| .stat-card h3 { margin-top: 0; color: #e94560; } | |
| .stat-value { font-size: 32px; font-weight: bold; } | |
| .queue-section { background: #16213e; padding: 20px; border-radius: 10px; margin-bottom: 30px; } | |
| .progress-bar { background: #0f3460; height: 20px; border-radius: 10px; overflow: hidden; } | |
| .progress-fill { background: #e94560; height: 100%; transition: width 0.3s; } | |
| table { width: 100%; border-collapse: collapse; margin-top: 20px; } | |
| th, td { padding: 12px; text-align: left; border-bottom: 1px solid #0f3460; } | |
| th { color: #e94560; } | |
| .status-badge { padding: 5px 10px; border-radius: 5px; font-size: 12px; } | |
| .status-completed { background: #4caf50; } | |
| .status-failed { background: #f44336; } | |
| .status-pending { background: #ff9800; } | |
| .refresh-btn { background: #e94560; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="navbar"> | |
| <div> | |
| <strong>π¬ Anime Encoder Bot</strong> | |
| </div> | |
| <div> | |
| <a href="/">Dashboard</a> | |
| <a href="/users">Users</a> | |
| <a href="/tasks">Tasks</a> | |
| <a href="/leaderboard">Leaderboard</a> | |
| <a href="/settings">Settings</a> | |
| <a href="/logout">Logout</a> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <h1>Dashboard</h1> | |
| <p>Last updated: {{ now.strftime('%Y-%m-%d %H:%M:%S') }}</p> | |
| <div class="stats-grid"> | |
| <div class="stat-card"> | |
| <h3>π₯ Total Users</h3> | |
| <div class="stat-value">{{ stats.overview.total_users }}</div> | |
| </div> | |
| <div class="stat-card"> | |
| <h3>π₯ Total Downloads</h3> | |
| <div class="stat-value">{{ stats.overview.total_downloads }}</div> | |
| </div> | |
| <div class="stat-card"> | |
| <h3>ποΈ Total Encodes</h3> | |
| <div class="stat-value">{{ stats.overview.total_encodes }}</div> | |
| </div> | |
| <div class="stat-card"> | |
| <h3>β‘ Active Downloads</h3> | |
| <div class="stat-value">{{ stats.overview.active_downloads }}</div> | |
| </div> | |
| <div class="stat-card"> | |
| <h3>β‘ Active Encodes</h3> | |
| <div class="stat-value">{{ stats.overview.active_encodes }}</div> | |
| </div> | |
| <div class="stat-card"> | |
| <h3>πΎ Storage Used</h3> | |
| <div class="stat-value">{{ stats.storage.total_gb }} GB</div> | |
| <small>{{ stats.storage.note }}</small> | |
| </div> | |
| </div> | |
| <div class="queue-section"> | |
| <h2>Queue Status</h2> | |
| <p>Download Queue: {{ queue.download_queue_size }} pending / {{ queue.active_downloads }} active</p> | |
| <div class="progress-bar"> | |
| <div class="progress-fill" style="width: {{ (queue.active_downloads / queue.max_downloads * 100) if queue.max_downloads > 0 else 0 }}%"></div> | |
| </div> | |
| <p style="margin-top: 15px;">Encode Queue: {{ queue.encode_queue_size }} pending / {{ queue.active_encodes }} active</p> | |
| <div class="progress-bar"> | |
| <div class="progress-fill" style="width: {{ (queue.active_encodes / queue.max_encodes * 100) if queue.max_encodes > 0 else 0 }}%"></div> | |
| </div> | |
| </div> | |
| <div class="queue-section"> | |
| <h2>Popular Anime</h2> | |
| <table> | |
| <tr> | |
| <th>Anime ID</th> | |
| <th>Downloads</th> | |
| </tr> | |
| {% for anime in stats.popular_anime %} | |
| <tr> | |
| <td>{{ anime._id }}</td> | |
| <td>{{ anime.downloads }}</td> | |
| </tr> | |
| {% endfor %} | |
| </table> | |
| </div> | |
| <button class="refresh-btn" onclick="location.reload()">π Refresh</button> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| USERS_TEMPLATE = """ | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Users - Anime Encoder Bot</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; background: #1a1a2e; color: #fff; margin: 0; } | |
| .navbar { background: #16213e; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; } | |
| .navbar a { color: #fff; text-decoration: none; margin: 0 15px; } | |
| .container { padding: 30px; max-width: 1400px; margin: 0 auto; } | |
| table { width: 100%; border-collapse: collapse; margin-top: 20px; background: #16213e; border-radius: 10px; overflow: hidden; } | |
| th, td { padding: 15px; text-align: left; border-bottom: 1px solid #0f3460; } | |
| th { background: #0f3460; color: #e94560; } | |
| tr:hover { background: #0f3460; } | |
| .stats { display: flex; gap: 15px; } | |
| .stat { background: #0f3460; padding: 5px 10px; border-radius: 5px; font-size: 12px; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="navbar"> | |
| <div><strong>π¬ Anime Encoder Bot</strong></div> | |
| <div> | |
| <a href="/">Dashboard</a> | |
| <a href="/users">Users</a> | |
| <a href="/tasks">Tasks</a> | |
| <a href="/leaderboard">Leaderboard</a> | |
| <a href="/logout">Logout</a> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <h1>π₯ Users</h1> | |
| <table> | |
| <tr> | |
| <th>User ID</th> | |
| <th>Username</th> | |
| <th>Joined</th> | |
| <th>Downloads</th> | |
| <th>Encodes</th> | |
| <th>Success Rate</th> | |
| </tr> | |
| {% for user in users %} | |
| <tr> | |
| <td>{{ user.user_id }}</td> | |
| <td>{{ user.username }}</td> | |
| <td>{{ user.created_at.strftime('%Y-%m-%d') if user.created_at else 'Unknown' }}</td> | |
| <td>{{ user.stats.downloads.total }}</td> | |
| <td>{{ user.stats.encodes.total }}</td> | |
| <td> | |
| <div class="stats"> | |
| <span class="stat">DL: {{ user.stats.downloads.success_rate }}%</span> | |
| <span class="stat">ENC: {{ user.stats.encodes.success_rate }}%</span> | |
| </div> | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| </table> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| TASKS_TEMPLATE = """ | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Tasks - Anime Encoder Bot</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; background: #1a1a2e; color: #fff; margin: 0; } | |
| .navbar { background: #16213e; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; } | |
| .navbar a { color: #fff; text-decoration: none; margin: 0 15px; } | |
| .container { padding: 30px; max-width: 1400px; margin: 0 auto; } | |
| table { width: 100%; border-collapse: collapse; margin-top: 20px; background: #16213e; border-radius: 10px; overflow: hidden; } | |
| th, td { padding: 12px; text-align: left; border-bottom: 1px solid #0f3460; } | |
| th { background: #0f3460; color: #e94560; } | |
| .tabs { display: flex; gap: 10px; margin-bottom: 20px; } | |
| .tab { padding: 10px 20px; background: #16213e; border-radius: 5px; cursor: pointer; } | |
| .tab.active { background: #e94560; } | |
| .status-completed { color: #4caf50; } | |
| .status-failed { color: #f44336; } | |
| .status-pending { color: #ff9800; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="navbar"> | |
| <div><strong>π¬ Anime Encoder Bot</strong></div> | |
| <div> | |
| <a href="/">Dashboard</a> | |
| <a href="/users">Users</a> | |
| <a href="/tasks">Tasks</a> | |
| <a href="/leaderboard">Leaderboard</a> | |
| <a href="/logout">Logout</a> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <h1>π Recent Tasks</h1> | |
| <h2>Downloads</h2> | |
| <table> | |
| <tr> | |
| <th>Task ID</th> | |
| <th>User ID</th> | |
| <th>Anime</th> | |
| <th>Episode</th> | |
| <th>Status</th> | |
| <th>Created</th> | |
| </tr> | |
| {% for task in downloads %} | |
| <tr> | |
| <td>{{ task.task_id[:8] }}...</td> | |
| <td>{{ task.user_id }}</td> | |
| <td>{{ task.anime_id[:30] if task.anime_id else 'N/A' }}...</td> | |
| <td>{{ task.episode_num }}</td> | |
| <td class="status-{{ task.status }}">{{ task.status }}</td> | |
| <td>{{ task.created_at.strftime('%Y-%m-%d %H:%M') if task.created_at else 'Unknown' }}</td> | |
| </tr> | |
| {% endfor %} | |
| </table> | |
| <h2 style="margin-top: 30px;">Encodes</h2> | |
| <table> | |
| <tr> | |
| <th>Task ID</th> | |
| <th>User ID</th> | |
| <th>Input File</th> | |
| <th>Status</th> | |
| <th>Progress</th> | |
| <th>Created</th> | |
| </tr> | |
| {% for task in encodes %} | |
| <tr> | |
| <td>{{ task.task_id[:8] }}...</td> | |
| <td>{{ task.user_id }}</td> | |
| <td>{{ task.input_path[:30] if task.input_path else 'N/A' }}...</td> | |
| <td class="status-{{ task.status }}">{{ task.status }}</td> | |
| <td>{{ task.progress }}%</td> | |
| <td>{{ task.created_at.strftime('%Y-%m-%d %H:%M') if task.created_at else 'Unknown' }}</td> | |
| </tr> | |
| {% endfor %} | |
| </table> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| LEADERBOARD_TEMPLATE = """ | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Leaderboard - Anime Encoder Bot</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; background: #1a1a2e; color: #fff; margin: 0; } | |
| .navbar { background: #16213e; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; } | |
| .navbar a { color: #fff; text-decoration: none; margin: 0 15px; } | |
| .container { padding: 30px; max-width: 1000px; margin: 0 auto; } | |
| .tabs { display: flex; gap: 10px; margin-bottom: 20px; } | |
| .tab { padding: 10px 20px; background: #16213e; border-radius: 5px; text-decoration: none; color: #fff; } | |
| .tab.active { background: #e94560; } | |
| .leaderboard { background: #16213e; border-radius: 10px; overflow: hidden; } | |
| .leader { display: flex; align-items: center; padding: 20px; border-bottom: 1px solid #0f3460; } | |
| .rank { font-size: 24px; font-weight: bold; width: 50px; color: #e94560; } | |
| .user-info { flex: 1; } | |
| .user-id { font-size: 14px; color: #888; } | |
| .stats { display: flex; gap: 20px; } | |
| .stat { text-align: center; } | |
| .stat-value { font-size: 20px; font-weight: bold; color: #e94560; } | |
| .stat-label { font-size: 12px; color: #888; } | |
| .medal { font-size: 30px; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="navbar"> | |
| <div><strong>π¬ Anime Encoder Bot</strong></div> | |
| <div> | |
| <a href="/">Dashboard</a> | |
| <a href="/users">Users</a> | |
| <a href="/tasks">Tasks</a> | |
| <a href="/leaderboard">Leaderboard</a> | |
| <a href="/logout">Logout</a> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <h1>π Leaderboard</h1> | |
| <div class="tabs"> | |
| <a href="/leaderboard?period=all" class="tab {{ 'active' if period == 'all' else '' }}">All Time</a> | |
| <a href="/leaderboard?period=month" class="tab {{ 'active' if period == 'month' else '' }}">This Month</a> | |
| <a href="/leaderboard?period=week" class="tab {{ 'active' if period == 'week' else '' }}">This Week</a> | |
| </div> | |
| <div class="leaderboard"> | |
| {% for leader in leaders %} | |
| <div class="leader"> | |
| <div class="rank"> | |
| {% if loop.index == 1 %}π₯{% elif loop.index == 2 %}π₯{% elif loop.index == 3 %}π₯{% else %}{{ loop.index }}{% endif %} | |
| </div> | |
| <div class="user-info"> | |
| <div>User {{ leader.user_id }}</div> | |
| <div class="user-id">ID: {{ leader.user_id }}</div> | |
| </div> | |
| <div class="stats"> | |
| <div class="stat"> | |
| <div class="stat-value">{{ leader.downloads }}</div> | |
| <div class="stat-label">Downloads</div> | |
| </div> | |
| <div class="stat"> | |
| <div class="stat-value">{{ leader.encodes }}</div> | |
| <div class="stat-label">Encodes</div> | |
| </div> | |
| <div class="stat"> | |
| <div class="stat-value">{{ leader.total }}</div> | |
| <div class="stat-label">Total</div> | |
| </div> | |
| </div> | |
| </div> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| SETTINGS_TEMPLATE = """ | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Settings - Anime Encoder Bot</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; background: #1a1a2e; color: #fff; margin: 0; } | |
| .navbar { background: #16213e; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; } | |
| .navbar a { color: #fff; text-decoration: none; margin: 0 15px; } | |
| .container { padding: 30px; max-width: 800px; margin: 0 auto; } | |
| .setting-group { background: #16213e; padding: 20px; border-radius: 10px; margin-bottom: 20px; } | |
| .setting { margin: 15px 0; } | |
| label { display: block; margin-bottom: 5px; color: #e94560; } | |
| input, select { width: 100%; padding: 10px; background: #0f3460; border: none; border-radius: 5px; color: #fff; } | |
| button { background: #e94560; color: #fff; border: none; padding: 12px 30px; border-radius: 5px; cursor: pointer; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="navbar"> | |
| <div><strong>π¬ Anime Encoder Bot</strong></div> | |
| <div> | |
| <a href="/">Dashboard</a> | |
| <a href="/users">Users</a> | |
| <a href="/tasks">Tasks</a> | |
| <a href="/leaderboard">Leaderboard</a> | |
| <a href="/logout">Logout</a> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <h1>βοΈ Bot Settings</h1> | |
| <form method="POST"> | |
| <div class="setting-group"> | |
| <h3>Queue Settings</h3> | |
| <div class="setting"> | |
| <label>Max Concurrent Downloads</label> | |
| <input type="number" value="{{ config.MAX_CONCURRENT_DOWNLOADS }}" disabled> | |
| </div> | |
| <div class="setting"> | |
| <label>Max Concurrent Encodes</label> | |
| <input type="number" value="{{ config.MAX_CONCURRENT_ENCODINGS }}" disabled> | |
| </div> | |
| </div> | |
| <div class="setting-group"> | |
| <h3>Default Encoding</h3> | |
| <div class="setting"> | |
| <label>Default Codec</label> | |
| <input type="text" value="{{ config.DEFAULT_CODEC }}" disabled> | |
| </div> | |
| <div class="setting"> | |
| <label>Default CRF</label> | |
| <input type="number" value="{{ config.DEFAULT_CRF }}" disabled> | |
| </div> | |
| </div> | |
| <p style="color: #888;">Note: Settings are read-only in demo mode. Edit .env file to change values.</p> | |
| <button type="submit">Save (Demo)</button> | |
| </form> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| def run_panel(host='0.0.0.0', port=5000, debug=False): | |
| """Run the web panel.""" | |
| app.run(host=host, port=port, debug=debug) | |
| if __name__ == '__main__': | |
| run_panel(debug=True) | |