From c79c61199f28e5448c78bbeef1b2f999d92558af Mon Sep 17 00:00:00 2001 From: Dima Krasner Date: Thu, 16 May 2024 19:01:54 +0300 Subject: [PATCH] rename 'statistics' to 'status' --- README.md | 2 +- front/README.md | 4 ++-- front/handler.go | 4 ++-- front/menu.go | 2 +- front/static/help.gmi | 2 +- front/static/users/help.gmi | 2 +- front/{stats.go => status.go} | 4 ++-- test/{stats_test.go => status_test.go} | 12 ++++++------ 8 files changed, 16 insertions(+), 16 deletions(-) rename front/{stats.go => status.go} (98%) rename test/{stats_test.go => status_test.go} (76%) diff --git a/README.md b/README.md index 0c9e4afa..0a594a46 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Welcome, fedinaut! localhost.localdomain:8443 is an instance of tootik, a federa 🔎 Search posts 📣 New post ⚙️ Settings -📊 Statistics +📊 Status 🛟 Help ``` diff --git a/front/README.md b/front/README.md index f1ef4c8d..28a1f739 100644 --- a/front/README.md +++ b/front/README.md @@ -8,7 +8,7 @@ * /search shows an input prompt and redirects to /hashtag. * /hashtags shows a list of popular hashtags. * /fts shows an input prompt and performs full-text search in posts. -* /stats shows statistics and server health metrics. +* /status shows statistics and server health metrics. * /view shows a complete post with extra details like links in the post, a list mentioned users, a list of hashtags, a link to the author's outbox, a list of replies and a link to the parent post (if found). * /thread displays a tree of replies in a thread. @@ -44,7 +44,7 @@ Some clients generate a certificate for / (all pages of this capsule) when /foo * /users/hashtag * /users/hashtags * /users/fts -* /users/stats +* /users/status * /users/view * /users/thread diff --git a/front/handler.go b/front/handler.go index d2d5a7aa..965e7825 100644 --- a/front/handler.go +++ b/front/handler.go @@ -133,8 +133,8 @@ func NewHandler(domain string, closed bool, cfg *cfg.Config) (Handler, error) { h.handlers[regexp.MustCompile(`^/fts$`)] = withUserMenu(h.fts) h.handlers[regexp.MustCompile(`^/users/fts$`)] = withUserMenu(h.fts) - h.handlers[regexp.MustCompile(`^/stats$`)] = withCache(withUserMenu(h.stats), time.Minute*5, &cache, cfg) - h.handlers[regexp.MustCompile(`^/users/stats$`)] = withCache(withUserMenu(h.stats), time.Minute*5, &cache, cfg) + h.handlers[regexp.MustCompile(`^/status$`)] = withCache(withUserMenu(h.status), time.Minute*5, &cache, cfg) + h.handlers[regexp.MustCompile(`^/users/status$`)] = withCache(withUserMenu(h.status), time.Minute*5, &cache, cfg) h.handlers[regexp.MustCompile(`^/oops`)] = withUserMenu(oops) h.handlers[regexp.MustCompile(`^/users/oops`)] = withUserMenu(oops) diff --git a/front/menu.go b/front/menu.go index 56566f86..ca2b4c08 100644 --- a/front/menu.go +++ b/front/menu.go @@ -57,7 +57,7 @@ func writeUserMenu(w text.Writer, user *ap.Actor) { w.Link("/users/settings", "⚙️ Settings") } - w.Link(prefix+"/stats", "📊 Statistics") + w.Link(prefix+"/status", "📊 Status") w.Link(prefix+"/help", "🛟 Help") } diff --git a/front/static/help.gmi b/front/static/help.gmi index d2719fcd..56e1fedc 100644 --- a/front/static/help.gmi +++ b/front/static/help.gmi @@ -23,7 +23,7 @@ This page shows popular hashtags, allowing you to discover trends and shared int This is a full-text search tool that lists posts containing keyword(s), ordered by relevance. -> 📊 Statistics +> 📊 Status This page shows various statistics about this server and the parts of the fediverse it's connected to. diff --git a/front/static/users/help.gmi b/front/static/users/help.gmi index 16fb2638..5cd4b359 100644 --- a/front/static/users/help.gmi +++ b/front/static/users/help.gmi @@ -61,7 +61,7 @@ This page allows you to: * Notify followers about account migration from this instance * Upload a .png, .jpg or .gif image to serve as your avatar (use your client certificate for authentication): up to {{.Config.MaxAvatarWidth}}x{{.Config.MaxAvatarHeight}} and {{.Config.MaxAvatarSize}} bytes, downscaled to {{.Config.AvatarWidth}}x{{.Config.AvatarHeight}} -> 📊 Statistics +> 📊 Status This page shows various statistics about this server and the parts of the fediverse it's connected to. diff --git a/front/stats.go b/front/status.go similarity index 98% rename from front/stats.go rename to front/status.go index bfe1618c..590fab75 100644 --- a/front/stats.go +++ b/front/status.go @@ -86,7 +86,7 @@ func getActiveUsersGraph(r *request) string { return getGraph(r, `select strftime('%Y-%m-%d', datetime(day, 'unixepoch')), count(distinct author) from (select notes.inserted/(60*60*24)*60*60*24 as day, persons.id as author from notes join persons on persons.id = notes.author where notes.inserted>unixepoch()-60*60*24*7 and notes.inserted