mirror of
https://github.com/mudler/edgevpn.git
synced 2025-10-22 08:09:37 +08:00
⚙️ Add summary to client API
This commit is contained in:
14
api/api.go
14
api/api.go
@@ -86,10 +86,16 @@ func API(ctx context.Context, l string, defaultInterval, timeout time.Duration,
|
||||
|
||||
blockchain := ledger.Index()
|
||||
|
||||
return c.JSON(http.StatusOK, struct {
|
||||
Files, Machines, Users, Services, BlockChain, OnChainNodes, Peers int
|
||||
NodeID string
|
||||
}{files, machines, users, services, blockchain, onChainNodes, p2pPeers, nodeID})
|
||||
return c.JSON(http.StatusOK, types.Summary{
|
||||
Files: files,
|
||||
Machines: machines,
|
||||
Users: users,
|
||||
Services: services,
|
||||
BlockChain: blockchain,
|
||||
OnChainNodes: onChainNodes,
|
||||
Peers: p2pPeers,
|
||||
NodeID: nodeID,
|
||||
})
|
||||
})
|
||||
|
||||
ec.GET("/api/machines", func(c echo.Context) error {
|
||||
|
Reference in New Issue
Block a user