From ff84730a324fb31ba388d9e37e8f00f344b8dec3 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 2 Nov 2025 18:20:50 -0800 Subject: Improve the upload success screen --- roseh.moe.go | 10 +++++++++- static/tohru.webp | Bin 0 -> 55554 bytes templates/wormhole-success.html.template | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 static/tohru.webp create mode 100644 templates/wormhole-success.html.template diff --git a/roseh.moe.go b/roseh.moe.go index 19d6109..abafa2e 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -252,6 +252,12 @@ func (c wormholeConn) wormholeCopy(ctx context.Context, hole string) error { return nil } +var ( + //go:embed templates/wormhole-success.html.template + wormholeSuccessTemplateString string + wormholeSuccessTemplate = template.Must(template.Must(outlineTemplate.Clone()).New("body").Parse(wormholeSuccessTemplateString)).Lookup("outline") +) + func wormholeSend(w http.ResponseWriter, r *http.Request) { ctx := r.Context() reader, err := r.MultipartReader() @@ -271,7 +277,9 @@ func wormholeSend(w http.ResponseWriter, r *http.Request) { if err := (wormholeConn{done: make(chan struct{}), r: part}).wormholeCopy(ctx, hole); err != nil { http.Error(w, fmt.Sprintf("Error during copy: %s", err), http.StatusServiceUnavailable) } - fmt.Fprintf(w, "uploaded!") + if err := wormholeSuccessTemplate.Execute(w, nil); err != nil { + log.Printf("Warning: wormholeSend: %s", err) + } return } http.Error(w, "file not found", http.StatusBadRequest) diff --git a/static/tohru.webp b/static/tohru.webp new file mode 100644 index 0000000..ce0c686 Binary files /dev/null and b/static/tohru.webp differ diff --git a/templates/wormhole-success.html.template b/templates/wormhole-success.html.template new file mode 100644 index 0000000..8df614e --- /dev/null +++ b/templates/wormhole-success.html.template @@ -0,0 +1,8 @@ +{{define "head"}}Uploaded!{{end}} + +
+
+

Uploaded!

+ An energetic dragon maid +
+
-- cgit v1.3.1