1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2025-01-06 08:20:11 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
9950c158a1
move copy button to right, don't uncss when DEBUG=on
keep unused css when DEBUG=on by skipping the uncss step.
2021-06-13 16:31:40 +01:00
21125033ff
Add copy button to crash page 2021-06-13 15:36:36 +01:00
4 changed files with 22 additions and 4 deletions

View File

@ -45,11 +45,13 @@ ifeq ($(DEBUG), on)
TYPECHECK := tsc -noEmit --project ts/tsconfig.json
# jank
COPYTS := rm -r $(DATA)/web/js/ts; cp -r ts $(DATA)/web/js
UNCSS := cp $(DATA)/web/css/bundle.css $(DATA)/bundle.css
else
LDFLAGS := -s -w $(LDFLAGS)
SOURCEMAP :=
COPYTS :=
TYPECHECK :=
UNCSS := npx uncss $(DATA)/crash.html --csspath web/css --output $(DATA)/bundle.css
endif
RACE ?= off
@ -111,7 +113,7 @@ bundle-css:
inline:
cp html/crash.html $(DATA)/crash.html
npx uncss $(DATA)/crash.html --csspath web/css --output $(DATA)/bundle.css
$(UNCSS)
npx inline-source --root $(DATA) $(DATA)/crash.html $(DATA)/crash.html
rm $(DATA)/bundle.css

View File

@ -20,7 +20,10 @@
<a class="button ~critical mb-1" target="_blank" href="https://github.com/hrfee/jfa-go/issues/new/choose">Create an Issue</a>
</section>
<section class="section ~neutral !low">
<span class="subheading">Full Log</span>
<div class="flex-expand">
<span class="subheading">Full Log</span>
<span class="button ~urge ml-half" id="copy-log">Copy</span>
</div>
<div class="row mb-1">
<label class="col mr-1">
<span class="button ~neutral !high supra full-width center" id="button-log-normal">Normal</span>

View File

@ -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 {

View File

@ -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);
};