diff --git a/html/crash.html b/html/crash.html index 78370da..c34c181 100644 --- a/html/crash.html +++ b/html/crash.html @@ -21,6 +21,7 @@ Full Log + Copy Normal diff --git a/main.go b/main.go index 9ffbdb7..5162d43 100644 --- a/main.go +++ b/main.go @@ -390,10 +390,10 @@ func start(asDaemon, firstCall bool) { server := app.config.Section("jellyfin").Key("server").String() cacheTimeout := int(app.config.Section("jellyfin").Key("cache_timeout").MustUint(30)) stringServerType := app.config.Section("jellyfin").Key("type").String() - timeoutHandler := mediabrowser.NewNamedTimeoutHandler("Jellyfin", server, true) + timeoutHandler := mediabrowser.NewNamedTimeoutHandler("Jellyfin", "\""+server+"\"", true) if stringServerType == "emby" { serverType = mediabrowser.EmbyServer - timeoutHandler = mediabrowser.NewNamedTimeoutHandler("Emby", server, true) + timeoutHandler = mediabrowser.NewNamedTimeoutHandler("Emby", "\""+server+"\"", true) app.info.Println("Using Emby server type") fmt.Println(warning("WARNING: Emby compatibility is experimental, and support is limited.\nPassword resets are not available.")) } else { diff --git a/ts/crash.ts b/ts/crash.ts index b1a4b47..67abcd6 100644 --- a/ts/crash.ts +++ b/ts/crash.ts @@ -1,3 +1,5 @@ +import { toClipboard } from "./modules/common.js"; + const buttonNormal = document.getElementById("button-log-normal") as HTMLInputElement; const buttonSanitized = document.getElementById("button-log-sanitized") as HTMLInputElement; @@ -24,3 +26,14 @@ const buttonChange = (type: string) => { } buttonNormal.onclick = () => buttonChange("normal"); buttonSanitized.onclick = () => buttonChange("sanitized"); + +const copyButton = document.getElementById("copy-log") as HTMLSpanElement; +copyButton.onclick = () => { + if (logSanitized.classList.contains("unfocused")) { + toClipboard("```\n" + logNormal.textContent + "```"); + } else { + toClipboard("```\n" + logSanitized.textContent + "```"); + } + copyButton.textContent = "Copied."; + setTimeout(() => { copyButton.textContent = "Copy"; }, 1500); +};