Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f75847d3d7 | ||
|
|
eee3225f3a | ||
|
|
aa9eb533ad | ||
|
|
cf9bbb5ff4 | ||
|
|
65dee23137 | ||
|
|
feb4659cab | ||
|
|
bc7791efd2 | ||
|
|
6e6ec3256f | ||
|
|
ce66f72cf9 | ||
|
|
0ed7436176 | ||
|
|
2aabe1bd61 | ||
|
|
db5e94d0de | ||
|
|
3eecdc2b3f | ||
|
|
b2740e5f3c | ||
|
|
c3fa4cbbee | ||
|
|
a9da084711 | ||
|
|
f30969e946 | ||
|
|
e0e2b8c3c2 | ||
|
|
3782c0dcaf | ||
|
|
0331db2c12 | ||
|
|
1749247aeb |
@@ -30,6 +30,7 @@ jobs:
|
|||||||
v: true
|
v: true
|
||||||
x: false
|
x: false
|
||||||
race: false
|
race: false
|
||||||
|
tags: timetzdata
|
||||||
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=${{ steps.extract_branch.outputs.tag }}
|
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=${{ steps.extract_branch.outputs.tag }}
|
||||||
buildmode: default
|
buildmode: default
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ jobs:
|
|||||||
v: true
|
v: true
|
||||||
x: false
|
x: false
|
||||||
race: false
|
race: false
|
||||||
|
tags: timetzdata
|
||||||
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=test
|
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=test
|
||||||
buildmode: default
|
buildmode: default
|
||||||
|
|
||||||
|
|||||||
@@ -40,5 +40,6 @@ jobs:
|
|||||||
v: true
|
v: true
|
||||||
x: false
|
x: false
|
||||||
race: false
|
race: false
|
||||||
|
tags: timetzdata
|
||||||
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=test
|
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=test
|
||||||
buildmode: default
|
buildmode: default
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ You can change the dashboard language in the settings page (`/setting`) after th
|
|||||||
<a href="https://github.com/Erope" title="卖女孩的小火柴"><img src="https://avatars.githubusercontent.com/u/44471469?v=4" width="50;" alt="卖女孩的小火柴"/></a>
|
<a href="https://github.com/Erope" title="卖女孩的小火柴"><img src="https://avatars.githubusercontent.com/u/44471469?v=4" width="50;" alt="卖女孩的小火柴"/></a>
|
||||||
<a href="https://github.com/dysf888" title="黑歌"><img src="https://avatars.githubusercontent.com/u/47450409?v=4" width="50;" alt="黑歌"/></a>
|
<a href="https://github.com/dysf888" title="黑歌"><img src="https://avatars.githubusercontent.com/u/47450409?v=4" width="50;" alt="黑歌"/></a>
|
||||||
<a href="https://github.com/xykt" title="xykt"><img src="https://avatars.githubusercontent.com/u/152045469?v=4" width="50;" alt="xykt"/></a>
|
<a href="https://github.com/xykt" title="xykt"><img src="https://avatars.githubusercontent.com/u/152045469?v=4" width="50;" alt="xykt"/></a>
|
||||||
<a href="https://github.com/MikoyChinese" title="MikoyChinese"><img src="https://avatars.githubusercontent.com/u/22676744?v=4" width="50;" alt="MikoyChinese"/></a>
|
|
||||||
<a href="https://github.com/JackieSung4ev" title="JackieSung4ev"><img src="https://avatars.githubusercontent.com/u/24974735?v=4" width="50;" alt="JackieSung4ev"/></a>
|
|
||||||
<a href="https://github.com/nap0o" title="nap0o"><img src="https://avatars.githubusercontent.com/u/144927971?v=4" width="50;" alt="nap0o"/></a>
|
|
||||||
<a href="https://github.com/uubulb" title="UUBulb"><img src="https://avatars.githubusercontent.com/u/35923940?v=4" width="50;" alt="UUBulb"/></a>
|
<a href="https://github.com/uubulb" title="UUBulb"><img src="https://avatars.githubusercontent.com/u/35923940?v=4" width="50;" alt="UUBulb"/></a>
|
||||||
|
<a href="https://github.com/MikoyChinese" title="MikoyChinese"><img src="https://avatars.githubusercontent.com/u/22676744?v=4" width="50;" alt="MikoyChinese"/></a>
|
||||||
|
<a href="https://github.com/nap0o" title="nap0o"><img src="https://avatars.githubusercontent.com/u/144927971?v=4" width="50;" alt="nap0o"/></a>
|
||||||
|
<a href="https://github.com/JackieSung4ev" title="JackieSung4ev"><img src="https://avatars.githubusercontent.com/u/24974735?v=4" width="50;" alt="JackieSung4ev"/></a>
|
||||||
<a href="https://github.com/lemoeo" title="Lemoe"><img src="https://avatars.githubusercontent.com/u/18618627?v=4" width="50;" alt="Lemoe"/></a>
|
<a href="https://github.com/lemoeo" title="Lemoe"><img src="https://avatars.githubusercontent.com/u/18618627?v=4" width="50;" alt="Lemoe"/></a>
|
||||||
<a href="https://github.com/cantoblanco" title="Kris"><img src="https://avatars.githubusercontent.com/u/116849421?v=4" width="50;" alt="Kris"/></a>
|
<a href="https://github.com/cantoblanco" title="Kris"><img src="https://avatars.githubusercontent.com/u/116849421?v=4" width="50;" alt="Kris"/></a>
|
||||||
<a href="https://github.com/spiritLHLS" title="spiritlhl"><img src="https://avatars.githubusercontent.com/u/103393591?v=4" width="50;" alt="spiritlhl"/></a>
|
<a href="https://github.com/spiritLHLS" title="spiritlhl"><img src="https://avatars.githubusercontent.com/u/103393591?v=4" width="50;" alt="spiritlhl"/></a>
|
||||||
@@ -79,11 +79,13 @@ You can change the dashboard language in the settings page (`/setting`) after th
|
|||||||
<a href="https://github.com/nickfox-taterli" title="Tater Li"><img src="https://avatars.githubusercontent.com/u/19658596?v=4" width="50;" alt="Tater Li"/></a>
|
<a href="https://github.com/nickfox-taterli" title="Tater Li"><img src="https://avatars.githubusercontent.com/u/19658596?v=4" width="50;" alt="Tater Li"/></a>
|
||||||
<a href="https://github.com/dreamingsleeping" title="Nanjing Hopefun Network Technology Co. Ltd."><img src="https://avatars.githubusercontent.com/u/13828658?v=4" width="50;" alt="Nanjing Hopefun Network Technology Co. Ltd."/></a>
|
<a href="https://github.com/dreamingsleeping" title="Nanjing Hopefun Network Technology Co. Ltd."><img src="https://avatars.githubusercontent.com/u/13828658?v=4" width="50;" alt="Nanjing Hopefun Network Technology Co. Ltd."/></a>
|
||||||
<a href="https://github.com/MartijnLindeman" title="Martijn Lindeman"><img src="https://avatars.githubusercontent.com/u/78365708?v=4" width="50;" alt="Martijn Lindeman"/></a>
|
<a href="https://github.com/MartijnLindeman" title="Martijn Lindeman"><img src="https://avatars.githubusercontent.com/u/78365708?v=4" width="50;" alt="Martijn Lindeman"/></a>
|
||||||
|
<a href="https://github.com/funnyzak" title="Leon"><img src="https://avatars.githubusercontent.com/u/2562087?v=4" width="50;" alt="Leon"/></a>
|
||||||
<a href="https://github.com/KorenKrita" title="KorenKrita"><img src="https://avatars.githubusercontent.com/u/22239339?v=4" width="50;" alt="KorenKrita"/></a>
|
<a href="https://github.com/KorenKrita" title="KorenKrita"><img src="https://avatars.githubusercontent.com/u/22239339?v=4" width="50;" alt="KorenKrita"/></a>
|
||||||
<a href="https://github.com/techotaku" title="Ian Li"><img src="https://avatars.githubusercontent.com/u/1948179?v=4" width="50;" alt="Ian Li"/></a>
|
<a href="https://github.com/techotaku" title="Ian Li"><img src="https://avatars.githubusercontent.com/u/1948179?v=4" width="50;" alt="Ian Li"/></a>
|
||||||
<a href="https://github.com/GreenTeodoro839" title="GreenTeodoro839"><img src="https://avatars.githubusercontent.com/u/77104800?v=4" width="50;" alt="GreenTeodoro839"/></a>
|
<a href="https://github.com/GreenTeodoro839" title="GreenTeodoro839"><img src="https://avatars.githubusercontent.com/u/77104800?v=4" width="50;" alt="GreenTeodoro839"/></a>
|
||||||
<a href="https://github.com/Es-dese" title="Esdese"><img src="https://avatars.githubusercontent.com/u/71542548?v=4" width="50;" alt="Esdese"/></a>
|
<a href="https://github.com/Es-dese" title="Esdese"><img src="https://avatars.githubusercontent.com/u/71542548?v=4" width="50;" alt="Esdese"/></a>
|
||||||
<a href="https://github.com/wwng2333" title="Crazy"><img src="https://avatars.githubusercontent.com/u/17147265?v=4" width="50;" alt="Crazy"/></a><!--GAMFC_DELIMITER_END-->
|
<a href="https://github.com/wwng2333" title="Crazy"><img src="https://avatars.githubusercontent.com/u/17147265?v=4" width="50;" alt="Crazy"/></a>
|
||||||
|
<a href="https://github.com/wellcoming" title="Coming"><img src="https://avatars.githubusercontent.com/u/74850890?v=4" width="50;" alt="Coming"/></a><!--GAMFC_DELIMITER_END-->
|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
@@ -223,19 +224,25 @@ func (cp *commonPage) network(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cp *commonPage) getServerStat(c *gin.Context) ([]byte, error) {
|
func (cp *commonPage) getServerStat(c *gin.Context) ([]byte, error) {
|
||||||
v, err, _ := cp.requestGroup.Do("serverStats", func() (any, error) {
|
_, isMember := c.Get(model.CtxKeyAuthorizedUser)
|
||||||
|
_, isViewPasswordVerfied := c.Get(model.CtxKeyViewPasswordVerified)
|
||||||
|
authorized := isMember || isViewPasswordVerfied
|
||||||
|
v, err, _ := cp.requestGroup.Do(fmt.Sprintf("serverStats::%t", authorized), func() (interface{}, error) {
|
||||||
singleton.SortedServerLock.RLock()
|
singleton.SortedServerLock.RLock()
|
||||||
defer singleton.SortedServerLock.RUnlock()
|
defer singleton.SortedServerLock.RUnlock()
|
||||||
|
|
||||||
_, isMember := c.Get(model.CtxKeyAuthorizedUser)
|
|
||||||
_, isViewPasswordVerfied := c.Get(model.CtxKeyViewPasswordVerified)
|
|
||||||
|
|
||||||
var servers []*model.Server
|
var servers []*model.Server
|
||||||
|
|
||||||
if isMember || isViewPasswordVerfied {
|
if authorized {
|
||||||
servers = singleton.SortedServerList
|
servers = singleton.SortedServerList
|
||||||
} else {
|
} else {
|
||||||
servers = singleton.SortedServerListForGuest
|
filteredServers := make([]*model.Server, len(singleton.SortedServerListForGuest))
|
||||||
|
for i, server := range singleton.SortedServerListForGuest {
|
||||||
|
filteredServer := *server
|
||||||
|
filteredServer.DDNSDomain = "redacted"
|
||||||
|
filteredServers[i] = &filteredServer
|
||||||
|
}
|
||||||
|
servers = filteredServers
|
||||||
}
|
}
|
||||||
|
|
||||||
return utils.Json.Marshal(Data{
|
return utils.Json.Marshal(Data{
|
||||||
|
|||||||
@@ -437,7 +437,6 @@ func (ma *memberAPI) addOrEditMonitor(c *gin.Context) {
|
|||||||
if m.NotificationTag == "" {
|
if m.NotificationTag == "" {
|
||||||
m.NotificationTag = "default"
|
m.NotificationTag = "default"
|
||||||
}
|
}
|
||||||
if err == nil {
|
|
||||||
err = utils.Json.Unmarshal([]byte(mf.FailTriggerTasksRaw), &m.FailTriggerTasks)
|
err = utils.Json.Unmarshal([]byte(mf.FailTriggerTasksRaw), &m.FailTriggerTasks)
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -457,7 +456,6 @@ func (ma *memberAPI) addOrEditMonitor(c *gin.Context) {
|
|||||||
err = singleton.DB.Unscoped().Delete(&model.MonitorHistory{}, "monitor_id = ? and server_id not in (?)", m.ID, strings.Split(m.SkipServersRaw[1:len(m.SkipServersRaw)-1], ",")).Error
|
err = singleton.DB.Unscoped().Delete(&model.MonitorHistory{}, "monitor_id = ? and server_id not in (?)", m.ID, strings.Split(m.SkipServersRaw[1:len(m.SkipServersRaw)-1], ",")).Error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = singleton.ServiceSentinelShared.OnMonitorUpdate(m)
|
err = singleton.ServiceSentinelShared.OnMonitorUpdate(m)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/naiba/nezha/pkg/oidc/cloudflare"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/naiba/nezha/pkg/oidc/cloudflare"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
GitHubAPI "github.com/google/go-github/v47/github"
|
GitHubAPI "github.com/google/go-github/v47/github"
|
||||||
@@ -192,15 +193,12 @@ func (oa *oauth2controller) callback(c *gin.Context) {
|
|||||||
client = GitHubAPI.NewClient(oc)
|
client = GitHubAPI.NewClient(oc)
|
||||||
}
|
}
|
||||||
var gu *GitHubAPI.User
|
var gu *GitHubAPI.User
|
||||||
if err == nil {
|
|
||||||
gu, _, err = client.Users.Get(ctx, "")
|
gu, _, err = client.Users.Get(ctx, "")
|
||||||
}
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
user = model.NewUserFromGitHub(gu)
|
user = model.NewUserFromGitHub(gu)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == nil && user.Login == "" {
|
if err == nil && user.Login == "" {
|
||||||
err = errors.New("获取用户信息失败")
|
err = errors.New("获取用户信息失败")
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -22,7 +22,7 @@ var Themes = map[string]string{
|
|||||||
"mdui": "Neko Mdui",
|
"mdui": "Neko Mdui",
|
||||||
"hotaru": "Hotaru",
|
"hotaru": "Hotaru",
|
||||||
"angel-kanade": "AngelKanade",
|
"angel-kanade": "AngelKanade",
|
||||||
"server-status": "SeverStatus",
|
"server-status": "ServerStatus",
|
||||||
"custom": "Custom(local)",
|
"custom": "Custom(local)",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ func (c *AgentConfig) Save() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return os.WriteFile(c.v.ConfigFileUsed(), data, os.ModePerm)
|
return os.WriteFile(c.v.ConfigFileUsed(), data, 0600)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config 站点配置
|
// Config 站点配置
|
||||||
@@ -205,5 +205,5 @@ func (c *Config) Save() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return os.WriteFile(c.v.ConfigFileUsed(), data, os.ModePerm)
|
return os.WriteFile(c.v.ConfigFileUsed(), data, 0600)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ const (
|
|||||||
MTReportHostState
|
MTReportHostState
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type SensorTemperature struct {
|
||||||
|
Name string
|
||||||
|
Temperature float64
|
||||||
|
}
|
||||||
|
|
||||||
type HostState struct {
|
type HostState struct {
|
||||||
CPU float64
|
CPU float64
|
||||||
MemUsed uint64
|
MemUsed uint64
|
||||||
@@ -26,9 +31,19 @@ type HostState struct {
|
|||||||
TcpConnCount uint64
|
TcpConnCount uint64
|
||||||
UdpConnCount uint64
|
UdpConnCount uint64
|
||||||
ProcessCount uint64
|
ProcessCount uint64
|
||||||
|
Temperatures []SensorTemperature
|
||||||
|
GPU float64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *HostState) PB() *pb.State {
|
func (s *HostState) PB() *pb.State {
|
||||||
|
var ts []*pb.State_SensorTemperature
|
||||||
|
for _, t := range s.Temperatures {
|
||||||
|
ts = append(ts, &pb.State_SensorTemperature{
|
||||||
|
Name: t.Name,
|
||||||
|
Temperature: t.Temperature,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return &pb.State{
|
return &pb.State{
|
||||||
Cpu: s.CPU,
|
Cpu: s.CPU,
|
||||||
MemUsed: s.MemUsed,
|
MemUsed: s.MemUsed,
|
||||||
@@ -45,10 +60,20 @@ func (s *HostState) PB() *pb.State {
|
|||||||
TcpConnCount: s.TcpConnCount,
|
TcpConnCount: s.TcpConnCount,
|
||||||
UdpConnCount: s.UdpConnCount,
|
UdpConnCount: s.UdpConnCount,
|
||||||
ProcessCount: s.ProcessCount,
|
ProcessCount: s.ProcessCount,
|
||||||
|
Temperatures: ts,
|
||||||
|
Gpu: s.GPU,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func PB2State(s *pb.State) HostState {
|
func PB2State(s *pb.State) HostState {
|
||||||
|
var ts []SensorTemperature
|
||||||
|
for _, t := range s.GetTemperatures() {
|
||||||
|
ts = append(ts, SensorTemperature{
|
||||||
|
Name: t.GetName(),
|
||||||
|
Temperature: t.GetTemperature(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return HostState{
|
return HostState{
|
||||||
CPU: s.GetCpu(),
|
CPU: s.GetCpu(),
|
||||||
MemUsed: s.GetMemUsed(),
|
MemUsed: s.GetMemUsed(),
|
||||||
@@ -65,6 +90,8 @@ func PB2State(s *pb.State) HostState {
|
|||||||
TcpConnCount: s.GetTcpConnCount(),
|
TcpConnCount: s.GetTcpConnCount(),
|
||||||
UdpConnCount: s.GetUdpConnCount(),
|
UdpConnCount: s.GetUdpConnCount(),
|
||||||
ProcessCount: s.GetProcessCount(),
|
ProcessCount: s.GetProcessCount(),
|
||||||
|
Temperatures: ts,
|
||||||
|
GPU: s.GetGpu(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +108,7 @@ type Host struct {
|
|||||||
IP string `json:"-"`
|
IP string `json:"-"`
|
||||||
CountryCode string
|
CountryCode string
|
||||||
Version string
|
Version string
|
||||||
|
GPU []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Host) PB() *pb.Host {
|
func (h *Host) PB() *pb.Host {
|
||||||
@@ -97,6 +125,7 @@ func (h *Host) PB() *pb.Host {
|
|||||||
Ip: h.IP,
|
Ip: h.IP,
|
||||||
CountryCode: h.CountryCode,
|
CountryCode: h.CountryCode,
|
||||||
Version: h.Version,
|
Version: h.Version,
|
||||||
|
Gpu: h.GPU,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,5 +143,6 @@ func PB2Host(h *pb.Host) Host {
|
|||||||
IP: h.GetIp(),
|
IP: h.GetIp(),
|
||||||
CountryCode: h.GetCountryCode(),
|
CountryCode: h.GetCountryCode(),
|
||||||
Version: h.GetVersion(),
|
Version: h.GetVersion(),
|
||||||
|
GPU: h.GetGpu(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+196
-91
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.34.1
|
||||||
// protoc v3.21.12
|
// protoc v5.26.1
|
||||||
// source: proto/nezha.proto
|
// source: proto/nezha.proto
|
||||||
|
|
||||||
package proto
|
package proto
|
||||||
@@ -37,6 +37,7 @@ type Host struct {
|
|||||||
Ip string `protobuf:"bytes,10,opt,name=ip,proto3" json:"ip,omitempty"`
|
Ip string `protobuf:"bytes,10,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||||
CountryCode string `protobuf:"bytes,11,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
|
CountryCode string `protobuf:"bytes,11,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
|
||||||
Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"`
|
Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"`
|
||||||
|
Gpu []string `protobuf:"bytes,13,rep,name=gpu,proto3" json:"gpu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Host) Reset() {
|
func (x *Host) Reset() {
|
||||||
@@ -155,6 +156,13 @@ func (x *Host) GetVersion() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Host) GetGpu() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Gpu
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type State struct {
|
type State struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -175,6 +183,8 @@ type State struct {
|
|||||||
TcpConnCount uint64 `protobuf:"varint,14,opt,name=tcp_conn_count,json=tcpConnCount,proto3" json:"tcp_conn_count,omitempty"`
|
TcpConnCount uint64 `protobuf:"varint,14,opt,name=tcp_conn_count,json=tcpConnCount,proto3" json:"tcp_conn_count,omitempty"`
|
||||||
UdpConnCount uint64 `protobuf:"varint,15,opt,name=udp_conn_count,json=udpConnCount,proto3" json:"udp_conn_count,omitempty"`
|
UdpConnCount uint64 `protobuf:"varint,15,opt,name=udp_conn_count,json=udpConnCount,proto3" json:"udp_conn_count,omitempty"`
|
||||||
ProcessCount uint64 `protobuf:"varint,16,opt,name=process_count,json=processCount,proto3" json:"process_count,omitempty"`
|
ProcessCount uint64 `protobuf:"varint,16,opt,name=process_count,json=processCount,proto3" json:"process_count,omitempty"`
|
||||||
|
Temperatures []*State_SensorTemperature `protobuf:"bytes,17,rep,name=temperatures,proto3" json:"temperatures,omitempty"`
|
||||||
|
Gpu float64 `protobuf:"fixed64,18,opt,name=gpu,proto3" json:"gpu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *State) Reset() {
|
func (x *State) Reset() {
|
||||||
@@ -314,6 +324,75 @@ func (x *State) GetProcessCount() uint64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *State) GetTemperatures() []*State_SensorTemperature {
|
||||||
|
if x != nil {
|
||||||
|
return x.Temperatures
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *State) GetGpu() float64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Gpu
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type State_SensorTemperature struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
Temperature float64 `protobuf:"fixed64,2,opt,name=temperature,proto3" json:"temperature,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *State_SensorTemperature) Reset() {
|
||||||
|
*x = State_SensorTemperature{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_nezha_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *State_SensorTemperature) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*State_SensorTemperature) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *State_SensorTemperature) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_nezha_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use State_SensorTemperature.ProtoReflect.Descriptor instead.
|
||||||
|
func (*State_SensorTemperature) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_nezha_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *State_SensorTemperature) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *State_SensorTemperature) GetTemperature() float64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Temperature
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type Task struct {
|
type Task struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -327,7 +406,7 @@ type Task struct {
|
|||||||
func (x *Task) Reset() {
|
func (x *Task) Reset() {
|
||||||
*x = Task{}
|
*x = Task{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_nezha_proto_msgTypes[2]
|
mi := &file_proto_nezha_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -340,7 +419,7 @@ func (x *Task) String() string {
|
|||||||
func (*Task) ProtoMessage() {}
|
func (*Task) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Task) ProtoReflect() protoreflect.Message {
|
func (x *Task) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_nezha_proto_msgTypes[2]
|
mi := &file_proto_nezha_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -353,7 +432,7 @@ func (x *Task) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Task.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Task.ProtoReflect.Descriptor instead.
|
||||||
func (*Task) Descriptor() ([]byte, []int) {
|
func (*Task) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_nezha_proto_rawDescGZIP(), []int{2}
|
return file_proto_nezha_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Task) GetId() uint64 {
|
func (x *Task) GetId() uint64 {
|
||||||
@@ -392,7 +471,7 @@ type TaskResult struct {
|
|||||||
func (x *TaskResult) Reset() {
|
func (x *TaskResult) Reset() {
|
||||||
*x = TaskResult{}
|
*x = TaskResult{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_nezha_proto_msgTypes[3]
|
mi := &file_proto_nezha_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -405,7 +484,7 @@ func (x *TaskResult) String() string {
|
|||||||
func (*TaskResult) ProtoMessage() {}
|
func (*TaskResult) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *TaskResult) ProtoReflect() protoreflect.Message {
|
func (x *TaskResult) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_nezha_proto_msgTypes[3]
|
mi := &file_proto_nezha_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -418,7 +497,7 @@ func (x *TaskResult) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use TaskResult.ProtoReflect.Descriptor instead.
|
// Deprecated: Use TaskResult.ProtoReflect.Descriptor instead.
|
||||||
func (*TaskResult) Descriptor() ([]byte, []int) {
|
func (*TaskResult) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_nezha_proto_rawDescGZIP(), []int{3}
|
return file_proto_nezha_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TaskResult) GetId() uint64 {
|
func (x *TaskResult) GetId() uint64 {
|
||||||
@@ -467,7 +546,7 @@ type Receipt struct {
|
|||||||
func (x *Receipt) Reset() {
|
func (x *Receipt) Reset() {
|
||||||
*x = Receipt{}
|
*x = Receipt{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_nezha_proto_msgTypes[4]
|
mi := &file_proto_nezha_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -480,7 +559,7 @@ func (x *Receipt) String() string {
|
|||||||
func (*Receipt) ProtoMessage() {}
|
func (*Receipt) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Receipt) ProtoReflect() protoreflect.Message {
|
func (x *Receipt) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_nezha_proto_msgTypes[4]
|
mi := &file_proto_nezha_proto_msgTypes[5]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -493,7 +572,7 @@ func (x *Receipt) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Receipt.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Receipt.ProtoReflect.Descriptor instead.
|
||||||
func (*Receipt) Descriptor() ([]byte, []int) {
|
func (*Receipt) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_nezha_proto_rawDescGZIP(), []int{4}
|
return file_proto_nezha_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Receipt) GetProced() bool {
|
func (x *Receipt) GetProced() bool {
|
||||||
@@ -507,7 +586,7 @@ var File_proto_nezha_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_proto_nezha_proto_rawDesc = []byte{
|
var file_proto_nezha_proto_rawDesc = []byte{
|
||||||
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x65, 0x7a, 0x68, 0x61, 0x2e, 0x70, 0x72,
|
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x65, 0x7a, 0x68, 0x61, 0x2e, 0x70, 0x72,
|
||||||
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x02, 0x0a, 0x04, 0x48,
|
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x02, 0x0a, 0x04, 0x48,
|
||||||
0x6f, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18,
|
0x6f, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12,
|
||||||
0x29, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73,
|
0x29, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73,
|
||||||
@@ -529,65 +608,77 @@ var file_proto_nezha_proto_rawDesc = []byte{
|
|||||||
0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65,
|
0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65,
|
||||||
0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43,
|
0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43,
|
||||||
0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c,
|
0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd3, 0x03,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a,
|
||||||
0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x01,
|
0x03, 0x67, 0x70, 0x75, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x67, 0x70, 0x75, 0x22,
|
||||||
0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x65, 0x6d,
|
0xa9, 0x04, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75,
|
||||||
0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x65, 0x6d,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x19, 0x0a, 0x08, 0x6d,
|
||||||
0x55, 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x75, 0x73, 0x65,
|
0x65, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6d,
|
||||||
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, 0x55, 0x73, 0x65,
|
0x65, 0x6d, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x75,
|
||||||
0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x05,
|
0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, 0x55,
|
||||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26,
|
0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x75, 0x73, 0x65, 0x64,
|
||||||
0x0a, 0x0f, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65,
|
0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x65, 0x64,
|
||||||
0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x54, 0x72,
|
0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
||||||
0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x65, 0x74, 0x5f, 0x6f, 0x75,
|
0x66, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x49, 0x6e,
|
||||||
0x74, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04,
|
0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x65, 0x74, 0x5f,
|
||||||
0x52, 0x0e, 0x6e, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72,
|
0x6f, 0x75, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01,
|
||||||
0x12, 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64,
|
0x28, 0x04, 0x52, 0x0e, 0x6e, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
|
||||||
0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x53, 0x70, 0x65,
|
0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x73, 0x70, 0x65,
|
||||||
0x65, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x5f, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x70,
|
0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x53,
|
||||||
0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x4f, 0x75,
|
0x70, 0x65, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x5f, 0x6f, 0x75, 0x74, 0x5f,
|
||||||
0x74, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65,
|
0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6e, 0x65, 0x74,
|
||||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14,
|
0x4f, 0x75, 0x74, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69,
|
||||||
0x0a, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x31, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c,
|
0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65,
|
||||||
0x6f, 0x61, 0x64, 0x31, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x35, 0x18, 0x0c, 0x20,
|
0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x31, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52,
|
||||||
0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x35, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f,
|
0x05, 0x6c, 0x6f, 0x61, 0x64, 0x31, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x35, 0x18,
|
||||||
0x61, 0x64, 0x31, 0x35, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6c, 0x6f, 0x61, 0x64,
|
0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x35, 0x12, 0x16, 0x0a, 0x06,
|
||||||
0x31, 0x35, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x5f, 0x63,
|
0x6c, 0x6f, 0x61, 0x64, 0x31, 0x35, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6c, 0x6f,
|
||||||
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x63, 0x70, 0x43,
|
0x61, 0x64, 0x31, 0x35, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e,
|
||||||
0x6f, 0x6e, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x64, 0x70, 0x5f,
|
0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x63,
|
||||||
0x63, 0x6f, 0x6e, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04,
|
0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x64,
|
||||||
0x52, 0x0c, 0x75, 0x64, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23,
|
0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01,
|
||||||
0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
0x28, 0x04, 0x52, 0x0c, 0x75, 0x64, 0x70, 0x43, 0x6f, 0x6e, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f,
|
0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
|
||||||
0x75, 0x6e, 0x74, 0x22, 0x3e, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74,
|
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61,
|
||||||
0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
|
0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72,
|
||||||
0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64,
|
0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72,
|
||||||
0x61, 0x74, 0x61, 0x22, 0x7a, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c,
|
0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0c, 0x74, 0x65, 0x6d,
|
||||||
0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69,
|
0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x70, 0x75,
|
||||||
0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52,
|
0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x67, 0x70, 0x75, 0x22, 0x4f, 0x0a, 0x17, 0x53,
|
||||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03,
|
0x74, 0x61, 0x74, 0x65, 0x5f, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x65,
|
||||||
0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64,
|
0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
|
||||||
0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x65,
|
||||||
0x1e, 0x0a, 0x0a, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x18, 0x05, 0x20,
|
0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52,
|
||||||
0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x22,
|
0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x3e, 0x0a, 0x04,
|
||||||
0x21, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72,
|
0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
|
||||||
0x6f, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x63,
|
0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x65, 0x64, 0x32, 0xd6, 0x01, 0x0a, 0x0c, 0x4e, 0x65, 0x7a, 0x68, 0x61, 0x53, 0x65, 0x72, 0x76,
|
0x28, 0x04, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||||
0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x79, 0x73,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7a, 0x0a, 0x0a,
|
||||||
0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
||||||
0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79,
|
||||||
0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f,
|
0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14,
|
||||||
0x72, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x70,
|
0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x64,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x65, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x6f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x0a, 0x52,
|
0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x75, 0x63, 0x63,
|
||||||
0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x75,
|
||||||
0x6f, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x0e, 0x2e, 0x70,
|
0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x22, 0x21, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x00, 0x12, 0x2b,
|
0x69, 0x70, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20,
|
||||||
0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0b, 0x2e,
|
0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x64, 0x32, 0xd6, 0x01, 0x0a, 0x0c,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x70, 0x72, 0x6f,
|
0x4e, 0x65, 0x7a, 0x68, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x11,
|
||||||
0x74, 0x6f, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x00, 0x30, 0x01, 0x42, 0x09, 0x5a, 0x07, 0x2e,
|
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74,
|
||||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x65, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a,
|
||||||
|
0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22,
|
||||||
|
0x00, 0x12, 0x31, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||||
|
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x6f,
|
||||||
|
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69,
|
||||||
|
0x70, 0x74, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61,
|
||||||
|
0x73, 0x6b, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52,
|
||||||
|
0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65,
|
||||||
|
0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48,
|
||||||
|
0x6f, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x61, 0x73, 0x6b,
|
||||||
|
0x22, 0x00, 0x30, 0x01, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -602,28 +693,30 @@ func file_proto_nezha_proto_rawDescGZIP() []byte {
|
|||||||
return file_proto_nezha_proto_rawDescData
|
return file_proto_nezha_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_proto_nezha_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
var file_proto_nezha_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
var file_proto_nezha_proto_goTypes = []interface{}{
|
var file_proto_nezha_proto_goTypes = []interface{}{
|
||||||
(*Host)(nil), // 0: proto.Host
|
(*Host)(nil), // 0: proto.Host
|
||||||
(*State)(nil), // 1: proto.State
|
(*State)(nil), // 1: proto.State
|
||||||
(*Task)(nil), // 2: proto.Task
|
(*State_SensorTemperature)(nil), // 2: proto.State_SensorTemperature
|
||||||
(*TaskResult)(nil), // 3: proto.TaskResult
|
(*Task)(nil), // 3: proto.Task
|
||||||
(*Receipt)(nil), // 4: proto.Receipt
|
(*TaskResult)(nil), // 4: proto.TaskResult
|
||||||
|
(*Receipt)(nil), // 5: proto.Receipt
|
||||||
}
|
}
|
||||||
var file_proto_nezha_proto_depIdxs = []int32{
|
var file_proto_nezha_proto_depIdxs = []int32{
|
||||||
1, // 0: proto.NezhaService.ReportSystemState:input_type -> proto.State
|
2, // 0: proto.State.temperatures:type_name -> proto.State_SensorTemperature
|
||||||
0, // 1: proto.NezhaService.ReportSystemInfo:input_type -> proto.Host
|
1, // 1: proto.NezhaService.ReportSystemState:input_type -> proto.State
|
||||||
3, // 2: proto.NezhaService.ReportTask:input_type -> proto.TaskResult
|
0, // 2: proto.NezhaService.ReportSystemInfo:input_type -> proto.Host
|
||||||
0, // 3: proto.NezhaService.RequestTask:input_type -> proto.Host
|
4, // 3: proto.NezhaService.ReportTask:input_type -> proto.TaskResult
|
||||||
4, // 4: proto.NezhaService.ReportSystemState:output_type -> proto.Receipt
|
0, // 4: proto.NezhaService.RequestTask:input_type -> proto.Host
|
||||||
4, // 5: proto.NezhaService.ReportSystemInfo:output_type -> proto.Receipt
|
5, // 5: proto.NezhaService.ReportSystemState:output_type -> proto.Receipt
|
||||||
4, // 6: proto.NezhaService.ReportTask:output_type -> proto.Receipt
|
5, // 6: proto.NezhaService.ReportSystemInfo:output_type -> proto.Receipt
|
||||||
2, // 7: proto.NezhaService.RequestTask:output_type -> proto.Task
|
5, // 7: proto.NezhaService.ReportTask:output_type -> proto.Receipt
|
||||||
4, // [4:8] is the sub-list for method output_type
|
3, // 8: proto.NezhaService.RequestTask:output_type -> proto.Task
|
||||||
0, // [0:4] is the sub-list for method input_type
|
5, // [5:9] is the sub-list for method output_type
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
1, // [1:5] is the sub-list for method input_type
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
0, // [0:0] is the sub-list for field type_name
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_proto_nezha_proto_init() }
|
func init() { file_proto_nezha_proto_init() }
|
||||||
@@ -657,7 +750,7 @@ func file_proto_nezha_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_nezha_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_nezha_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Task); i {
|
switch v := v.(*State_SensorTemperature); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -669,7 +762,7 @@ func file_proto_nezha_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_nezha_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_nezha_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*TaskResult); i {
|
switch v := v.(*Task); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -681,6 +774,18 @@ func file_proto_nezha_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proto_nezha_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_nezha_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*TaskResult); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_proto_nezha_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Receipt); i {
|
switch v := v.(*Receipt); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -699,7 +804,7 @@ func file_proto_nezha_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_proto_nezha_proto_rawDesc,
|
RawDescriptor: file_proto_nezha_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 5,
|
NumMessages: 6,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ message Host {
|
|||||||
string ip = 10;
|
string ip = 10;
|
||||||
string country_code = 11;
|
string country_code = 11;
|
||||||
string version = 12;
|
string version = 12;
|
||||||
|
repeated string gpu = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
message State {
|
message State {
|
||||||
@@ -41,6 +42,13 @@ message State {
|
|||||||
uint64 tcp_conn_count = 14;
|
uint64 tcp_conn_count = 14;
|
||||||
uint64 udp_conn_count = 15;
|
uint64 udp_conn_count = 15;
|
||||||
uint64 process_count = 16;
|
uint64 process_count = 16;
|
||||||
|
repeated State_SensorTemperature temperatures = 17;
|
||||||
|
double gpu = 18;
|
||||||
|
}
|
||||||
|
|
||||||
|
message State_SensorTemperature {
|
||||||
|
string name = 1;
|
||||||
|
double temperature = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Task {
|
message Task {
|
||||||
|
|||||||
Vendored
+3
@@ -640,6 +640,9 @@ other = "Template"
|
|||||||
[Stat]
|
[Stat]
|
||||||
other = "Asset"
|
other = "Asset"
|
||||||
|
|
||||||
|
[Temperature]
|
||||||
|
other = "Temperature"
|
||||||
|
|
||||||
[DisableSwitchTemplateInFrontend]
|
[DisableSwitchTemplateInFrontend]
|
||||||
other = "Disable Switch Template in Frontend"
|
other = "Disable Switch Template in Frontend"
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
@@ -640,6 +640,9 @@ other = "Plantilla"
|
|||||||
[Stat]
|
[Stat]
|
||||||
other = "Stat"
|
other = "Stat"
|
||||||
|
|
||||||
|
[Temperature]
|
||||||
|
other = "Temperatura"
|
||||||
|
|
||||||
[DisableSwitchTemplateInFrontend]
|
[DisableSwitchTemplateInFrontend]
|
||||||
other = "Deshabilitar Cambio de Plantilla en Frontend"
|
other = "Deshabilitar Cambio de Plantilla en Frontend"
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
@@ -640,6 +640,9 @@ other = "主题"
|
|||||||
[Stat]
|
[Stat]
|
||||||
other = "信息"
|
other = "信息"
|
||||||
|
|
||||||
|
[Temperature]
|
||||||
|
other = "温度"
|
||||||
|
|
||||||
[DisableSwitchTemplateInFrontend]
|
[DisableSwitchTemplateInFrontend]
|
||||||
other = "禁止前台切换模板"
|
other = "禁止前台切换模板"
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
@@ -640,6 +640,9 @@ other = "主題"
|
|||||||
[Stat]
|
[Stat]
|
||||||
other = "信息"
|
other = "信息"
|
||||||
|
|
||||||
|
[Temperature]
|
||||||
|
other = "溫度"
|
||||||
|
|
||||||
[DisableSwitchTemplateInFrontend]
|
[DisableSwitchTemplateInFrontend]
|
||||||
other = "禁止前台切換主題"
|
other = "禁止前台切換主題"
|
||||||
|
|
||||||
|
|||||||
+4
@@ -145,6 +145,10 @@ td {
|
|||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.temp-detail {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.ui.content {
|
.ui.content {
|
||||||
margin:0 !important;
|
margin:0 !important;
|
||||||
padding:1em !important;
|
padding:1em !important;
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ const mixinsVue = {
|
|||||||
adaptedTemplates: [
|
adaptedTemplates: [
|
||||||
{ key: 'default', name: 'Default', icon: 'th large' },
|
{ key: 'default', name: 'Default', icon: 'th large' },
|
||||||
{ key: 'angel-kanade', name: 'AngelKanade', icon: 'square' },
|
{ key: 'angel-kanade', name: 'AngelKanade', icon: 'square' },
|
||||||
{ key: 'server-status', name: 'SeverStatus', icon: 'list' }
|
{ key: 'server-status', name: 'ServerStatus', icon: 'list' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -230,6 +230,10 @@ body {
|
|||||||
max-width: 50px;
|
max-width: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.temp-detail {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
/*正文结束*/
|
/*正文结束*/
|
||||||
|
|
||||||
/* 服务页 正文*/
|
/* 服务页 正文*/
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ const mixinsVue = {
|
|||||||
adaptedTemplates: [
|
adaptedTemplates: [
|
||||||
{ key: 'default', name: 'Default', icon: 'th large' },
|
{ key: 'default', name: 'Default', icon: 'th large' },
|
||||||
{ key: 'angel-kanade', name: 'AngelKanade', icon: 'square' },
|
{ key: 'angel-kanade', name: 'AngelKanade', icon: 'square' },
|
||||||
{ key: 'server-status', name: 'SeverStatus', icon: 'list' }
|
{ key: 'server-status', name: 'ServerStatus', icon: 'list' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
[<span
|
[<span
|
||||||
v-if="server.Host.Virtualization">@#server.Host.Virtualization#@:</span>@#server.Host.Arch#@]<br />
|
v-if="server.Host.Virtualization">@#server.Host.Virtualization#@:</span>@#server.Host.Arch#@]<br />
|
||||||
CPU: @#server.Host.CPU#@<br />
|
CPU: @#server.Host.CPU#@<br />
|
||||||
|
GPU: @#server.Host.GPU#@<br />
|
||||||
{{tr "DiskUsed"}}:
|
{{tr "DiskUsed"}}:
|
||||||
@#formatByteSize(server.State.DiskUsed)#@/@#formatByteSize(server.Host.DiskTotal)#@<br />
|
@#formatByteSize(server.State.DiskUsed)#@/@#formatByteSize(server.Host.DiskTotal)#@<br />
|
||||||
{{tr "MemUsed"}}:
|
{{tr "MemUsed"}}:
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
<i :class="item.icon + ' icon'"></i>@#item.name#@
|
<i :class="item.icon + ' icon'"></i>@#item.name#@
|
||||||
<i class="check icon" v-if="preferredTemplate === item.key"></i>
|
<i class="check icon" v-if="preferredTemplate === item.key"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a v-if="defaultTemplate === 'custom'" @click="toggleTemplate('custom')" class="item">
|
||||||
|
<i class="expand icon"></i>Custom
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
+11
-10
@@ -7,19 +7,20 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<meta content="telephone=no" name="format-detection">
|
<meta content="telephone=no" name="format-detection">
|
||||||
<title>{{.Title}}</title>
|
<title>{{.Title}}</title>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/assets/font-logos.css">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/[email protected]/css/flag-icons.min.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/static/semantic-ui-alerts.min.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/static/theme-default/css/main.css?v20240226">
|
|
||||||
<link rel="shortcut icon" type="image/png" href="/static/logo.svg" />
|
<link rel="shortcut icon" type="image/png" href="/static/logo.svg" />
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
|
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/semantic.min.css">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script>
|
<link rel="stylesheet" href="https://unpkg.com/[email protected]/assets/font-logos.css">
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/[email protected]/font/bootstrap-icons.min.css">
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/flag-icons.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/semantic-ui-alerts.min.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="/static/theme-default/css/main.css?v20240616">
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/semantic.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/echarts.min.js"></script>
|
||||||
<script src="/static/semantic-ui-alerts.min.js"></script>
|
<script src="/static/semantic-ui-alerts.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
|
|
||||||
<script src="/static/theme-default/js/mixin.js?v20240302"></script>
|
<script src="/static/theme-default/js/mixin.js?v20240302"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|||||||
+156
-59
@@ -15,32 +15,59 @@
|
|||||||
<div v-for="server in group.data" :id="server.ID" class="ui card">
|
<div v-for="server in group.data" :id="server.ID" class="ui card">
|
||||||
<div class="content" v-if="server.Host" style="margin-top: 10px; padding-bottom: 5px">
|
<div class="content" v-if="server.Host" style="margin-top: 10px; padding-bottom: 5px">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<i style="width: 22px;border-radius: 4px;" :class="'fi fi-' + server.Host.CountryCode"></i> <i v-if='server.Host.Platform == "darwin"'
|
<i style="width: 22px;border-radius: 4px;" :class="'fi fi-' + server.Host.CountryCode"></i>
|
||||||
class="apple icon"></i><i v-else-if='isWindowsPlatform(server.Host.Platform)'
|
<i v-if='isWindowsPlatform(server.Host.Platform)' class="windows icon"></i>
|
||||||
class="windows icon"></i><i v-else :class="'fl-' + getFontLogoClass(server.Host.Platform)"></i>
|
<i v-else-if='getFontLogoClass(server.Host.Platform) == "" && server.State.Uptime > 0' class="fl-tux"></i>
|
||||||
|
<i v-else :class="'fl-' + getFontLogoClass(server.Host.Platform)"></i>
|
||||||
@#server.Name + (server.live?'':'[{{tr "Offline"}}]')#@
|
@#server.Name + (server.live?'':'[{{tr "Offline"}}]')#@
|
||||||
<i @click="togglePopup($event, server.ID)" aria-expanded="false" class="nezha-secondary-font info circle icon"></i>
|
<i @click="togglePopup($event, server.ID)" aria-expanded="false" class="nezha-secondary-font info circle icon"></i>
|
||||||
<div class="ui content popup" :class="{ 'visible': isActive(server.ID) }" style="margin-bottom: 0;">
|
<div class="ui content popup" :class="{ 'visible': isActive(server.ID) }" style="margin-bottom: 0;">
|
||||||
<i class="closePopup window close icon" @click="closePopup(server.ID)"></i>
|
<i class="closePopup window close icon" @click="closePopup(server.ID)"></i>
|
||||||
{{tr "Platform"}}: @#server.Host.Platform#@-@#server.Host.PlatformVersion#@
|
{{tr "Platform"}}: @#server.Host.Platform#@-@#server.Host.PlatformVersion#@
|
||||||
[<span
|
[<span v-if="server.Host.Virtualization">@#server.Host.Virtualization#@:</span>@#server.Host.Arch#@]
|
||||||
v-if="server.Host.Virtualization">@#server.Host.Virtualization#@:</span>@#server.Host.Arch#@]<br />
|
<br />
|
||||||
CPU: @#server.Host.CPU#@<br />
|
CPU: @#server.Host.CPU#@
|
||||||
|
<br />
|
||||||
|
GPU: @#server.Host.GPU#@
|
||||||
|
<br />
|
||||||
{{tr "DiskUsed"}}:
|
{{tr "DiskUsed"}}:
|
||||||
@#formatByteSize(server.State.DiskUsed)#@/@#formatByteSize(server.Host.DiskTotal)#@<br />
|
@#formatByteSize(server.State.DiskUsed)#@/@#formatByteSize(server.Host.DiskTotal)#@
|
||||||
|
<br />
|
||||||
{{tr "MemUsed"}}:
|
{{tr "MemUsed"}}:
|
||||||
@#formatByteSize(server.State.MemUsed)#@/@#formatByteSize(server.Host.MemTotal)#@<br />
|
@#formatByteSize(server.State.MemUsed)#@/@#formatByteSize(server.Host.MemTotal)#@
|
||||||
|
<br />
|
||||||
{{tr "SwapUsed"}}:
|
{{tr "SwapUsed"}}:
|
||||||
@#formatByteSize(server.State.SwapUsed)#@/@#formatByteSize(server.Host.SwapTotal)#@<br />
|
<template v-if="server.Host.SwapTotal === 0">OFF</template>
|
||||||
{{tr "NetTransfer"}}: <i
|
<template v-else>@#formatByteSize(server.State.SwapUsed)#@/@#formatByteSize(server.Host.SwapTotal)#@</template>
|
||||||
class="arrow alternate circle down outline icon"></i>@#formatByteSize(server.State.NetInTransfer)#@<i
|
<br />
|
||||||
class="arrow alternate circle up outline icon"></i>@#formatByteSize(server.State.NetOutTransfer)#@<br />
|
{{tr "NetTransfer"}}:
|
||||||
{{tr "Load"}}: @# toFixed2(server.State.Load1) #@/@# toFixed2(server.State.Load5) #@/@#
|
<i class="arrow alternate circle down outline icon"></i>@#formatByteSize(server.State.NetInTransfer)#@
|
||||||
toFixed2(server.State.Load15) #@<br />
|
<i class="arrow alternate circle up outline icon"></i>@#formatByteSize(server.State.NetOutTransfer)#@
|
||||||
{{tr "ProcessCount"}}: @# server.State.ProcessCount #@<br />
|
<br />
|
||||||
{{tr "ConnCount"}}: TCP @# server.State.TcpConnCount #@ / UDP @# server.State.UdpConnCount #@<br />
|
{{tr "Load"}}: @#toFixed2(server.State.Load1)#@/@#toFixed2(server.State.Load5)#@/@#
|
||||||
{{tr "BootTime"}}: @# formatTimestamp(server.Host.BootTime) #@<br />
|
toFixed2(server.State.Load15)#@
|
||||||
{{tr "LastActive"}}: @# new Date(server.LastActive).toLocaleString() #@<br />
|
<br />
|
||||||
|
{{tr "ProcessCount"}}: @#server.State.ProcessCount#@
|
||||||
|
<br />
|
||||||
|
{{tr "ConnCount"}}: TCP @#server.State.TcpConnCount#@ / UDP @#server.State.UdpConnCount#@
|
||||||
|
<br />
|
||||||
|
{{tr "BootTime"}}: @#formatTimestamp(server.Host.BootTime)#@
|
||||||
|
<br />
|
||||||
|
{{tr "LastActive"}}: @#new Date(server.LastActive).toLocaleString()#@
|
||||||
|
<br />
|
||||||
|
<div v-if="server.State.Temperatures && getTemperature(server.State.Temperatures, sensorList) > 0" class="temp-detail" @click="toggleDetailedTemp(server.ID)" :id="`temp-${server.ID}`" temp-detail-show="0">
|
||||||
|
{{tr "Temperature"}}:
|
||||||
|
<span :id="`temp-main-${server.ID}`">
|
||||||
|
@#getTemperature(server.State.Temperatures, sensorList)#@°C
|
||||||
|
<i class="bi bi-chevron-double-down"></i>
|
||||||
|
</span>
|
||||||
|
<span :id="`temp-detail-${server.ID}`" style="display:none">
|
||||||
|
<span v-for="temp in server.State.Temperatures" :key="temp.Name" v-if="temp.Temperature !== 0">
|
||||||
|
[ @#temp.Name#@: @#temp.Temperature#@°C ]
|
||||||
|
</span>
|
||||||
|
<i class="bi bi-chevron-double-up"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
{{tr "Version"}}: @#server.Host.Version#@
|
{{tr "Version"}}: @#server.Host.Version#@
|
||||||
<div class="chartbox" :key="server.ID" :ref="`chart${server.ID}`" style="width: 100%; height: auto; margin-bottom: 2px;"></div>
|
<div class="chartbox" :key="server.ID" :ref="`chart${server.ID}`" style="width: 100%; height: auto; margin-bottom: 2px;"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -52,34 +79,32 @@
|
|||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
<div :class="formatPercent(server.live,server.State.CPU, 100).class">
|
<div :class="formatPercent(server.live,server.State.CPU, 100).class">
|
||||||
<div class="bar" :style="formatPercent(server.live,server.State.CPU, 100).style">
|
<div class="bar" :style="formatPercent(server.live,server.State.CPU, 100).style">
|
||||||
<small>@#formatPercent(server.live,server.State.CPU,100).percent#@%</small>
|
<small>@#parseInt(server.State.CPU?server.State.CPU:0)#@%</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="three wide column">{{tr "MemUsed"}}</div>
|
<div class="three wide column">{{tr "MemUsed"}}</div>
|
||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
<div :class="formatPercent(server.live,server.State.MemUsed, server.Host.MemTotal).class">
|
<div :class="formatPercent(server.live,server.State.MemUsed, server.Host.MemTotal).class">
|
||||||
<div class="bar"
|
<div class="bar" :style="formatPercent(server.live,server.State.MemUsed, server.Host.MemTotal).style">
|
||||||
:style="formatPercent(server.live,server.State.MemUsed, server.Host.MemTotal).style">
|
<small>@#parseInt(server.Host.MemTotal?server.State.MemUsed/server.Host.MemTotal*100:0)#@%</small>
|
||||||
<small>@#parseInt(server.State?server.State.MemUsed/server.Host.MemTotal*100:0)#@%</small>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="three wide column">{{tr "SwapUsed"}}</div>
|
<div class="three wide column">{{tr "SwapUsed"}}</div>
|
||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
<div :class="formatPercent(server.live,server.State.SwapUsed, server.Host.SwapTotal).class">
|
<div :class="formatPercent(server.live,server.State.SwapUsed, server.Host.SwapTotal).class">
|
||||||
<div class="bar"
|
<div class="bar" :style="formatPercent(server.live,server.State.SwapUsed, server.Host.SwapTotal).style">
|
||||||
:style="formatPercent(server.live,server.State.SwapUsed, server.Host.SwapTotal).style">
|
<small v-if="server.Host.SwapTotal === 0">OFF</small>
|
||||||
<small>@#parseInt(server.State?server.State.SwapUsed/server.Host.SwapTotal*100:0)#@%</small>
|
<small v-else>@#parseInt(server.State.SwapUsed/server.Host.SwapTotal*100)#@%</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="three wide column">{{tr "DiskUsed"}}</div>
|
<div class="three wide column">{{tr "DiskUsed"}}</div>
|
||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
<div :class="formatPercent(server.live,server.State.DiskUsed, server.Host.DiskTotal).class">
|
<div :class="formatPercent(server.live,server.State.DiskUsed, server.Host.DiskTotal).class">
|
||||||
<div class="bar"
|
<div class="bar" :style="formatPercent(server.live,server.State.DiskUsed, server.Host.DiskTotal).style">
|
||||||
:style="formatPercent(server.live,server.State.DiskUsed, server.Host.DiskTotal).style">
|
<small>@#parseInt(server.Host.DiskTotal?server.State.DiskUsed/server.Host.DiskTotal*100:0)#@%</small>
|
||||||
<small>@#parseInt(server.State?server.State.DiskUsed/server.Host.DiskTotal*100:0)#@%</small>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -100,18 +125,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="three wide column">{{tr "Stat"}}</div>
|
<div class="three wide column">{{tr "Stat"}}</div>
|
||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
<i class="bi bi-cpu-fill" style="font-size: 1.1rem; color: #4a86e8;"></i> @#getCoreAndGHz(server.Host.CPU)#@
|
<i class="bi bi-cpu-fill" style="font-size: 1.1rem; color: #4a86e8;"></i>
|
||||||
|
@#getCoreAndGHz(server.Host.CPU)#@
|
||||||
|
|
||||||
<i class="bi bi-memory" style="font-size: 1.1rem; color: #00ac0d;"></i> @#getK2Gb(server.Host.MemTotal)#@
|
<i class="bi bi-memory" style="font-size: 1.1rem; color: #00ac0d;"></i>
|
||||||
|
@#getK2Gb(server.Host.MemTotal)#@
|
||||||
|
|
||||||
<i class="bi bi-hdd" style="font-size: 1.1rem; color: #e41e10"></i> @#getK2Gb(server.Host.DiskTotal)#@
|
<i class="bi bi-hdd" style="font-size: 1.1rem; color: #e41e10"></i>
|
||||||
|
@#getK2Gb(server.Host.DiskTotal)#@
|
||||||
</div>
|
</div>
|
||||||
<div class="three wide column">{{tr "Load"}}</div>
|
<div class="three wide column">{{tr "Load"}}</div>
|
||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
<i class="bi bi-activity" style="font-size: 1.1rem; color: #e41e10;"></i>
|
<i class="bi bi-activity" style="font-size: 1.1rem; color: #e41e10;"></i>
|
||||||
@# toFixed2(server.State.Load1) #@ |
|
@#toFixed2(server.State.Load1)#@ |
|
||||||
@# toFixed2(server.State.Load5) #@ |
|
@#toFixed2(server.State.Load5)#@ |
|
||||||
@# toFixed2(server.State.Load15) #@
|
@#toFixed2(server.State.Load15)#@
|
||||||
</div>
|
</div>
|
||||||
<div class="three wide column">{{tr "Uptime"}}</div>
|
<div class="three wide column">{{tr "Uptime"}}</div>
|
||||||
<div class="thirteen wide column">
|
<div class="thirteen wide column">
|
||||||
@@ -138,13 +166,29 @@
|
|||||||
delimiters: ['@#', '#@'],
|
delimiters: ['@#', '#@'],
|
||||||
data: {
|
data: {
|
||||||
page: 'index',
|
page: 'index',
|
||||||
defaultTemplate: {{.Conf.Site.Theme}},
|
defaultTemplate: {{.Conf.Site.Theme }},
|
||||||
templates: {{.Themes}},
|
templates: {{.Themes }},
|
||||||
servers: [],
|
servers: [],
|
||||||
groups: [],
|
groups: [],
|
||||||
cache: [],
|
cache: [],
|
||||||
chartDataList: [],
|
chartDataList: [],
|
||||||
activePopup: null,
|
activePopup: null,
|
||||||
|
sensorList: [
|
||||||
|
'TC0D', //CPU Die 温度,代表 CPU 内部的温度
|
||||||
|
'TC0H', //CPU Heatsink 温度,代表 CPU 散热器的温度
|
||||||
|
'TC0P', //CPU Proximity 温度,代表 CPU 附近的温度
|
||||||
|
'k10temp', //AMD K10(Phenom、Athlon、Sempron 等)系列处理器的温度监测
|
||||||
|
'coretemp_package_id_0', //整个封装处理器温度
|
||||||
|
'cpu_thermal_zone', //全志
|
||||||
|
'cpu-thermal', //树莓派(博通)
|
||||||
|
'soc_thermal', //新瑞芯微
|
||||||
|
'cpu_thermal', //老瑞芯微
|
||||||
|
'ACPI\\ThermalZone\\TZ0__0', //Windows
|
||||||
|
'ACPI\\ThermalZone\\CPUZ_0', //Windows
|
||||||
|
'ACPI\\ThermalZone\\TZ00_0', //Windows
|
||||||
|
'ACPI\\ThermalZone\\TZ001_0', //Windows
|
||||||
|
'ACPI\\ThermalZone\\THM0_0' //Windows
|
||||||
|
]
|
||||||
},
|
},
|
||||||
mixins: [mixinsVue],
|
mixins: [mixinsVue],
|
||||||
created() {
|
created() {
|
||||||
@@ -176,7 +220,7 @@
|
|||||||
this.renderCharts(id);
|
this.renderCharts(id);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('this agent (id:'+ id + ') has no monitor.');
|
console.log('this agent (id:' + id + ') has no monitor.');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@@ -185,7 +229,7 @@
|
|||||||
},
|
},
|
||||||
renderCharts(id) {
|
renderCharts(id) {
|
||||||
if (!this.chartDataList[id - 1]) return;
|
if (!this.chartDataList[id - 1]) return;
|
||||||
const MaxTCPPingValue = {{.Conf.MaxTCPPingValue}} ? {{.Conf.MaxTCPPingValue}} : 300;
|
const MaxTCPPingValue = {{.Conf.MaxTCPPingValue }} ? {{.Conf.MaxTCPPingValue }} : 300;
|
||||||
const isMobile = this.checkIsMobile();
|
const isMobile = this.checkIsMobile();
|
||||||
const fontSize = isMobile ? 10 : 9;
|
const fontSize = isMobile ? 10 : 9;
|
||||||
const itemGap = isMobile ? 6 : 6;
|
const itemGap = isMobile ? 6 : 6;
|
||||||
@@ -208,10 +252,10 @@
|
|||||||
const seriesData = chartData.map(item => {
|
const seriesData = chartData.map(item => {
|
||||||
let loss = 0;
|
let loss = 0;
|
||||||
const data = item.avg_delay.map((avgDelay, index) => {
|
const data = item.avg_delay.map((avgDelay, index) => {
|
||||||
if(avgDelay > 0 && avgDelay < MaxTCPPingValue){
|
if (avgDelay > 0 && avgDelay < MaxTCPPingValue) {
|
||||||
loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0;
|
loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0;
|
||||||
return [item.created_at[index], avgDelay];
|
return [item.created_at[index], avgDelay];
|
||||||
}else{
|
} else {
|
||||||
loss += 1;
|
loss += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -255,7 +299,7 @@
|
|||||||
itemGap: itemGap,
|
itemGap: itemGap,
|
||||||
itemWidth: itemWidth,
|
itemWidth: itemWidth,
|
||||||
itemHeight: itemHeight,
|
itemHeight: itemHeight,
|
||||||
padding: [5,0,5,0]
|
padding: [5, 0, 5, 0]
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
@@ -351,7 +395,10 @@
|
|||||||
> -1) {
|
> -1) {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
if (['openwrt','linux'].indexOf(str) > -1) {
|
if (str == 'darwin') {
|
||||||
|
return 'apple';
|
||||||
|
}
|
||||||
|
if (['openwrt', 'linux'].indexOf(str) > -1) {
|
||||||
return 'tux';
|
return 'tux';
|
||||||
}
|
}
|
||||||
if (str == 'amazon') {
|
if (str == 'amazon') {
|
||||||
@@ -360,6 +407,9 @@
|
|||||||
if (str == 'arch') {
|
if (str == 'arch') {
|
||||||
return 'archlinux';
|
return 'archlinux';
|
||||||
}
|
}
|
||||||
|
if (str.toLowerCase().includes('opensuse')) {
|
||||||
|
return 'opensuse';
|
||||||
|
}
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
group() {
|
group() {
|
||||||
@@ -383,6 +433,9 @@
|
|||||||
if (percent < 0) {
|
if (percent < 0) {
|
||||||
this.cache[percent].style['background-color'] = 'slategray'
|
this.cache[percent].style['background-color'] = 'slategray'
|
||||||
this.cache[percent].class.offline = true
|
this.cache[percent].class.offline = true
|
||||||
|
if (!live) {
|
||||||
|
this.cache[percent].percent = 0
|
||||||
|
}
|
||||||
} else if (percent < 51) {
|
} else if (percent < 51) {
|
||||||
this.cache[percent].style['background-color'] = '#0a94f2'
|
this.cache[percent].style['background-color'] = '#0a94f2'
|
||||||
this.cache[percent].class.fine = true
|
this.cache[percent].class.fine = true
|
||||||
@@ -417,41 +470,84 @@
|
|||||||
if (!bytes) {
|
if (!bytes) {
|
||||||
return '0B'
|
return '0B'
|
||||||
}
|
}
|
||||||
const i = Math.floor(Math.log(bytes) / Math.log(1024)),
|
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||||
sizes = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"];
|
const sizes = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"];
|
||||||
return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + sizes[i];
|
return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + sizes[i];
|
||||||
},
|
},
|
||||||
getCoreAndGHz(str){
|
getCoreAndGHz(str){
|
||||||
if((str || []).hasOwnProperty(0) === false){
|
if ((str || []).hasOwnProperty(0) === false) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
str = str[0];
|
str = str[0];
|
||||||
let GHz = str.match(/(\d|\.)+GHz/g);
|
let GHz = str.match(/(\d|\.)+GHz/g);
|
||||||
let Core = str.match(/(\d|\.)+ Physical/g);
|
let Core = str.match(/(\d|\.)+ Physical/g);
|
||||||
GHz = GHz!==null?GHz.hasOwnProperty(0)===false?'':GHz[0]:''
|
GHz = GHz !== null ? GHz.hasOwnProperty(0) === false ? '' : GHz[0] : ''
|
||||||
Core = Core!==null?Core.hasOwnProperty(0)===false?'?':Core[0]:'?'
|
Core = Core !== null ? Core.hasOwnProperty(0) === false ? '?' : Core[0] : '?'
|
||||||
if(Core === '?'){
|
if (Core === '?') {
|
||||||
let Core = str.match(/(\d|\.)+ Virtual/g);
|
let Core = str.match(/(\d|\.)+ Virtual/g);
|
||||||
Core = Core!==null?Core.hasOwnProperty(0)===false?'?':Core[0]:'?'
|
Core = Core !== null ? Core.hasOwnProperty(0) === false ? '?' : Core[0] : '?'
|
||||||
return Core.replace('Virtual','Core')
|
return Core.replace('Virtual', 'Core')
|
||||||
}
|
}
|
||||||
return Core.replace('Physical','Core');
|
return Core.replace('Physical', 'Core');
|
||||||
},
|
},
|
||||||
getK2Gb(bs){
|
getK2Gb(bs){
|
||||||
bs = bs / 1024 /1024 /1024;
|
bs = bs / 1024 / 1024 / 1024;
|
||||||
if(bs>=1){
|
if (bs >= 1) {
|
||||||
return Math.ceil(bs.toFixed(2)) + 'GB';
|
return Math.ceil(bs.toFixed(2)) + 'GB';
|
||||||
}else{
|
} else {
|
||||||
bs = bs * 1024;
|
bs = bs * 1024;
|
||||||
return Math.ceil(bs.toFixed(2)) + 'MB';
|
return Math.ceil(bs.toFixed(2)) + 'MB';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
listTipsMouseenter(obj,strs,tipsNum=1){
|
listTipsMouseenter(obj, strs, tipsNum = 1){
|
||||||
this.layerIndex = layer.tips(strs, '#'+obj,{tips: [tipsNum, 'rgb(0 0 0 / 85%)'],time:0});
|
this.layerIndex = layer.tips(strs, '#' + obj, { tips: [tipsNum, 'rgb(0 0 0 / 85%)'], time: 0 });
|
||||||
$('#'+obj).attr('layerIndex',this.layerIndex)
|
$('#' + obj).attr('layerIndex', this.layerIndex)
|
||||||
},
|
},
|
||||||
listTipsMouseleave(obj){
|
listTipsMouseleave(obj){
|
||||||
layer.close(this.layerIndex)
|
layer.close(this.layerIndex)
|
||||||
|
},
|
||||||
|
toggleDetailedTemp(id){
|
||||||
|
const tempDom = document.getElementById(`temp-${id}`);
|
||||||
|
const tempDetailShow = tempDom.getAttribute('temp-detail-show');
|
||||||
|
const tempMain = document.getElementById(`temp-main-${id}`);
|
||||||
|
const tempDetail = document.getElementById(`temp-detail-${id}`);
|
||||||
|
if (tempDetailShow == 0){
|
||||||
|
tempMain.style.display = 'none';
|
||||||
|
tempDetail.style.display = 'inline';
|
||||||
|
tempDom.setAttribute('temp-detail-show', 1);
|
||||||
|
} else {
|
||||||
|
tempMain.style.display = 'inline';
|
||||||
|
tempDetail.style.display = 'none';
|
||||||
|
tempDom.setAttribute('temp-detail-show', 0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getTemperature(temperatureList, sensorList) {
|
||||||
|
// 将 sensorList 中的所有项转换为小写
|
||||||
|
const lowerCaseSensorList = sensorList.map(sensor => sensor.toLowerCase());
|
||||||
|
|
||||||
|
// 合并过滤逻辑:过滤出 Temperature 不为 0 且 Name 在 sensorList 中的元素(忽略大小写)
|
||||||
|
const filtered = temperatureList.filter(item => item.Temperature !== 0 && lowerCaseSensorList.includes(item.Name.toLowerCase()));
|
||||||
|
//console.log('filtered:',filtered);
|
||||||
|
|
||||||
|
// 如果有匹配的元素,则计算这些元素的 Temperature 的最大值
|
||||||
|
if (filtered.length > 0) {
|
||||||
|
return filtered.reduce((max, current) => {
|
||||||
|
return current.Temperature > max ? current.Temperature : max;
|
||||||
|
}, filtered[0].Temperature);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果没有匹配的元素,则计算 temperatureList 中所有 Temperature 不为 0 的元素的最大值
|
||||||
|
const nonZeroTemps = temperatureList.filter(item => item.Temperature !== 0);
|
||||||
|
//console.log('nonZeroTemps:',nonZeroTemps);
|
||||||
|
|
||||||
|
if (nonZeroTemps.length > 0) {
|
||||||
|
return nonZeroTemps.reduce((max, current) => {
|
||||||
|
return current.Temperature > max ? current.Temperature : max;
|
||||||
|
}, nonZeroTemps[0].Temperature);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果所有元素的 Temperature 都为 0,则返回一个默认值 0
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -497,8 +593,9 @@
|
|||||||
statusCards.servers = data.servers
|
statusCards.servers = data.servers
|
||||||
for (let i = 0; i < statusCards.servers.length; i++) {
|
for (let i = 0; i < statusCards.servers.length; i++) {
|
||||||
const ns = statusCards.servers[i];
|
const ns = statusCards.servers[i];
|
||||||
if (!ns.Host) ns.live = false
|
if (!ns.Host) {
|
||||||
else {
|
ns.live = false
|
||||||
|
} else {
|
||||||
const lastActive = new Date(ns.LastActive).getTime()
|
const lastActive = new Date(ns.LastActive).getTime()
|
||||||
if (data.now - lastActive > 10 * 1000) {
|
if (data.now - lastActive > 10 * 1000) {
|
||||||
ns.live = false
|
ns.live = false
|
||||||
|
|||||||
+3
@@ -27,6 +27,9 @@
|
|||||||
<i :class="item.icon + ' icon'"></i>@#item.name#@
|
<i :class="item.icon + ' icon'"></i>@#item.name#@
|
||||||
<i class="check icon" v-if="preferredTemplate === item.key"></i>
|
<i class="check icon" v-if="preferredTemplate === item.key"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a v-if="defaultTemplate === 'custom'" @click="toggleTemplate('custom')" class="item">
|
||||||
|
<i class="expand icon"></i>Custom
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
+1
-1
@@ -221,7 +221,7 @@
|
|||||||
var disk = this.formatByteSize(server.State.DiskUsed) + '/' + this.formatByteSize(server.Host.DiskTotal);
|
var disk = this.formatByteSize(server.State.DiskUsed) + '/' + this.formatByteSize(server.Host.DiskTotal);
|
||||||
var upTime = this.secondToDate(server.State.Uptime);
|
var upTime = this.secondToDate(server.State.Uptime);
|
||||||
var tooltip =
|
var tooltip =
|
||||||
`{content: 'System: ${server.Host.Platform}-${server.Host.PlatformVersion}[${server.Host.Arch}]<br>CPU: ${server.Host.CPU}<br>Disk: ${disk}<br>Online: ${upTime}<br>Version: ${server.Host.Version}'}`;
|
`{content: 'System: ${server.Host.Platform}-${server.Host.PlatformVersion}[${server.Host.Arch}]<br>CPU: ${server.Host.CPU}<br>GPU: ${server.Host.GPU}<br>Disk: ${disk}<br>Online: ${upTime}<br>Version: ${server.Host.Version}'}`;
|
||||||
return tooltip
|
return tooltip
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,11 @@
|
|||||||
<i class="check icon" v-if="preferredTemplate === item.key"></i>
|
<i class="check icon" v-if="preferredTemplate === item.key"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li v-if="defaultTemplate === 'custom'">
|
||||||
|
<a @click="toggleTemplate('custom')" class="item">
|
||||||
|
<i class="expand icon" style="font-size:1em"></i>Custom
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
+21
-14
@@ -6,16 +6,22 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
|
<link rel="shortcut icon" type="image/png" href="/static/logo.svg" />
|
||||||
<link rel="stylesheet" href="/static/theme-server-status/css/bootstrap-theme.min.css">
|
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="/static/theme-server-status/css/main.css?v20240407">
|
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap-theme.min.css">
|
||||||
|
<link rel="stylesheet" href="/static/theme-server-status/css/main.css?v20240616">
|
||||||
<link rel="stylesheet" href="/static/theme-server-status/css/dark.css?v20240407">
|
<link rel="stylesheet" href="/static/theme-server-status/css/dark.css?v20240407">
|
||||||
<link rel="stylesheet" href="/static/theme-server-status/css/light.css?v20240407">
|
<link rel="stylesheet" href="/static/theme-server-status/css/light.css?v20240407">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].2/font/bootstrap-icons.min.css">
|
<link rel="stylesheet" href="https://unpkg.com/[email protected].3/font/bootstrap-icons.min.css">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/assets/font-logos.css">
|
<link rel="stylesheet" href="https://unpkg.com/[email protected].0/assets/font-logos.css">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/css/flag-icons.min.css">
|
<link rel="stylesheet" href="https://unpkg.com/flag-icons@7.2.3/css/flag-icons.min.css">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].1/dist/semantic.min.css">
|
<link rel="stylesheet" href="https://unpkg.com/[email protected].0/dist/semantic.min.css">
|
||||||
<link rel="shortcut icon" type="image/png" href="/static/logo.svg" />
|
<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/js/bootstrap.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/dist/echarts.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/[email protected]/map/js/world.js"></script>
|
||||||
|
<script src="/static/theme-server-status/js/mixin.js?v20240302"></script>
|
||||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script src="/static/theme-server-status/js/html5shiv.js"></script>
|
<script src="/static/theme-server-status/js/html5shiv.js"></script>
|
||||||
@@ -24,12 +30,13 @@
|
|||||||
{{if ts .CustomCode}}
|
{{if ts .CustomCode}}
|
||||||
{{.CustomCode|safe}}
|
{{.CustomCode|safe}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts/map/js/world.js"></script>
|
|
||||||
<script src="/static/theme-server-status/js/mixin.js?v20240302"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+28
-8
@@ -27,10 +27,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="node-cell name center">@#node.name#@</td>
|
<td class="node-cell name center">@#node.name#@</td>
|
||||||
<td class="node-cell os center">
|
<td class="node-cell os center">
|
||||||
<i v-if='node.os == "darwin"' class="apple icon"></i>
|
<i v-if='isWindowsPlatform(node.host.Platform)' class="windows icon"></i>
|
||||||
<i v-else-if='isWindowsPlatform(node.host.Platform)' class="windows icon"></i>
|
<i v-else-if='getFontLogoClass(node.host.Platform) == "" && node.stateuptime > 0' class="fl-tux"></i>
|
||||||
<i v-else :class="'fl-' + getFontLogoClass(node.host.Platform)"></i>
|
<i v-else :class="'fl-' + getFontLogoClass(node.host.Platform)"></i>
|
||||||
<span class="node-cell-os-text">@#node.os#@</span>
|
<span class="node-cell-os-text">@#getPlatformName(node.os)#@</span>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: center;" class="node-cell location">
|
<td style="text-align: center;" class="node-cell location">
|
||||||
<i :class="'fi fi-' + node.location"></i>
|
<i :class="'fi fi-' + node.location"></i>
|
||||||
@@ -71,20 +71,27 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand" v-if="node.host.CPU">
|
<span class="node-cell-expand" v-if="node.host.CPU">
|
||||||
<span class="node-cell-expand-label">CPU:</span>
|
<span class="node-cell-expand-label">CPU:</span>
|
||||||
@#node.host.CPU.join(",")#@
|
@#node.host.CPU.join(",")#@ (@#node.cpu.percent#@%)
|
||||||
|
</span>
|
||||||
|
<span class="node-cell-expand" v-if="node.host.GPU">
|
||||||
|
<span class="node-cell-expand-label">GPU:</span>
|
||||||
|
@#node.host.GPU.join(",")#@ (@#node.gpu.percent#@%)
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "DiskUsed"}}:</span>
|
<span class="node-cell-expand-label">{{tr "DiskUsed"}}:</span>
|
||||||
@#formatByteSize(node.state.DiskUsed)#@ / @#formatByteSize(node.host.DiskTotal)#@
|
@#formatByteSize(node.state.DiskUsed)#@ / @#formatByteSize(node.host.DiskTotal)#@ (@#node.hdd.percent#@%)
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "MemUsed"}}:</span>
|
<span class="node-cell-expand-label">{{tr "MemUsed"}}:</span>
|
||||||
@#formatByteSize(node.state.MemUsed)#@ / @#formatByteSize(node.host.MemTotal)#@(@#toFixed2(node.state.MemUsed / node.host.MemTotal * 100)#@%)
|
@#formatByteSize(node.state.MemUsed)#@ / @#formatByteSize(node.host.MemTotal)#@ (@#node.memory.percent#@%)
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span v-if="node.host.SwapTotal > 0" class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "SwapUsed"}}:</span>
|
<span class="node-cell-expand-label">{{tr "SwapUsed"}}:</span>
|
||||||
@#formatByteSize(node.state.SwapUsed)#@ / @#formatByteSize(node.host.SwapTotal)#@
|
@#formatByteSize(node.state.SwapUsed)#@ / @#formatByteSize(node.host.SwapTotal)#@
|
||||||
<span v-if="node.host.SwapTotal">(@#toFixed2(node.state.SwapUsed / node.host.SwapTotal * 100)#@%)</span>
|
<span>(@#toFixed2(node.state.SwapUsed / node.host.SwapTotal * 100)#@%)</span>
|
||||||
|
</span>
|
||||||
|
<span v-else class="node-cell-expand">
|
||||||
|
<span class="node-cell-expand-label">{{tr "SwapUsed"}}: OFF</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "NetTransfer"}}:</span>
|
<span class="node-cell-expand-label">{{tr "NetTransfer"}}:</span>
|
||||||
@@ -117,6 +124,19 @@
|
|||||||
<span class="node-cell-expand-label">{{tr "Uptime"}}:</span>
|
<span class="node-cell-expand-label">{{tr "Uptime"}}:</span>
|
||||||
@#node.uptime#@
|
@#node.uptime#@
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="node.state.Temperatures && getTemperature(node.state.Temperatures, sensorList) > 0" @click="toggleDetailedTemp(node.ID)" class="node-cell-expand temp-detail" :id="`temp-${node.ID}`" temp-detail-show="0">
|
||||||
|
<span class="node-cell-expand-label">{{tr "Temperature"}}:</span>
|
||||||
|
<span :id="`temp-main-${node.ID}`" class="node-cell-expand-label">
|
||||||
|
@#getTemperature(node.state.Temperatures, sensorList)#@°C
|
||||||
|
<i class="bi bi-chevron-double-down"></i>
|
||||||
|
</span>
|
||||||
|
<span :id="`temp-detail-${node.ID}`" class="node-cell-expand-label" style="display:none">
|
||||||
|
<span v-for="temp in node.state.Temperatures" :key="temp.Name" v-if="temp.Temperature !== 0">
|
||||||
|
[ @#temp.Name#@ : @#temp.Temperature#@°C ]
|
||||||
|
</span>
|
||||||
|
<i class="bi bi-chevron-double-up"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "Version"}}:</span>
|
<span class="node-cell-expand-label">{{tr "Version"}}:</span>
|
||||||
@#node.host.Version#@
|
@#node.host.Version#@
|
||||||
|
|||||||
+28
-8
@@ -30,10 +30,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="node-cell name center">@#node.name#@</td>
|
<td class="node-cell name center">@#node.name#@</td>
|
||||||
<td class="node-cell os center">
|
<td class="node-cell os center">
|
||||||
<i v-if='node.os == "darwin"' class="apple icon"></i>
|
<i v-if='isWindowsPlatform(node.host.Platform)' class="windows icon"></i>
|
||||||
<i v-else-if='isWindowsPlatform(node.host.Platform)' class="windows icon"></i>
|
<i v-else-if='getFontLogoClass(node.host.Platform) == "" && node.stateuptime > 0' class="fl-tux"></i>
|
||||||
<i v-else :class="'fl-' + getFontLogoClass(node.host.Platform)"></i>
|
<i v-else :class="'fl-' + getFontLogoClass(node.host.Platform)"></i>
|
||||||
<span class="node-cell-os-text">@#node.os#@</span>
|
<span class="node-cell-os-text">@#getPlatformName(node.os)#@</span>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: center;" class="node-cell location">
|
<td style="text-align: center;" class="node-cell location">
|
||||||
<i :class="'fi fi-' + node.location"></i>
|
<i :class="'fi fi-' + node.location"></i>
|
||||||
@@ -74,20 +74,27 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand" v-if="node.host.CPU">
|
<span class="node-cell-expand" v-if="node.host.CPU">
|
||||||
<span class="node-cell-expand-label">CPU:</span>
|
<span class="node-cell-expand-label">CPU:</span>
|
||||||
@#node.host.CPU.join(",")#@
|
@#node.host.CPU.join(",")#@ (@#node.cpu.percent#@%)
|
||||||
|
</span>
|
||||||
|
<span class="node-cell-expand" v-if="node.host.GPU">
|
||||||
|
<span class="node-cell-expand-label">GPU:</span>
|
||||||
|
@#node.host.GPU.join(",")#@ (@#node.gpu.percent#@%)
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "DiskUsed"}}:</span>
|
<span class="node-cell-expand-label">{{tr "DiskUsed"}}:</span>
|
||||||
@#formatByteSize(node.state.DiskUsed)#@ / @#formatByteSize(node.host.DiskTotal)#@
|
@#formatByteSize(node.state.DiskUsed)#@ / @#formatByteSize(node.host.DiskTotal)#@ (@#node.hdd.percent#@%)
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "MemUsed"}}:</span>
|
<span class="node-cell-expand-label">{{tr "MemUsed"}}:</span>
|
||||||
@#formatByteSize(node.state.MemUsed)#@ / @#formatByteSize(node.host.MemTotal)#@(@#toFixed2(node.state.MemUsed / node.host.MemTotal * 100)#@%)
|
@#formatByteSize(node.state.MemUsed)#@ / @#formatByteSize(node.host.MemTotal)#@ (@#node.memory.percent#@%)
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span v-if="node.host.SwapTotal > 0" class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "SwapUsed"}}:</span>
|
<span class="node-cell-expand-label">{{tr "SwapUsed"}}:</span>
|
||||||
@#formatByteSize(node.state.SwapUsed)#@ / @#formatByteSize(node.host.SwapTotal)#@
|
@#formatByteSize(node.state.SwapUsed)#@ / @#formatByteSize(node.host.SwapTotal)#@
|
||||||
<span v-if="node.host.SwapTotal">(@#toFixed2(node.state.SwapUsed / node.host.SwapTotal * 100)#@%)</span>
|
<span>(@#toFixed2(node.state.SwapUsed / node.host.SwapTotal * 100)#@%)</span>
|
||||||
|
</span>
|
||||||
|
<span v-else class="node-cell-expand">
|
||||||
|
<span class="node-cell-expand-label">{{tr "SwapUsed"}}: OFF</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "NetTransfer"}}:</span>
|
<span class="node-cell-expand-label">{{tr "NetTransfer"}}:</span>
|
||||||
@@ -120,6 +127,19 @@
|
|||||||
<span class="node-cell-expand-label">{{tr "Uptime"}}:</span>
|
<span class="node-cell-expand-label">{{tr "Uptime"}}:</span>
|
||||||
@#node.uptime#@
|
@#node.uptime#@
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="node.state.Temperatures && getTemperature(node.state.Temperatures, sensorList) > 0" @click="toggleDetailedTemp(node.ID)" class="node-cell-expand temp-detail" :id="`temp-${node.ID}`" temp-detail-show="0">
|
||||||
|
<span class="node-cell-expand-label">{{tr "Temperature"}}:</span>
|
||||||
|
<span :id="`temp-main-${node.ID}`" class="node-cell-expand-label">
|
||||||
|
@#getTemperature(node.state.Temperatures, sensorList)#@°C
|
||||||
|
<i class="bi bi-chevron-double-down"></i>
|
||||||
|
</span>
|
||||||
|
<span :id="`temp-detail-${node.ID}`" class="node-cell-expand-label" style="display:none">
|
||||||
|
<span v-for="temp in node.state.Temperatures" :key="temp.Name" v-if="temp.Temperature !== 0">
|
||||||
|
[ @#temp.Name#@ : @#temp.Temperature#@°C ]
|
||||||
|
</span>
|
||||||
|
<i class="bi bi-chevron-double-up"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
<span class="node-cell-expand">
|
<span class="node-cell-expand">
|
||||||
<span class="node-cell-expand-label">{{tr "Version"}}:</span>
|
<span class="node-cell-expand-label">{{tr "Version"}}:</span>
|
||||||
@#node.host.Version#@
|
@#node.host.Version#@
|
||||||
|
|||||||
+74
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -195,7 +195,7 @@ install_arch() {
|
|||||||
[yY][eE][sS] | [yY])
|
[yY][eE][sS] | [yY])
|
||||||
useradd -m nezha-agent
|
useradd -m nezha-agent
|
||||||
sed -i "$ a\nezha-agent ALL=(ALL ) NOPASSWD:ALL" /etc/sudoers
|
sed -i "$ a\nezha-agent ALL=(ALL ) NOPASSWD:ALL" /etc/sudoers
|
||||||
sudo -iu nezha-agent bash -c 'gpg --keyserver keys.gnupg.net --recv-keys BE22091E3EF62275;
|
sudo -iu nezha-agent bash -c 'gpg --keyserver keys.gnupg.net --recv-keys 4695881C254508D1;
|
||||||
cd /tmp; git clone https://aur.archlinux.org/libsepol.git; cd libsepol; makepkg -si --noconfirm --asdeps; cd ..;
|
cd /tmp; git clone https://aur.archlinux.org/libsepol.git; cd libsepol; makepkg -si --noconfirm --asdeps; cd ..;
|
||||||
git clone https://aur.archlinux.org/libselinux.git; cd libselinux; makepkg -si --noconfirm; cd ..;
|
git clone https://aur.archlinux.org/libselinux.git; cd libselinux; makepkg -si --noconfirm; cd ..;
|
||||||
rm -rf libsepol libselinux'
|
rm -rf libsepol libselinux'
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ before_show_menu() {
|
|||||||
|
|
||||||
install_base() {
|
install_base() {
|
||||||
(command -v git >/dev/null 2>&1 && command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v unzip >/dev/null 2>&1 && command -v getenforce >/dev/null 2>&1) ||
|
(command -v git >/dev/null 2>&1 && command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v unzip >/dev/null 2>&1 && command -v getenforce >/dev/null 2>&1) ||
|
||||||
(install_soft curl wget git unzip tzdata)
|
(install_soft curl wget git unzip)
|
||||||
}
|
}
|
||||||
|
|
||||||
install_arch() {
|
install_arch() {
|
||||||
@@ -192,7 +192,7 @@ install_arch() {
|
|||||||
[yY][eE][sS] | [yY])
|
[yY][eE][sS] | [yY])
|
||||||
useradd -m nezha-agent
|
useradd -m nezha-agent
|
||||||
sed -i "$ a\nezha-agent ALL=(ALL ) NOPASSWD:ALL" /etc/sudoers
|
sed -i "$ a\nezha-agent ALL=(ALL ) NOPASSWD:ALL" /etc/sudoers
|
||||||
sudo -iu nezha-agent bash -c 'gpg --keyserver keys.gnupg.net --recv-keys BE22091E3EF62275;
|
sudo -iu nezha-agent bash -c 'gpg --keyserver keys.gnupg.net --recv-keys 4695881C254508D1;
|
||||||
cd /tmp; git clone https://aur.archlinux.org/libsepol.git; cd libsepol; makepkg -si --noconfirm --asdeps; cd ..;
|
cd /tmp; git clone https://aur.archlinux.org/libsepol.git; cd libsepol; makepkg -si --noconfirm --asdeps; cd ..;
|
||||||
git clone https://aur.archlinux.org/libselinux.git; cd libselinux; makepkg -si --noconfirm; cd ..;
|
git clone https://aur.archlinux.org/libselinux.git; cd libselinux; makepkg -si --noconfirm; cd ..;
|
||||||
rm -rf libsepol libselinux'
|
rm -rf libsepol libselinux'
|
||||||
|
|||||||
Reference in New Issue
Block a user