Update usage-dashboard/README.md
This commit is contained in:
@@ -110,32 +110,38 @@ pkill -f usage-dashboard.py
|
||||
|
||||
### Chạy như systemd service
|
||||
|
||||
Tạo file `/etc/systemd/system/cliproxy-dashboard.service`:
|
||||
Tạo file `~/.config/systemd/user/cliproxy-dashboard.service`:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
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]
|
||||
Type=simple
|
||||
User=admin
|
||||
WorkingDirectory=/home/admin/cliproxyapi/usage-dashboard
|
||||
ExecStart=/usr/bin/python3 /home/admin/cliproxyapi/usage-dashboard/usage-dashboard.py start --no-browser
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
# Changed to default.target for user services
|
||||
WantedBy=default.target
|
||||
|
||||
```
|
||||
|
||||
Kích hoạt service:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable cliproxy-dashboard
|
||||
sudo systemctl start cliproxy-dashboard
|
||||
sudo systemctl status cliproxy-dashboard
|
||||
sudo systemctl --user daemon-reload
|
||||
sudo systemctl --user enable cliproxy-dashboard
|
||||
sudo systemctl --user start cliproxy-dashboard
|
||||
sudo systemctl --user status cliproxy-dashboard
|
||||
```
|
||||
|
||||
## 📖 Hướng dẫn sử dụng Dashboard
|
||||
|
||||
Reference in New Issue
Block a user