Files
vps_monitoring/server/templates/dashboard.html
Андрей Бобырев e6e88314d5 feat: initial VPS monitoring platform
- FastAPI backend with auth, server CRUD, metrics collection
- Web dashboard with dark theme, server cards, SSH terminal (xterm.js)
- Telegram bot with inline keyboards, server management, reboot
- Telegram Mini App for mobile monitoring
- Background monitoring via asyncssh (CPU, RAM, Disk, Network, Uptime)
- Alert system with configurable thresholds
- WebSocket SSH terminal in browser
- One-command install script
- Systemd service configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 05:47:28 +03:00

158 lines
6.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VPS Monitoring</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/xterm/5.3.0/xterm.min.css">
</head>
<body>
<header>
<div class="header-left">
<h1>🖥 VPS Monitoring</h1>
</div>
<div class="header-right">
<button class="btn-icon" onclick="refreshAll()" title="Обновить">🔄</button>
<button class="btn-icon" onclick="showSettings()" title="Настройки">⚙️</button>
<button class="btn-icon" onclick="logout()" title="Выход">🚪</button>
</div>
</header>
<main>
<div class="stats-bar">
<div class="stat-item" id="stat-total">
<span class="stat-label">Всего</span>
<span class="stat-value" id="total-count">0</span>
</div>
<div class="stat-item online" id="stat-online">
<span class="stat-label">Online</span>
<span class="stat-value" id="online-count">0</span>
</div>
<div class="stat-item offline" id="stat-offline">
<span class="stat-label">Offline</span>
<span class="stat-value" id="offline-count">0</span>
</div>
</div>
<div class="toolbar">
<button class="btn-primary" onclick="showAddServer()">+ Добавить сервер</button>
</div>
<div class="servers-grid" id="servers-grid">
<!-- Server cards rendered here -->
</div>
</main>
<!-- Add Server Modal -->
<div class="modal" id="addServerModal" style="display:none">
<div class="modal-content">
<div class="modal-header">
<h2>Добавить сервер</h2>
<button class="btn-close" onclick="closeModal('addServerModal')">&times;</button>
</div>
<form id="addServerForm">
<div class="form-group">
<label>Название</label>
<input type="text" name="name" required placeholder="My Server">
</div>
<div class="form-group">
<label>IP / Host</label>
<input type="text" name="host" required placeholder="192.168.1.1">
</div>
<div class="form-group">
<label>Порт SSH</label>
<input type="number" name="port" value="22">
</div>
<div class="form-group">
<label>Логин</label>
<input type="text" name="username" value="root">
</div>
<div class="form-group">
<label>Пароль</label>
<input type="password" name="password" placeholder="Пароль SSH">
</div>
<div class="form-group">
<label>Описание</label>
<input type="text" name="description" placeholder="Описание сервера">
</div>
<button type="submit" class="btn-primary">Добавить</button>
</form>
</div>
</div>
<!-- Settings Modal -->
<div class="modal" id="settingsModal" style="display:none">
<div class="modal-content">
<div class="modal-header">
<h2>Настройки</h2>
<button class="btn-close" onclick="closeModal('settingsModal')">&times;</button>
</div>
<form id="settingsForm">
<h3>Авторизация</h3>
<div class="form-group">
<label>Логин</label>
<input type="text" name="admin_login" id="set_login">
</div>
<div class="form-group">
<label>Новый пароль</label>
<input type="password" name="admin_password" id="set_password" placeholder="Оставьте пустым, чтобы не менять">
</div>
<h3>Telegram</h3>
<div class="form-group">
<label>Bot Token</label>
<input type="text" name="telegram_bot_token" id="set_tg_token">
</div>
<div class="form-group">
<label>Chat ID</label>
<input type="text" name="telegram_chat_id" id="set_tg_chat">
</div>
<h3>Мониторинг</h3>
<div class="form-group">
<label>Интервал опроса (сек)</label>
<input type="number" name="monitor_interval" id="set_interval" value="60">
</div>
<div class="form-group">
<label>Порог CPU (%)</label>
<input type="number" name="alert_cpu_threshold" id="set_cpu" value="90">
</div>
<div class="form-group">
<label>Порог RAM (%)</label>
<input type="number" name="alert_ram_threshold" id="set_ram" value="90">
</div>
<div class="form-group">
<label>Порог Disk (%)</label>
<input type="number" name="alert_disk_threshold" id="set_disk" value="90">
</div>
<button type="submit" class="btn-primary">Сохранить</button>
</form>
</div>
</div>
<!-- SSH Terminal Modal -->
<div class="modal" id="sshModal" style="display:none">
<div class="modal-content modal-large">
<div class="modal-header">
<h2 id="ssh-title">SSH Terminal</h2>
<button class="btn-close" onclick="closeSSH()">&times;</button>
</div>
<div id="terminal-container"></div>
</div>
</div>
<!-- Server Detail Modal -->
<div class="modal" id="serverDetailModal" style="display:none">
<div class="modal-content">
<div class="modal-header">
<h2 id="detail-title">Server</h2>
<button class="btn-close" onclick="closeModal('serverDetailModal')">&times;</button>
</div>
<div id="detail-content"></div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xterm/5.3.0/xterm.min.js"></script>
<script src="/static/js/app.js"></script>
</body>
</html>