feat(nodes): add fleet monitoring and host telemetry

Carry sampled host metrics through existing heartbeats and count client identities in SQL. Show the current panel and fleet in a responsive monitoring table based on the approved design.
This commit is contained in:
Hamed Sanaei
2026-12-01 14:05:35 +03:30
parent 267379456a
commit 45236cd492
57 changed files with 3477 additions and 1318 deletions
+11
View File
@@ -18,6 +18,7 @@ import (
type NodeController struct {
nodeService service.NodeService
xrayService service.XrayService
localStatus func() *service.Status
}
func NewNodeController(g *gin.RouterGroup) *NodeController {
@@ -28,6 +29,7 @@ func NewNodeController(g *gin.RouterGroup) *NodeController {
func (a *NodeController) initRouter(g *gin.RouterGroup) {
g.GET("/list", a.list)
g.GET("/overview", a.overview)
g.GET("/get/:id", a.get)
g.GET("/webCert/:id", a.webCert)
@@ -112,6 +114,15 @@ func (a *NodeController) get(c *gin.Context) {
jsonObj(c, n, nil)
}
func (a *NodeController) overview(c *gin.Context) {
var local *service.Status
if a.localStatus != nil {
local = a.localStatus()
}
view, err := a.nodeService.GetNodeOverview(local)
jsonMsgObj(c, I18nWeb(c, "pages.nodes.toasts.list"), view, err)
}
// webCert returns the node's own web TLS certificate/key file paths so the
// inbound form's "Set Cert from Panel" can fill paths that exist on the node.
func (a *NodeController) webCert(c *gin.Context) {