Add system control feature for remote shutdown/restart with timer support and UI integration

This commit is contained in:
Din
2025-08-08 11:52:12 +08:00
parent 5ece1fbe27
commit 1129f9a2b1
4 changed files with 302 additions and 1 deletions
+24 -1
View File
@@ -47,7 +47,30 @@ Access the interactive web dashboard at `http://localhost:5000` featuring:
- **Process Management**: View top processes with CPU/memory percentages, terminate processes via API
- **Smart Alerting**: Duration-based alerting to prevent false positives
- **Telegram Bot Integration**: Real-time alerts via Telegram bot with customizable notifications
- **System Control**: Remote shutdown/restart capabilities
- **System Control**: Remote shutdown/restart capabilities with timer support (hidden feature)
### 🔐 Hidden System Control Feature
For security reasons, the system control feature is hidden by default. To access it:
**Activation Methods:**
1. **Triple-click** on the "Resource Monitor" title in the navigation bar
2. **Keyboard shortcut**: `Ctrl + Shift + P`
**Features:**
- **Shutdown**: Graceful or forced system shutdown
- **Restart**: System restart with optional force
- **Timer Support**: Delay execution from 0 to 86400 seconds (24 hours)
- **Safety Confirmations**: Multiple confirmation dialogs before execution
**Usage:**
1. Activate the system control button using one of the methods above
2. Click the red "System" button that appears in the navigation
3. Set optional timer (leave empty for immediate action)
4. Choose shutdown or restart
5. Confirm the action
⚠️ **Warning**: Use this feature with extreme caution as it will shut down or restart the entire system.
- **Health Monitoring**: Comprehensive health checks and uptime tracking
- **Real-time Metrics**: CPU usage calculation and memory percentage tracking for processes