From dfdbc3bea218705f4a28d2a3c577e683d118ea85 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 17 May 2013 14:22:34 -0400 Subject: [PATCH] admin/redis page --- public/css/style.less | 7 +++++++ public/src/templates.js | 2 +- public/templates/admin/header.tpl | 2 ++ public/templates/admin/redis.tpl | 23 +++++++++++++++++++++++ src/routes/admin.js | 31 +++++++++++++++++++++++++++++-- src/user.js | 2 +- 6 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 public/templates/admin/redis.tpl diff --git a/public/css/style.less b/public/css/style.less index cef80c0496..0974c0c47a 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -699,4 +699,11 @@ body .navbar .nodebb-inline-block { #right-menu{ float:right; +} + +#admin-redis-info { + span { + display:inline-block; + width:200px; + } } \ No newline at end of file diff --git a/public/src/templates.js b/public/src/templates.js index f35f62140e..28015a169e 100644 --- a/public/src/templates.js +++ b/public/src/templates.js @@ -70,7 +70,7 @@ var templates = {}; 'login', 'reset', 'reset_code', 'account', 'confirm', '403', 'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext', - 'admin/index', 'admin/categories', 'admin/users', 'admin/topics', 'admin/settings', 'admin/themes', 'admin/twitter', 'admin/facebook', 'admin/gplus' + 'admin/index', 'admin/categories', 'admin/users', 'admin/topics', 'admin/settings', 'admin/themes', 'admin/twitter', 'admin/facebook', 'admin/gplus', 'admin/redis' ]); } diff --git a/public/templates/admin/header.tpl b/public/templates/admin/header.tpl index edcf59f843..a987384bb4 100644 --- a/public/templates/admin/header.tpl +++ b/public/templates/admin/header.tpl @@ -94,6 +94,8 @@
  • Topics
  • Themes
  • Settings
  • +
  • Redis
  • +
  • Twitter
  • Facebook
  • diff --git a/public/templates/admin/redis.tpl b/public/templates/admin/redis.tpl new file mode 100644 index 0000000000..e52f021e02 --- /dev/null +++ b/public/templates/admin/redis.tpl @@ -0,0 +1,23 @@ +

    Redis

    +
    +
    + Redis Version {redis_version}
    +
    + Uptime in Seconds {uptime_in_seconds}
    + Uptime in Days {uptime_in_days}
    +
    + Connected Clients {connected_clients}
    + Connected Slaves {connected_slaves}
    + Blocked Clients {blocked_clients}
    +
    + + Used Memory {used_memory_human}
    + Memory Fragmentation Ratio {mem_fragmentation_ratio}
    +
    + Total Connections Received {total_connections_received}
    + Total Commands Processed {total_commands_processed}
    +
    + Keyspace Hits {keyspace_hits}
    + Keyspace Misses {keyspace_misses}
    +
    + diff --git a/src/routes/admin.js b/src/routes/admin.js index aeabfc6d48..7528e76452 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -1,16 +1,18 @@ var user = require('./../user.js'), - topics = require('./../topics.js'); + topics = require('./../topics.js'), + RDB = require('./../redis.js'); (function(Admin) { Admin.create_routes = function(app) { (function() { - var routes = ['categories', 'users', 'topics', 'settings', 'themes', 'twitter', 'facebook', 'gplus']; + var routes = ['categories', 'users', 'topics', 'settings', 'themes', 'twitter', 'facebook', 'gplus', 'redis']; for (var i=0, ii=routes.length; i