mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 16:04:50 +03:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user