\n
\n {{ if .Error }}Error{{ else }}Success {{ end }}
\n {{ .Message }}
\n \n \n{{end}}\n"),
+ }
+ filet := &embedded.EmbeddedFile{
+ Filename: "index.html",
+ FileModTime: time.Unix(1612247920, 0),
+
+ Content: string("{{define \"content\"}}\n
\n \n
\n{{end}}\n"),
+ }
+ fileu := &embedded.EmbeddedFile{
+ Filename: "login.html",
+ FileModTime: time.Unix(1612351148, 0),
+
+ Content: string("{{define \"content\"}}\n
\n \n
\n Sign in
\n Login to your Spyda account on {{ .InstanceName }}
\n \n
\n
\n \n
\n How to login to your account
\n \n
\n Login to your Spyda account on {{ .InstanceName }} by filling in\n the Username and Password you used when you created your account.\n
\n
\n Check the \"Remember Me\" box if you don't want to have to keep logging in\n every few hours.\n
\n
\n If you have forgotten your password you can request a\n Password Reset as long as you remember\n your username and email address you signed up with and retain access to\n your email (We NEVER store your email address!).\n
\n
\n \n{{end}}\n"),
+ }
+ filev := &embedded.EmbeddedFile{
+ Filename: "page.html",
+ FileModTime: time.Unix(1612012861, 0),
+
+ Content: string("{{define \"content\"}}\n
\n \n {{ .Content }}\n
\n
\n
\n \n{{ end }}\n"),
+ }
+ filew := &embedded.EmbeddedFile{
+ Filename: "search.html",
+ FileModTime: time.Unix(1612351610, 0),
+
+ Content: string("{{define \"content\"}}\n
\n \n
\n{{ template \"pager\" (dict \"Pager\" $.Pager \"SearchQuery\" $.SearchQuery \"SearchTook\" $.SearchTook) }}\n
\n {{ with $.Results }}\n {{ range . }}\n
\n \n {{ .Summary }}{{ else }} class=\"placeholder\">No summary available{{ end }}
\n \n \n {{ else }}\n
No search results
\n {{ end }}\n {{ end }}\n
\n{{ template \"pager\" (dict \"Pager\" $.Pager \"SearchQuery\" $.SearchQuery \"SearchTook\" $.SearchTook) }}\n{{end}}\n"),
+ }
+ filex := &embedded.EmbeddedFile{
+ Filename: "support.html",
+ FileModTime: time.Unix(1612012861, 0),
+
+ Content: string("{{define \"content\"}}\n
\n \n
\n Contact us
\n How can we help you?
\n \n
\n
\n \n \n{{end}}\n"),
+ }
+
+ // define dirs
+ dirm := &embedded.EmbeddedDir{
+ Filename: "",
+ DirModTime: time.Unix(1612351660, 0),
+ ChildFiles: []*embedded.EmbeddedFile{
+ filen, // "404.html"
+ fileo, // "_partials.html"
+ filep, // "add.html"
+ fileq, // "base.html"
+ filer, // "cache.html"
+ files, // "error.html"
+ filet, // "index.html"
+ fileu, // "login.html"
+ filev, // "page.html"
+ filew, // "search.html"
+ filex, // "support.html"
+
+ },
+ }
+
+ // link ChildDirs
+ dirm.ChildDirs = []*embedded.EmbeddedDir{}
+
+ // register embeddedBox
+ embedded.RegisterEmbeddedBox(`templates`, &embedded.EmbeddedBox{
+ Name: `templates`,
+ Time: time.Unix(1612351660, 0),
+ Dirs: map[string]*embedded.EmbeddedDir{
+ "": dirm,
+ },
+ Files: map[string]*embedded.EmbeddedFile{
+ "404.html": filen,
+ "_partials.html": fileo,
+ "add.html": filep,
+ "base.html": fileq,
+ "cache.html": filer,
+ "error.html": files,
+ "index.html": filet,
+ "login.html": fileu,
+ "page.html": filev,
+ "search.html": filew,
+ "support.html": filex,
+ },
+ })
+}
diff --git a/internal/server.go b/internal/server.go
index e5195e2..4631560 100644
--- a/internal/server.go
+++ b/internal/server.go
@@ -217,6 +217,15 @@ func (s *Server) setupMetrics() {
"Duration of crawler tasks",
)
+ // Index stats
+ metrics.NewGaugeFunc(
+ "index", "size",
+ "Size of index (number of indexed entries)",
+ func() float64 {
+ return float64(s.indexer.Size())
+ },
+ )
+
// server info
metrics.NewGaugeVec(
"server", "info",