Update usage-dashboard/README.md

This commit is contained in:
2026-07-03 22:02:17 +07:00
parent 0ce318edc9
commit ce0d83c281
+14 -8
View File
@@ -110,32 +110,38 @@ pkill -f usage-dashboard.py
### Chạy như systemd service ### Chạy như systemd service
Tạo file `/etc/systemd/system/cliproxy-dashboard.service`: Tạo file `~/.config/systemd/user/cliproxy-dashboard.service`:
```ini ```ini
[Unit] [Unit]
Description=CLIProxyAPI Usage Dashboard Description=CLIProxyAPI Usage Dashboard
After=network.target # Added cliproxyapi.service to After= to ensure it starts AFTER the API
After=network.target cliproxyapi.service
# Requires= means if the API stops, this dashboard will also stop.
# If you want the dashboard to stay running even if the API crashes temporarily,
# change Requires= to Wants=
Requires=cliproxyapi.service
[Service] [Service]
Type=simple Type=simple
User=admin
WorkingDirectory=/home/admin/cliproxyapi/usage-dashboard WorkingDirectory=/home/admin/cliproxyapi/usage-dashboard
ExecStart=/usr/bin/python3 /home/admin/cliproxyapi/usage-dashboard/usage-dashboard.py start --no-browser ExecStart=/usr/bin/python3 /home/admin/cliproxyapi/usage-dashboard/usage-dashboard.py start --no-browser
Restart=always Restart=always
RestartSec=10 RestartSec=10
[Install] [Install]
WantedBy=multi-user.target # Changed to default.target for user services
WantedBy=default.target
``` ```
Kích hoạt service: Kích hoạt service:
```bash ```bash
sudo systemctl daemon-reload sudo systemctl --user daemon-reload
sudo systemctl enable cliproxy-dashboard sudo systemctl --user enable cliproxy-dashboard
sudo systemctl start cliproxy-dashboard sudo systemctl --user start cliproxy-dashboard
sudo systemctl status cliproxy-dashboard sudo systemctl --user status cliproxy-dashboard
``` ```
## 📖 Hướng dẫn sử dụng Dashboard ## 📖 Hướng dẫn sử dụng Dashboard