diff --git a/dashboard/main.go b/dashboard/main.go index 2d416749..e5e402e2 100644 --- a/dashboard/main.go +++ b/dashboard/main.go @@ -24,10 +24,13 @@ type entity struct { var baseURL = "https://api.pluralkit.me/v2" var version = "dev" +var versionJS string const defaultEmbed = ` ` func main() { + versionJS = "" + r := chi.NewRouter() r.Use(func(next http.Handler) http.Handler { @@ -68,7 +71,7 @@ func notFoundHandler(rw http.ResponseWriter, r *http.Request) { } else { data, err = fs.ReadFile("dist/index.html") rw.Header().Add("content-type", "text/html") - data = []byte(strings.Replace(string(data), ``, defaultEmbed, 1)) + data = []byte(strings.Replace(string(data), ``, defaultEmbed+versionJS, 1)) } if err != nil { @@ -134,7 +137,7 @@ func createEmbed(rw http.ResponseWriter, r *http.Request) { if err != nil { panic(nil) } - html = []byte(strings.Replace(string(html), ``, text, 1)) + html = []byte(strings.Replace(string(html), ``, text+versionJS, 1)) rw.Header().Add("content-type", "text/html") rw.Write(html) diff --git a/dashboard/src/main.ts b/dashboard/src/main.ts index e2e5253c..50de4ff5 100644 --- a/dashboard/src/main.ts +++ b/dashboard/src/main.ts @@ -7,7 +7,8 @@ Sentry.init({ enabled: !window.location.origin.includes("localhost"), debug: false, - release: "dev", + // @ts-expect-error + release: window.pluralkitVersion, // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production