1
0
Fork 0

Manage status for TCP element in the endpoint overview.

This commit is contained in:
Ludovic Fernandez 2019-07-18 15:56:04 +02:00 committed by Traefiker Bot
parent 75aedc8e94
commit 68c349bbfa
6 changed files with 108 additions and 11 deletions

View file

@ -115,30 +115,38 @@ func getHTTPMiddlewareSection(middlewares map[string]*runtime.MiddlewareInfo) *s
func getTCPRouterSection(routers map[string]*runtime.TCPRouterInfo) *section {
var countErrors int
var countWarnings int
for _, rt := range routers {
if rt.Err != "" {
switch rt.Status {
case runtime.StatusDisabled:
countErrors++
case runtime.StatusWarning:
countWarnings++
}
}
return &section{
Total: len(routers),
Warnings: 0, // TODO
Warnings: countWarnings,
Errors: countErrors,
}
}
func getTCPServiceSection(services map[string]*runtime.TCPServiceInfo) *section {
var countErrors int
var countWarnings int
for _, svc := range services {
if svc.Err != nil {
switch svc.Status {
case runtime.StatusDisabled:
countErrors++
case runtime.StatusWarning:
countWarnings++
}
}
return &section{
Total: len(services),
Warnings: 0, // TODO
Warnings: countWarnings,
Errors: countErrors,
}
}