summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-11-02 18:20:50 -0800
committerRose Hogenson <rosehogenson@posteo.net>2025-11-02 18:22:55 -0800
commitff84730a324fb31ba388d9e37e8f00f344b8dec3 (patch)
tree3d6a1fc2d0da536c4fd1f60617c240bf302712d3
parent171119fa753ea82eb36e79559cb333b732d4cc60 (diff)
downloadroseh.moe-ff84730a324fb31ba388d9e37e8f00f344b8dec3.tar.zst
Improve the upload success screen
-rw-r--r--roseh.moe.go10
-rw-r--r--static/tohru.webpbin0 -> 55554 bytes
-rw-r--r--templates/wormhole-success.html.template8
3 files changed, 17 insertions, 1 deletions
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
--- /dev/null
+++ b/static/tohru.webp
Binary files 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"}}<title>Uploaded!</title>{{end}}
+
+<div style="display:flex;justify-content:center">
+ <div>
+ <p style="display:flex;justify-content:center">Uploaded!</p>
+ <img src="/static/tohru.webp" alt="An energetic dragon maid">
+ </div>
+</div>