wip(logs): displaying image
WIP because we need to bypass authorization here
This commit is contained in:
@ -82,6 +82,8 @@ func createLogHandler(logWriter *DatabaseWriter) func(r chi.Router) {
|
|||||||
|
|
||||||
html := ""
|
html := ""
|
||||||
|
|
||||||
|
imageTag := fmt.Sprintf(`<image src="http://localhost:3040/image/%s">`, stringImageId)
|
||||||
|
|
||||||
for _, log := range logs {
|
for _, log := range logs {
|
||||||
html += fmt.Sprintf("<div>%s</div>", string(ansihtml.ConvertToHTML([]byte(log)))+"\n")
|
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>
|
</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.Header().Add("Content-Type", "text/html")
|
||||||
w.Write([]byte(fullHtml))
|
w.Write([]byte(fullHtml))
|
||||||
|
Reference in New Issue
Block a user