Permalink
Browse files

Added a few site stats in the admin section.

  • Loading branch information...
1 parent 12b5f58 commit 2b1fea01ff015542e6d38476fe3f39de0d6148b8 @antirez committed Oct 10, 2012
Showing with 20 additions and 0 deletions.
  1. +14 −0 app.rb
  2. +6 −0 public/css/style.css
View
14 app.rb
@@ -504,6 +504,8 @@ def render_comment_subthread(comment,sep="")
H.page {
H.div(:id => "adminlinks") {
H.h2 {"Admin"}+
+ H.h3 {"Site stats"}+
+ generate_site_stats+
H.h3 {"Developer tools"}+
H.ul {
H.li {
@@ -1781,6 +1783,18 @@ def get_user_comments(user_id,start,count)
end
###############################################################################
+# Admin section & stats
+###############################################################################
+
+def generate_site_stats
+ H.ul {
+ H.li {"#{$r.get("users.count")} users"} +
+ H.li {"#{$r.zcard("news.cron")} news posted"} +
+ H.li {"#{$r.info['used_memory_human']} of used memory"}
+ }
+end
+
+###############################################################################
# Utility functions
###############################################################################
View
@@ -300,3 +300,9 @@ topcomment {
list-style-type: disc;
margin-left:20px;
}
+
+#adminlinks h3 {
+ margin-top:20px;
+ margin-bottom:5px;
+ font-weight: bold;
+}

0 comments on commit 2b1fea0

Please sign in to comment.