Compare commits

...

5 Commits

Author SHA1 Message Date
shy
9b0046fa51 opt some 2025-03-10 18:57:52 +08:00
shy
862000e2ce add some 2025-03-05 09:36:08 +08:00
shy
10f5cc7099 opt some 2025-03-03 22:21:33 +08:00
shy
6a3f0d8bb9 opt some 2025-03-03 18:52:35 +08:00
shy
9bcc69bb48 add some 2025-03-03 07:53:15 +08:00
4 changed files with 26 additions and 11 deletions

6
go.mod
View File

@ -2,11 +2,11 @@ module 2025-dev.shylinux.com/x/20250213-machine
go 1.13
require 2025-dev.shylinux.com/x/20250215-cluster v0.0.5
require 2025-dev.shylinux.com/x/20250215-cluster v0.0.7
require (
shylinux.com/x/ice v1.5.71
shylinux.com/x/icebergs v1.9.72
shylinux.com/x/ice v1.5.73
shylinux.com/x/icebergs v1.9.75
shylinux.com/x/toolkits v1.0.19
)

12
go.sum
View File

@ -1,5 +1,5 @@
2025-dev.shylinux.com/x/20250215-cluster v0.0.5 h1:vZDKGh+RFMRDWNuPkRvIsO2iTvEa5lM5IDq0Tp+Nt4k=
2025-dev.shylinux.com/x/20250215-cluster v0.0.5/go.mod h1:a/cnjm6D6vkzZ2rvK8uvU3lSsWUs/NWOWl1uBb+LXLM=
2025-dev.shylinux.com/x/20250215-cluster v0.0.7 h1:GhQImaF6RbliJ6467gdeB4AVzCNyz5LwmA9AeCphEvo=
2025-dev.shylinux.com/x/20250215-cluster v0.0.7/go.mod h1:rhNacwQogLrmiNkmoptqpKY9ieRXAhVHenHwZRcdBB8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -49,10 +49,10 @@ shylinux.com/x/go-git/v5 v5.6.7 h1:WD5QSco7m3QooPCgdvQ6/GyGIFPun8C+hex5N41LYlk=
shylinux.com/x/go-git/v5 v5.6.7/go.mod h1:Qb0lA+uIrofZg8NQerhYcJHgGWixFqvS6p3aJ/L5Nlk=
shylinux.com/x/go-qrcode v0.0.3 h1:RMo+Vidbgq3HatLBj7DDXcTbTLFUwzis5K7TqBkD38U=
shylinux.com/x/go-qrcode v0.0.3/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po=
shylinux.com/x/ice v1.5.71 h1:5yrs+9uj3xNjsQuuLed/3lfF10syjbHhUT8LJAJqClo=
shylinux.com/x/ice v1.5.71/go.mod h1:2KKKi+Jridkkg+NWUrSX9S7Pe5zuwihBaVJ0nNY/FmY=
shylinux.com/x/icebergs v1.9.72 h1:y3oVuMZtsI6hX0HLdfgzeDZNSbyoLrVSWl81JQcV+fA=
shylinux.com/x/icebergs v1.9.72/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
shylinux.com/x/ice v1.5.73 h1:wp+KeQ14hLOdxxSou/Y0zHi48Jm4nLx1rFOwGz8ix04=
shylinux.com/x/ice v1.5.73/go.mod h1:uGI73gYkk+FiJt5qmy/aYhoKRJ4wobcJk3WrPGh8Waw=
shylinux.com/x/icebergs v1.9.75 h1:9zAm0ppwUWl0As/vqfQG/QR/vwXa5zmfdIGE/gmvErQ=
shylinux.com/x/icebergs v1.9.75/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
shylinux.com/x/toolkits v0.7.10/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
shylinux.com/x/toolkits v1.0.19 h1:Nrx0xYRc5ph1WS66EZ1hJUCe+2FdSWQ4QP6tBlguikQ=
shylinux.com/x/toolkits v1.0.19/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=

11
src/document/index.shy Normal file
View File

@ -0,0 +1,11 @@
navmenu `
"{{ .Title }}" /
_
"下 载" download/
"文 档" started/
"开 发" development/
_
"应 用" "https://web.shylinux.com/s/20240903-operation/c/web.team.operation.portal"
"源 码" "https://git.shylinux.com/dev/machine"
"社 区" "https://bbs.shylinux.com"
`

View File

@ -4,6 +4,7 @@ import (
"time"
"shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
@ -22,7 +23,7 @@ import (
type Monitor struct {
travel.Travel
fields string `data:"ModelName,Mhz,Core,Thread,CorePercent,ThreadPercent,Total,Free,Available,Used,UsedPercent,DiskTotal,DiskFree,DiskUsed,DiskUsedPercent,BytesRecv,BytesSent,PacketsRecv,PacketsSent,version,time"`
fields string `data:"ModelName,Mhz,Core,Thread,CorePercent,ThreadPercent,Total,Free,Available,Used,UsedPercent,DiskTotal,DiskFree,DiskUsed,DiskUsedPercent,BytesRecv,BytesSent,PacketsRecv,PacketsSent,ip,hostname,version,time"`
script string `name:"script dev nodename port" help:"脚本"`
list string `name:"list space auto" help:"设备监控"`
}
@ -110,6 +111,10 @@ func (s Monitor) List(m *ice.Message, arg ...string) {
m.Push(field, kit.FmtSize(n[0].PacketsRecv))
case "PacketsSent":
m.Push(field, kit.FmtSize(n[0].PacketsSent))
case aaa.IP:
m.Push(field, m.Cmd(tcp.HOST).Append(aaa.IP))
case tcp.HOSTNAME:
m.Push(field, ice.Info.NodeName)
case nfs.VERSION:
m.Push(field, ice.Info.Make.Version)
case mdb.TIME:
@ -119,7 +124,6 @@ func (s Monitor) List(m *ice.Message, arg ...string) {
}
})
m.Action(s.Foreach, s.Script)
m.Cmdy("", s.Script)
} else {
m.Cmdy(web.SPACE, arg[0], m.PrefixKey())
}