forked from Ivasoft/traefik
Add TCP Middlewares support
This commit is contained in:
@@ -45,8 +45,9 @@ func (h Handler) getOverview(rw http.ResponseWriter, request *http.Request) {
|
||||
Middlewares: getHTTPMiddlewareSection(h.runtimeConfiguration.Middlewares),
|
||||
},
|
||||
TCP: schemeOverview{
|
||||
Routers: getTCPRouterSection(h.runtimeConfiguration.TCPRouters),
|
||||
Services: getTCPServiceSection(h.runtimeConfiguration.TCPServices),
|
||||
Routers: getTCPRouterSection(h.runtimeConfiguration.TCPRouters),
|
||||
Services: getTCPServiceSection(h.runtimeConfiguration.TCPServices),
|
||||
Middlewares: getTCPMiddlewareSection(h.runtimeConfiguration.TCPMiddlewares),
|
||||
},
|
||||
UDP: schemeOverview{
|
||||
Routers: getUDPRouterSection(h.runtimeConfiguration.UDPRouters),
|
||||
@@ -160,6 +161,25 @@ func getTCPServiceSection(services map[string]*runtime.TCPServiceInfo) *section
|
||||
}
|
||||
}
|
||||
|
||||
func getTCPMiddlewareSection(middlewares map[string]*runtime.TCPMiddlewareInfo) *section {
|
||||
var countErrors int
|
||||
var countWarnings int
|
||||
for _, mid := range middlewares {
|
||||
switch mid.Status {
|
||||
case runtime.StatusDisabled:
|
||||
countErrors++
|
||||
case runtime.StatusWarning:
|
||||
countWarnings++
|
||||
}
|
||||
}
|
||||
|
||||
return §ion{
|
||||
Total: len(middlewares),
|
||||
Warnings: countWarnings,
|
||||
Errors: countErrors,
|
||||
}
|
||||
}
|
||||
|
||||
func getUDPRouterSection(routers map[string]*runtime.UDPRouterInfo) *section {
|
||||
var countErrors int
|
||||
var countWarnings int
|
||||
|
||||
Reference in New Issue
Block a user