mirror of
https://github.com/andrey271192/vps_monitoring.git
synced 2026-09-20 11:55:34 +00:00
feat: add PC monitoring tab with Windows agent
- New /api/pc endpoints (heartbeat, list, delete) - Dashboard tabs: Серверы / ПК with auto-refresh - PowerShell agent: CPU, RAM, Disk, Network, GPU, Top processes - One-command Windows installer with Scheduled Task - PC setup instructions modal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,11 +40,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toolbar">
|
||||
<button class="btn-primary" id="addServerBtn" onclick="showAddServer()">+ Добавить сервер</button>
|
||||
<!-- Tabs -->
|
||||
<div class="tabs">
|
||||
<button class="tab active" id="tab-servers" onclick="switchTab('servers')">🖥 Серверы</button>
|
||||
<button class="tab" id="tab-pc" onclick="switchTab('pc')">💻 ПК</button>
|
||||
</div>
|
||||
|
||||
<div class="servers-grid" id="servers-grid"></div>
|
||||
<!-- Servers Tab -->
|
||||
<div id="panel-servers">
|
||||
<div class="toolbar">
|
||||
<button class="btn-primary" id="addServerBtn" onclick="showAddServer()">+ Добавить сервер</button>
|
||||
</div>
|
||||
<div class="servers-grid" id="servers-grid"></div>
|
||||
</div>
|
||||
|
||||
<!-- PC Tab -->
|
||||
<div id="panel-pc" style="display:none">
|
||||
<div class="toolbar">
|
||||
<button class="btn-secondary" onclick="showPCSetup()">📋 Инструкция установки</button>
|
||||
<button class="btn-secondary" onclick="loadPCs()">🔄 Обновить</button>
|
||||
</div>
|
||||
<div class="servers-grid" id="pc-grid"></div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Add Server Modal -->
|
||||
@@ -165,6 +182,46 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PC Setup Modal -->
|
||||
<div class="modal" id="pcSetupModal" style="display:none">
|
||||
<div class="modal-content modal-wide">
|
||||
<div class="modal-header">
|
||||
<h2>💻 Установка агента на ПК</h2>
|
||||
<button class="btn-close" onclick="closeModal('pcSetupModal')">×</button>
|
||||
</div>
|
||||
<div class="instructions-section">
|
||||
<div class="instr-card">
|
||||
<h4>📥 Быстрая установка (PowerShell от Администратора)</h4>
|
||||
<code id="pc-install-cmd">powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri 'http://77.239.126.123:7272/static/downloads/install_agent.ps1' -OutFile install_agent.ps1; .\install_agent.ps1 -ServerUrl 'http://77.239.126.123:7272' -AgentName 'MyPC'"</code>
|
||||
</div>
|
||||
<div class="instr-card">
|
||||
<h4>⚙️ Параметры</h4>
|
||||
<p><b>-ServerUrl</b> — адрес сервера мониторинга<br>
|
||||
<b>-AgentName</b> — имя ПК (по умолчанию hostname)<br>
|
||||
<b>-Interval</b> — интервал отправки в секундах (по умолчанию 60)</p>
|
||||
</div>
|
||||
<div class="instr-card">
|
||||
<h4>📊 Что мониторится</h4>
|
||||
<p>CPU, RAM, Disk (все диски), Network, GPU, Uptime, Top 5 процессов</p>
|
||||
</div>
|
||||
<div class="instr-card">
|
||||
<h4>🔧 Управление</h4>
|
||||
<ul class="cmd-list">
|
||||
<li>Get-ScheduledTask 'VPS-Monitor-Agent'</li>
|
||||
<li>Stop-ScheduledTask 'VPS-Monitor-Agent'</li>
|
||||
<li>Start-ScheduledTask 'VPS-Monitor-Agent'</li>
|
||||
<li>Unregister-ScheduledTask 'VPS-Monitor-Agent'</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="instr-card">
|
||||
<h4>📁 Файлы</h4>
|
||||
<p>Агент: <code style="display:inline">C:\VPS-Monitor\vps_monitor_agent.ps1</code><br>
|
||||
Конфиг: <code style="display:inline">C:\VPS-Monitor\agent_config.json</code></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="app-footer">
|
||||
автор: <a href="https://github.com/andrey271192" target="_blank">GitHub</a> · <a href="https://boosty.to/iot_andrey" target="_blank">Boosty</a> · <a href="https://t.me/Iot_andrey" target="_blank">Поддержка</a> · <a href="https://t.me/Iot_andrey" target="_blank">@Iot_andrey</a>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user