完善直播节点监控与边缘代理
This commit is contained in:
1 parent
058bb4b99f
commit
20cd99efa4
19 files changed
+401
-47
No files matched your search
@@ -26,6 +26,8 @@ func onReady(ag *agent.Agent) {
|
||||
|
||||
mStatus := systray.AddMenuItem("Node: "+ag.NodeID(), "Node")
|
||||
mStatus.Disable()
|
||||
mConnection := systray.AddMenuItem("Connection: connecting", "Master connection")
|
||||
mConnection.Disable()
|
||||
|
||||
systray.AddSeparator()
|
||||
|
||||
@@ -46,6 +48,11 @@ func onReady(ag *agent.Agent) {
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
if ag.Connected() {
|
||||
mConnection.SetTitle("Connection: connected")
|
||||
} else {
|
||||
mConnection.SetTitle("Connection: disconnected")
|
||||
}
|
||||
m := ag.Metrics()
|
||||
mCPU.SetTitle(fmt.Sprintf("CPU: %.1f%%", m.CPU))
|
||||
mMem.SetTitle(fmt.Sprintf("MEM: %.1f%%", m.Memory))
|
||||
|
||||
Reference in new issue
Block a user