wip(logs): displaying image

WIP because we need to bypass authorization here
This commit is contained in:
2025-04-19 14:06:05 +01:00
parent 839a1af51b
commit 1d07fa271d

View File

@ -82,6 +82,8 @@ func createLogHandler(logWriter *DatabaseWriter) func(r chi.Router) {
html := ""
imageTag := fmt.Sprintf(`<image src="http://localhost:3040/image/%s">`, stringImageId)
for _, log := range logs {
html += fmt.Sprintf("<div>%s</div>", string(ansihtml.ConvertToHTML([]byte(log)))+"\n")
}
@ -112,7 +114,7 @@ func createLogHandler(logWriter *DatabaseWriter) func(r chi.Router) {
</style>
`
fullHtml := fmt.Sprintf("<html><head><title>Logs</title>%s</head><body>%s</body></html>", css, html)
fullHtml := fmt.Sprintf("<html><head><title>Logs</title>%s</head><body>%s%s</body></html>", css, imageTag, html)
w.Header().Add("Content-Type", "text/html")
w.Write([]byte(fullHtml))