mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 08:40:20 +00:00
refactor: rename monitor -> service
This commit is contained in:
1 parent
d4be2a0bcf
commit
eae12d8df2
16 files changed
+260
-657
No files matched your search
@@ -4,24 +4,6 @@ const (
|
||||
ApiErrorUnauthorized = 10001
|
||||
)
|
||||
|
||||
type ServiceItemResponse struct {
|
||||
Monitor *Monitor
|
||||
CurrentUp uint64
|
||||
CurrentDown uint64
|
||||
TotalUp uint64
|
||||
TotalDown uint64
|
||||
Delay *[30]float32
|
||||
Up *[30]int
|
||||
Down *[30]int
|
||||
}
|
||||
|
||||
func (r ServiceItemResponse) TotalUptime() float32 {
|
||||
if r.TotalUp+r.TotalDown == 0 {
|
||||
return 0
|
||||
}
|
||||
return float32(r.TotalUp) / (float32(r.TotalUp + r.TotalDown)) * 100
|
||||
}
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
|
||||
Reference in new issue
Block a user