From 70e072b679a9d156102135dec78adea066147268 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 8 Nov 2024 12:24:46 +0100 Subject: pkg/html/pages: move HTML code to a separate file --- pkg/html/pages/stats.go | 40 ++++------------------------------------ pkg/html/pages/stats.html | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 36 deletions(-) create mode 100644 pkg/html/pages/stats.html (limited to 'pkg/html') diff --git a/pkg/html/pages/stats.go b/pkg/html/pages/stats.go index 3bc60cc5d..855ad0af8 100644 --- a/pkg/html/pages/stats.go +++ b/pkg/html/pages/stats.go @@ -5,6 +5,7 @@ package pages import ( "bytes" + _ "embed" "fmt" "html/template" @@ -20,40 +21,7 @@ func StatsHTML() (template.HTML, error) { return template.HTML(buf.String()), nil } -var statsTemplate = Create(` - - - -{{range $g := .}} -
-{{end}} -`) +//go:embed stats.html +var statsHtml string diff --git a/pkg/html/pages/stats.html b/pkg/html/pages/stats.html new file mode 100644 index 000000000..d535aac4d --- /dev/null +++ b/pkg/html/pages/stats.html @@ -0,0 +1,40 @@ +{{/* +Copyright 2024 syzkaller project authors. All rights reserved. +Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +*/}} + + + + +{{range $g := .}} +
+{{end}} -- cgit mrf-deployment