No terminal window on windows

This commit is contained in:
2026-02-13 20:59:47 +01:00
parent a9e626393c
commit 8e369ebd5a
5 changed files with 201 additions and 4 deletions

View File

@@ -179,6 +179,32 @@ var settingsTemplate = template.Must(template.New("settings").Parse(`<!doctype h
</html>
`))
var logsTemplate = template.Must(template.New("logs").Parse(`<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>luxtools-client Logs</title>
<style>
body { font-family: system-ui, sans-serif; margin: 1.25rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
pre { background: #f7f7f7; padding: 0.75rem; border: 1px solid #ddd; overflow: auto; max-height: 70vh; }
.small { color: #666; font-size: 0.9rem; }
button { padding: 0.35rem 0.7rem; }
</style>
</head>
<body>
<h1>Logs</h1>
<p class="small">Log file: <code>{{ .LogPath }}</code></p>
<p class="small">Updated: <code>{{ .Updated }}</code></p>
<p>
<a href="/logs">View raw text</a>
<button type="button" onclick="location.reload()">Refresh</button>
</p>
<pre>{{ .LogText }}</pre>
</body>
</html>
`))
// RenderIndex renders the main index page.
func RenderIndex(w io.Writer, data any) error {
return indexTemplate.Execute(w, data)
@@ -188,3 +214,8 @@ func RenderIndex(w io.Writer, data any) error {
func RenderSettings(w io.Writer) error {
return settingsTemplate.Execute(w, nil)
}
// RenderLogs renders the logs control page.
func RenderLogs(w io.Writer, data any) error {
return logsTemplate.Execute(w, data)
}