mirror of
https://github.com/snowykami/server-status-client.git
synced 2026-04-22 18:05:38 +00:00
Compare commits
5 Commits
v1.1.1
...
3fa94f653d
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fa94f653d | |||
| 4cb1fcdb21 | |||
| 657cd1a80f | |||
| 3d14b5a18e | |||
| 2c3cda6e46 |
10
README.md
10
README.md
@@ -32,7 +32,15 @@ sudo apt install pipx
|
|||||||
sudo pipx install server-status
|
sudo pipx install server-status
|
||||||
```
|
```
|
||||||
|
|
||||||
若出现环境问题,请从 Actions 下载构建好的二进制文件
|
若出现环境问题,手动部署
|
||||||
|
```yaml
|
||||||
|
git clone https://github.com/snowykami/server-status-client.git
|
||||||
|
python -m venv .venv
|
||||||
|
source .venv/bin/activate
|
||||||
|
pip install pdm
|
||||||
|
pdm install
|
||||||
|
python main.py --your-args
|
||||||
|
```
|
||||||
|
|
||||||
## 🎉 使用
|
## 🎉 使用
|
||||||
|
|
||||||
|
|||||||
@@ -136,13 +136,13 @@ class Client:
|
|||||||
self.link = link
|
self.link = link
|
||||||
self.interval = interval
|
self.interval = interval
|
||||||
|
|
||||||
|
self.start_time = psutil.boot_time()
|
||||||
self.hardware = Hardware()
|
self.hardware = Hardware()
|
||||||
|
|
||||||
log("Client initialized",
|
log("Client initialized",
|
||||||
f"Name: {self.name}({self.client_id}), Location: {self.location}, Labels: {self.labels}")
|
f"Name: {self.name}({self.client_id}), Location: {self.location}, Labels: {self.labels}")
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self.start_time = time.time()
|
|
||||||
self.observe()
|
self.observe()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -187,6 +187,7 @@ class Client:
|
|||||||
"labels": self.labels,
|
"labels": self.labels,
|
||||||
"location": self.location,
|
"location": self.location,
|
||||||
"uptime": int(time.time() - self.start_time),
|
"uptime": int(time.time() - self.start_time),
|
||||||
|
"start_time": int(self.start_time), # 系统启动的时间
|
||||||
"link": self.link,
|
"link": self.link,
|
||||||
"observed_at": int(time.time()),
|
"observed_at": int(time.time()),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user