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

+
+
+9.58% YTD
+ 2026 +
+
+ +
+ + cumulative + + + monthly + +
+ +
+ + Monthly: Jan +8.13%, Feb −8.84%, Mar +0.41%, Apr +6.59%, May +3.20%, Now +0.64%. Cumulative: Jan +8.13%, Feb −1.43%, Mar −1.02%, Apr +5.51%, May +8.89%, Now +9.58%. + +
+ +
+
+
best month
+
+8.13%
+
+
+
worst month
+
−8.84%
+
+
+
cumulative YTD
+
+9.58%
+
+
+ +

// data through Jun 2026 · monthly returns & cumulative

+
+ + diff --git a/static/index.html b/static/index.html index fd12ed5..fc52cab 100644 --- a/static/index.html +++ b/static/index.html @@ -249,6 +249,17 @@ Read file
+ +
+

Equity portfolio performance

+
+
+
+ Loading chart... +
+
+ +