diff options
author | Emiliano Ciavatta | 2020-12-25 14:48:57 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-12-25 14:48:57 +0000 |
commit | ce6634beb19fdeeb0e92f70e554c8abc1d643e5c (patch) | |
tree | 355692de60b771b0a557b0e4df65720bcf39cd08 | |
parent | 4385727cf96868946759591935d1d2ca72cc7dbf (diff) |
Fix error in stats page
-rw-r--r-- | application_router.go | 2 | ||||
-rw-r--r-- | frontend/src/components/panels/StatsPane.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/application_router.go b/application_router.go index 2dcdfd6..6d65960 100644 --- a/application_router.go +++ b/application_router.go @@ -39,7 +39,7 @@ func CreateApplicationRouter(applicationContext *ApplicationContext, router.Use(static.Serve("/", static.LocalFile("./frontend/build", true))) - for _, path := range []string{"/connections/:id", "/pcaps", "/rules", "/services", "/config", "/searches"} { + for _, path := range []string{"/connections/:id", "/pcaps", "/rules", "/services", "/stats", "/searches"} { router.GET(path, func(c *gin.Context) { c.File("./frontend/build/index.html") }) diff --git a/frontend/src/components/panels/StatsPane.js b/frontend/src/components/panels/StatsPane.js index dd774d0..a35ef0c 100644 --- a/frontend/src/components/panels/StatsPane.js +++ b/frontend/src/components/panels/StatsPane.js @@ -80,7 +80,7 @@ class StatsPane extends Component { const s = this.state.stats; const rs = this.state.resourcesStats; - const ports = s ? Object.keys(s["connections_per_service"]) : []; + const ports = s && s["connections_per_service"] ? Object.keys(s["connections_per_service"]) : []; let connections = 0, clientBytes = 0, serverBytes = 0, totalBytes = 0, duration = 0; let servicesStats = ports.map((port) => { connections += s["connections_per_service"][port]; |