diff --git a/data.json b/data.json index 204a3b0..123a4f6 100644 --- a/data.json +++ b/data.json @@ -1,7 +1,5 @@ { "job": "none", - "emails": [ - "zipfriis@gmail.com" - ], + "emails": [], "newletter-sent": 0 } \ No newline at end of file diff --git a/main.go b/main.go index 422a0a0..8255e0a 100644 --- a/main.go +++ b/main.go @@ -19,8 +19,9 @@ import ( ) type Config struct { - Job string `json:"job"` - Emails []string `json:"emails"` + Job string `json:"job"` + Emails []string `json:"emails"` + NewsSent int `json:"newletter-sent"` } func loadConfig() (*Config, error) { @@ -187,6 +188,15 @@ func main() { fmt.Fprintf(w, "%s", strconv.Itoa(len(conf.Emails))) })) + apiMux.HandleFunc("GET /stats/sent", requireAuth(func(w http.ResponseWriter, r *http.Request) { + conf, err := loadConfig() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + + } + fmt.Fprintf(w, "%s", strconv.Itoa(conf.NewsSent)) + })) + // strip /admin/api before handing off adminMux.Handle("/api/", http.StripPrefix("/api", apiMux)) diff --git a/site b/site index cf1d45c..c81fea9 100755 Binary files a/site and b/site differ diff --git a/static/components/eq.html b/static/components/eq.html new file mode 100644 index 0000000..65d140d --- /dev/null +++ b/static/components/eq.html @@ -0,0 +1,160 @@ + + + +
Equity · Portfolio Performance
+// data through Jun 2026 · monthly returns & cumulative
+