Fix not displaying summary table properly with bird2

This commit is contained in:
Lan Tian 2020-03-01 01:29:35 +08:00
parent 245ef1462b
commit 5d91c9d6d1
No known key found for this signature in database
GPG Key ID: 27F31700E751EC22

View File

@ -95,7 +95,7 @@ func webHandler(w http.ResponseWriter, r *http.Request, endpoint string, serverQ
var responses []string = batchRequest(servers, endpoint, command) var responses []string = batchRequest(servers, endpoint, command)
for i, response := range responses { for i, response := range responses {
w.Write([]byte("<h2>" + html.EscapeString(servers[i]) + ": " + html.EscapeString(command) + "</h2>")) w.Write([]byte("<h2>" + html.EscapeString(servers[i]) + ": " + html.EscapeString(command) + "</h2>"))
if (endpoint == "bird" || endpoint == "bird6") && command == "show protocols" && response[0:4] == "name" { if (endpoint == "bird" || endpoint == "bird6") && command == "show protocols" && strings.ToLower(response[0:4]) == "name" {
var isIPv6 bool = endpoint[len(endpoint) - 1] == '6' var isIPv6 bool = endpoint[len(endpoint) - 1] == '6'
summaryTable(w, isIPv6, response, servers[i]) summaryTable(w, isIPv6, response, servers[i])
} else { } else {