frontend: replace non-standard xhtml mix with html5

This commit is contained in:
Arnie97 2020-07-28 14:08:30 +08:00 committed by Lan Tian
parent 20b1233ec8
commit 6e4bbd6410
No known key found for this signature in database
GPG Key ID: 27F31700E751EC22
3 changed files with 10 additions and 9 deletions

View File

@ -148,7 +148,7 @@ func summaryTable(isIPv6 bool, data string, serverName string) string {
result += "</tr>"
}
result += "</tbody></table>"
result += "<!==" + data + "-->"
result += "<!--" + data + "-->"
}
return result

View File

@ -29,16 +29,14 @@ type tmplArguments struct {
var tmpl = template.Must(template.New("tmpl").Parse(`
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" class="no-js">
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
<meta name="renderer" content="webkit"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="renderer" content="webkit">
<title>{{ .Title }}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/viz.js@2.1.2/viz.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/viz.js@2.1.2/lite.render.js" crossorigin="anonymous"></script>
</head>
<body>

View File

@ -99,7 +99,10 @@ func webHandlerBGPMap(endpoint string, command string) func(w http.ResponseWrite
renderTemplate(
w, r,
"Bird-lg Go - "+html.EscapeString(endpoint+" "+backendCommand),
`<script>
`
<script src="https://cdn.jsdelivr.net/npm/viz.js@2.1.2/viz.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/viz.js@2.1.2/lite.render.js" crossorigin="anonymous"></script>
<script>
var viz = new Viz();
viz.renderSVGElement(`+"`"+birdRouteToGraphviz(servers, responses, urlCommands)+"`"+`)
.then(element => {