MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / writeMagicMessage

Function writeMagicMessage

internal/agent/hitl_magic_api.go:641–661  ·  view source on GitHub ↗

writeMagicMessage renders the post-action / error page. Cream surface, inline brand mark up top, big editorial-italic title, ember CTA back to the dashboard.

(w http.ResponseWriter, status int, title, body string)

Source from the content-addressed store, hash-verified

639// inline brand mark up top, big editorial-italic title, ember CTA back
640// to the dashboard.
641func writeMagicMessage(w http.ResponseWriter, status int, title, body string) {
642 setMagicHeaders(w, status)
643 writeLoftHead(w, title)
644 fmt.Fprintf(w, `<div class="result">
645<span class="eyebrow">%s</span>
646<h1>%s</h1>
647<p>%s</p>
648<p><a class="btn btn-primary" href="/dashboard">Open the dashboard</a></p>
649</div>
650</div>
651</body>
652</html>
653`,
654 html.EscapeString(bannerEyebrowFor(status)),
655 html.EscapeString(title),
656 // `body` is sometimes a pre-escaped fragment (the validation-error
657 // path runs html.EscapeString itself before calling us). Don't
658 // double-escape.
659 body,
660 )
661}
662
663// bannerEyebrowFor returns a short uppercase status word that sits above
664// the result page's title — "Done" / "Pending" / "Error" depending on

Callers 5

renderConfirmPageMethod · 0.85
magicApproveMethod · 0.85
magicRejectMethod · 0.85

Calls 3

setMagicHeadersFunction · 0.85
writeLoftHeadFunction · 0.85
bannerEyebrowForFunction · 0.85

Tested by

no test coverage detected