mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-04-19 10:21:18 +00:00
jouble integrated.
This commit is contained in:
parent
c0c3940530
commit
928e801e69
27
handler.go
27
handler.go
@ -65,3 +65,30 @@ func reportsViewerHandler(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
htmlgo.Fprint(w, content, r.Context())
|
||||
}
|
||||
|
||||
func joubleHandler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, `
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>pyramid</title>
|
||||
<script>
|
||||
window.relayGroups = [{
|
||||
groupName: 'pyramid',
|
||||
relayUrls: [location.href.replace('http', 'ws').replace('/browse', '')],
|
||||
isActive: true,
|
||||
}]
|
||||
window.hideRelaySettings = true
|
||||
</script>
|
||||
<script type="module" crossorigin src="https://unpkg.com/jouble/dist/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="https://unpkg.com/jouble/dist/index.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="https://unpkg.com/window.nostr.js/dist/window.nostr.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
}
|
||||
|
1
main.go
1
main.go
@ -105,6 +105,7 @@ func main() {
|
||||
relay.Router().HandleFunc("/add-to-whitelist", addToWhitelistHandler)
|
||||
relay.Router().HandleFunc("/remove-from-whitelist", removeFromWhitelistHandler)
|
||||
relay.Router().HandleFunc("/reports", reportsViewerHandler)
|
||||
relay.Router().HandleFunc("/browse", joubleHandler)
|
||||
relay.Router().HandleFunc("/", inviteTreeHandler)
|
||||
|
||||
log.Info().Msg("running on http://0.0.0.0:" + s.Port)
|
||||
|
1
pages.go
1
pages.go
@ -28,6 +28,7 @@ func baseHTML(inside HTMLComponent) HTMLComponent {
|
||||
).Class("mx-auto my-6 text-center"),
|
||||
Nav(
|
||||
A().Text("invite tree").Href("/").Class(navItemClass).Attr("hx-boost", "true", "hx-target", "main", "hx-select", "main"),
|
||||
A().Text("browse").Href("/browse").Class(navItemClass),
|
||||
A().Text("reports").Href("/reports").Class(navItemClass).Attr("hx-boost", "true", "hx-target", "main", "hx-select", "main"),
|
||||
A().Text("").Href("#").Class(navItemClass).
|
||||
Attr("_", `
|
||||
|
Loading…
x
Reference in New Issue
Block a user