diff --git a/libraries/controller.php b/libraries/controller.php index ba0435c..605f434 100644 --- a/libraries/controller.php +++ b/libraries/controller.php @@ -27,9 +27,17 @@ public function __construct($config) if (!in_array($config['dbId'], $dbs)) { $config['dbId'] = $dbs[0]; } - $current['database'] = $config['dbId']; - $current['dbs'] = $dbs; + + // Extract number of keys + foreach ($dbs as $i) { + if (preg_match('/^keys=([0-9]+),expires=([0-9]+)$/', $info["db{$i}"], $matches)) { + $current['dbs'][] = array( + 'id' => $i, + 'keys' => $matches[1], + ); + } + } $this->db->select($current['database']); diff --git a/public/css/custom.css b/public/css/custom.css index ba69e5c..57b0032 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -13,3 +13,6 @@ textarea { padding-right: 6px; font-size: 90%; } +.nav-pills>li.database .label { + margin-top: -2px; +} diff --git a/views/navigation.php b/views/navigation.php index f505b3b..10760db 100644 --- a/views/navigation.php +++ b/views/navigation.php @@ -7,7 +7,7 @@ app->current['dbs'] as $database): ?> app->current['database']) { + if ($database['id'] == $this->app->current['database']) { $dbClass = 'active'; $dbIcon = 'icon-ok-sign'; } @@ -17,8 +17,8 @@ } ?>
  • - - DB + + DB