Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/erikdubbelboer/phpRedisAdmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Dubbelboer <erik@dubbelboer.com>2015-03-22 20:25:53 +0300
committerErik Dubbelboer <erik@dubbelboer.com>2015-03-22 20:35:34 +0300
commitf419e7fb95652b0c429e01d50c32586733face1b (patch)
tree2b8ea983dc6d90e06fc4c2dd7d255020b707cf22
parent5c91646ca2729385de984962f52de70788a452cb (diff)
Fix #35 and possibly #52v1.2.0
-rw-r--r--composer.json4
-rw-r--r--composer.lock44
-rw-r--r--delete.php4
-rw-r--r--edit.php2
-rw-r--r--import.php2
-rw-r--r--includes/common.inc.php21
-rw-r--r--includes/config.sample.inc.php13
-rw-r--r--index.php54
-rw-r--r--info.php2
-rw-r--r--js/index.js13
-rw-r--r--rename.php2
-rw-r--r--view.php34
12 files changed, 125 insertions, 70 deletions
diff --git a/composer.json b/composer.json
index dd19d92..d51d3cc 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "erik-dubbelboer/php-redis-admin",
"description": "Simple web interface to manage Redis databases.",
- "version": "1.1.2",
+ "version": "1.2.0",
"license": "CC-BY-ND",
"homepage": "https://github.com/ErikDubbelboer/phpRedisAdmin",
"authors": [
@@ -13,7 +13,7 @@
}
],
"require": {
- "predis/predis": "0.8.*"
+ "predis/predis": "1.0.1"
},
"minimum-stability": "stable",
"target-dir": "ErikDubbelboer/phpRedisAdmin"
diff --git a/composer.lock b/composer.lock
index 55ba3ee..99da8b2 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,35 +1,39 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
],
- "hash": "81de6835a02ee54ae5d87ce2b395ba6e",
+ "hash": "e0695856c109266b2eabff6d53d879c0",
"packages": [
{
"name": "predis/predis",
- "version": "v0.8.3",
+ "version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/nrk/predis.git",
- "reference": "v0.8.3"
+ "reference": "7a170b3d8123c556597b4fbdb88631f99de180c2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nrk/predis/zipball/v0.8.3",
- "reference": "v0.8.3",
+ "url": "https://api.github.com/repos/nrk/predis/zipball/7a170b3d8123c556597b4fbdb88631f99de180c2",
+ "reference": "7a170b3d8123c556597b4fbdb88631f99de180c2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
"suggest": {
"ext-curl": "Allows access to Webdis when paired with phpiredis",
"ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol"
},
"type": "library",
"autoload": {
- "psr-0": {
- "Predis": "lib/"
+ "psr-4": {
+ "Predis\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -50,23 +54,15 @@
"predis",
"redis"
],
- "time": "2013-02-18 14:03:45"
+ "time": "2015-01-02 12:51:34"
}
],
- "packages-dev": [
-
- ],
- "aliases": [
-
- ],
+ "packages-dev": [],
+ "aliases": [],
"minimum-stability": "stable",
- "stability-flags": [
-
- ],
- "platform": [
-
- ],
- "platform-dev": [
-
- ]
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
}
diff --git a/delete.php b/delete.php
index 8e4fdeb..df51bee 100644
--- a/delete.php
+++ b/delete.php
@@ -46,7 +46,7 @@ if (isset($_GET['key'])) {
}
- die('?view&s='.$server['id'].'&key='.urlencode($_GET['key']));
+ die('?view&s='.$server['id'].'&d='.$server['db'].'&key='.urlencode($_GET['key']));
}
@@ -57,7 +57,7 @@ if (isset($_GET['tree'])) {
$redis->del($key);
}
- die('?view&s='.$server['id']);
+ die('?view&s='.$server['id'].'&d='.$server['db']);
}
?>
diff --git a/edit.php b/edit.php
index fade77c..09ad55e 100644
--- a/edit.php
+++ b/edit.php
@@ -86,7 +86,7 @@ if (isset($_POST['type'], $_POST['key'], $_POST['value'])) {
?>
<script>
- top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_POST['key'])?>';
+ top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_POST['key'])?>';
</script>
<?php
diff --git a/import.php b/import.php
index 5d74391..9dbca76 100644
--- a/import.php
+++ b/import.php
@@ -73,7 +73,7 @@ if (isset($_POST['commands'])) {
?>
<script>
- top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']?>';
+ top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>';
</script>
<?php
diff --git a/includes/common.inc.php b/includes/common.inc.php
index d5f2305..0d45753 100644
--- a/includes/common.inc.php
+++ b/includes/common.inc.php
@@ -40,8 +40,6 @@ if (isset($config['login'])) {
}
-
-
if (isset($login['servers'])) {
$i = current($login['servers']);
} else {
@@ -53,8 +51,8 @@ if (isset($_GET['s']) && is_numeric($_GET['s']) && ($_GET['s'] < count($config['
$i = $_GET['s'];
}
-$server = $config['servers'][$i];
-$server['id'] = $i;
+$server = $config['servers'][$i];
+$server['id'] = $i;
$server['charset'] = isset($server['charset']) && $server['charset'] ? $server['charset'] : false;
@@ -75,9 +73,14 @@ if (isset($login, $login['servers'])) {
if (!isset($server['db'])) {
- $server['db'] = 0;
+ if (isset($_GET['d']) && is_numeric($_GET['d'])) {
+ $server['db'] = $_GET['d'];
+ } else {
+ $server['db'] = 0;
+ }
}
+
if (!isset($server['filter'])) {
$server['filter'] = '*';
}
@@ -94,6 +97,14 @@ if (!isset($server['seperator'])) {
$server['seperator'] = $config['seperator'];
}
+if (!isset($server['keys'])) {
+ $server['keys'] = $config['keys'];
+}
+
+if (!isset($server['scansize'])) {
+ $server['scansize'] = $config['scansize'];
+}
+
// Setup a connection to Redis.
$redis = !$server['port'] ? new Predis\Client($server['host']) : new Predis\Client('tcp://'.$server['host'].':'.$server['port']);
try {
diff --git a/includes/config.sample.inc.php b/includes/config.sample.inc.php
index b132bed..9455e67 100644
--- a/includes/config.sample.inc.php
+++ b/includes/config.sample.inc.php
@@ -24,9 +24,11 @@ $config = array(
'port' => 6379,
'db' => 1, // Optional database number, see http://redis.io/commands/select
'filter' => 'something:*', // Show only parts of database for speed or security reasons.
- 'seperator' => '/', // Use a different seperator on this database.
+ 'seperator' => '/', // Use a different seperator on this database (default uses config default).
'flush' => false, // Set to true to enable the flushdb button for this instance.
'charset' => 'cp1251', // Keys and values are stored in redis using this encoding (default utf-8).
+ 'keys' => false, // Use the old KEYS command instead of SCAN to fetch all keys for this server (default uses config default).
+ 'scansize' => 1000 // How many entries to fetch using each SCAN command for this server (default uses config default).
),*/
),
@@ -55,7 +57,14 @@ $config = array(
// You can ignore settings below this point.
'maxkeylen' => 100,
- 'count_elements_page' => 100
+ 'count_elements_page' => 100,
+
+
+ // Use the old KEYS command instead of SCAN to fetch all keys.
+ 'keys' => false,
+
+ // How many entries to fetch using each SCAN command.
+ 'scansize' => 1000
);
?>
diff --git a/index.php b/index.php
index b768ecb..851c9f4 100644
--- a/index.php
+++ b/index.php
@@ -4,7 +4,23 @@ require_once 'includes/common.inc.php';
if($redis) {
- $keys = $redis->keys($server['filter']);
+ if (!empty($server['keys'])) {
+ $keys = $redis->keys($server['filter']);
+ } else {
+ $next = 0;
+ $keys = array();
+
+ while (true) {
+ $r = $redis->scan($next, 'MATCH', $server['filter'], 'COUNT', $server['scansize']);
+
+ $next = $r[0];
+ $keys = array_merge($keys, $r[1]);
+
+ if ($next == 0) {
+ break;
+ }
+ }
+ }
sort($keys);
@@ -83,7 +99,7 @@ if($redis) {
?>
<li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>>
- <a href="?view&amp;s=<?php echo $server['id']?>&amp;key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a>
+ <a href="?view&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a>
</li>
<?php
}
@@ -93,7 +109,7 @@ if($redis) {
?>
<li class="folder<?php echo ($fullkey === '') ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>">
<div class="icon"><?php echo format_html($name)?>&nbsp;<span class="info">(<?php echo count($item)?>)</span>
- <?php if ($fullkey !== '') { ?><a href="delete.php?s=<?php echo $server['id']?>&amp;tree=<?php echo urlencode($fullkey)?>:" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?>
+ <?php if ($fullkey !== '') { ?><a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;tree=<?php echo urlencode($fullkey)?>:" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?>
</div><ul>
<?php
@@ -144,7 +160,7 @@ require 'includes/header.inc.php';
?>
<div id="sidebar">
-<h1 class="logo"><a href="?overview&amp;s=<?php echo $server['id']?>">phpRedisAdmin</a></h1>
+<h1 class="logo"><a href="?overview&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>">phpRedisAdmin</a></h1>
<p>
<select id="server">
@@ -152,24 +168,35 @@ require 'includes/header.inc.php';
<option value="<?php echo $i?>" <?php echo ($server['id'] == $i) ? 'selected="selected"' : ''?>><?php echo isset($srv['name']) ? format_html($srv['name']) : $srv['host'].':'.$srv['port']?></option>
<?php } ?>
</select>
-</p>
-<?php if($redis): ?>
+<?php if($redis) { ?>
+
+<?php
+$databases = $redis->config('GET', 'databases');
+$databases = $databases['databases'];
+if ($databases > 1) { ?>
+ <select id="database">
+ <?php for ($d = 0; $d < $databases; ++$d) { ?>
+ <option value="<?php echo $d?>" <?php echo ($server['db'] == $d) ? 'selected="selected"' : ''?>>database <?php echo $d?></option>
+ <?php } ?>
+ </select>
+<?php } ?>
+</p>
<p>
<?php if (isset($login)) { ?>
<a href="logout.php"><img src="images/logout.png" width="16" height="16" title="Logout" alt="[L]"></a>
<?php } ?>
-<a href="?info&amp;s=<?php echo $server['id']?>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a>
-<a href="?export&amp;s=<?php echo $server['id']?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
-<a href="?import&amp;s=<?php echo $server['id']?>"><img src="images/import.png" width="16" height="16" title="Import" alt="[I]"></a>
+<a href="?info&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a>
+<a href="?export&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
+<a href="?import&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>"><img src="images/import.png" width="16" height="16" title="Import" alt="[I]"></a>
<?php if (isset($server['flush']) && $server['flush']) { ?>
-<a href="?flush&amp;s=<?php echo $server['id']?>" id="flush"><img src="images/flush.png" width="16" height="16" title="Flush" alt="[F]"></a>
+<a href="?flush&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>" id="flush"><img src="images/flush.png" width="16" height="16" title="Flush" alt="[F]"></a>
<?php } ?>
</p>
<p>
-<a href="?edit&amp;s=<?php echo $server['id']?>" class="add">Add another key</a>
+<a href="?edit&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>" class="add">Add another key</a>
</p>
<p>
@@ -187,9 +214,10 @@ require 'includes/header.inc.php';
</ul>
</div><!-- #keys -->
-<?php else: ?>
+<?php } else { ?>
+</p>
<div style="color:red">Can't connect to this server</div>
-<?php endif; ?>
+<?php } ?>
<div id="frame">
<iframe src="<?php echo format_html($iframe)?>" id="iframe" frameborder="0" scrolling="0"></iframe>
diff --git a/info.php b/info.php
index ae37a86..4d1f821 100644
--- a/info.php
+++ b/info.php
@@ -31,7 +31,7 @@ require 'includes/header.inc.php';
<?php if (method_exists($redis, 'resetStat')) { ?>
<p>
-<a href="?reset&amp;s=<?php echo $server['id']?>" class="reset">Reset usage statistics</a>
+<a href="?reset&amp;s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>" class="reset">Reset usage statistics</a>
</p>
<?php } ?>
diff --git a/js/index.js b/js/index.js
index 545add0..1fbb755 100644
--- a/js/index.js
+++ b/js/index.js
@@ -49,6 +49,17 @@ $(function() {
});
+ $('#database').change(function(e) {
+ if (location.href.indexOf('?') == -1) {
+ location.href = location.href+'?d='+e.target.value;
+ } else if (location.href.indexOf('&d=') == -1) {
+ location.href = location.href+'&d='+e.target.value;
+ } else {
+ location.href = location.href.replace(/d=[0-9]*/, 'd='+e.target.value);
+ }
+ });
+
+
$('li.current').parents('li.folder').removeClass('collapsed');
$('li.folder').click(function(e) {
@@ -71,7 +82,7 @@ $(function() {
$('#btn_server_filter').click(function() {
var filter = $('#server_filter').val();
- location.href = top.location.pathname + '?overview&s=' + $('#server').val() + '&filter=' + filter;
+ location.href = top.location.pathname + '?overview&s=' + $('#server').val() + '&d=' + ($('#database').val() || '') + '&filter=' + filter;
});
$('#server_filter').keydown(function(e){
diff --git a/rename.php b/rename.php
index a542576..6c192b1 100644
--- a/rename.php
+++ b/rename.php
@@ -18,7 +18,7 @@ if (isset($_POST['old'], $_POST['key'])) {
?>
<script>
- top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_POST['key'])?>';
+ top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&key=<?php echo urlencode($_POST['key'])?>';
</script>
<?php
diff --git a/view.php b/view.php
index 4c48cb6..533ad9e 100644
--- a/view.php
+++ b/view.php
@@ -32,9 +32,9 @@ $page_num_request = $page_num_request === 0 ? 1 : $page_num_request;
?>
<h2><?php echo format_html($_GET['key'])?>
<?php if ($exists) { ?>
- <a href="rename.php?s=<?php echo $server['id']?>&amp;key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Rename" alt="[R]"></a>
- <a href="delete.php?s=<?php echo $server['id']?>&amp;key=<?php echo urlencode($_GET['key'])?>" class="delkey"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
- <a href="export.php?s=<?php echo $server['id']?>&amp;key=<?php echo urlencode($_GET['key'])?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
+ <a href="rename.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Rename" alt="[R]"></a>
+ <a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($_GET['key'])?>" class="delkey"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
+ <a href="export.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($_GET['key'])?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
<?php } ?>
</h2>
<?php
@@ -95,7 +95,7 @@ if (isset($values) && ($count_elements_page !== false)) {
<tr><td><div>Type:</div></td><td><div><?php echo format_html($type)?></div></td></tr>
-<tr><td><div><abbr title="Time To Live">TTL</abbr>:</div></td><td><div><?php echo ($ttl == -1) ? 'does not expire' : $ttl?> <a href="ttl.php?s=<?php echo $server['id']?>&amp;key=<?php echo urlencode($_GET['key'])?>&amp;ttl=<?php echo $ttl?>"><img src="images/edit.png" width="16" height="16" title="Edit TTL" alt="[E]" class="imgbut"></a></div></td></tr>
+<tr><td><div><abbr title="Time To Live">TTL</abbr>:</div></td><td><div><?php echo ($ttl == -1) ? 'does not expire' : $ttl?> <a href="ttl.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;key=<?php echo urlencode($_GET['key'])?>&amp;ttl=<?php echo $ttl?>"><img src="images/edit.png" width="16" height="16" title="Edit TTL" alt="[E]" class="imgbut"></a></div></td></tr>
<?php if (!is_null($encoding)) { ?>
<tr><td><div>Encoding:</div></td><td><div><?php echo format_html($encoding)?></div></td></tr>
@@ -173,9 +173,9 @@ if ($type == 'string') { ?>
<table>
<tr><td><div><?php echo nl2br(format_html($value))?></div></td><td><div>
- <a href="edit.php?s=<?php echo $server['id']?>&amp;type=string&amp;key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
+ <a href="edit.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=string&amp;key=<?php echo urlencode($_GET['key'])?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
</div></td><td><div>
- <a href="delete.php?s=<?php echo $server['id']?>&amp;type=string&amp;key=<?php echo urlencode($_GET['key'])?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
+ <a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=string&amp;key=<?php echo urlencode($_GET['key'])?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
</div></td></tr>
</table>
@@ -191,9 +191,9 @@ else if ($type == 'hash') { ?>
<?php foreach ($values as $hkey => $value) { ?>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo format_html($hkey)?></div></td><td><div><?php echo nl2br(format_html($value))?></div></td><td><div>
- <a href="edit.php?s=<?php echo $server['id']?>&amp;type=hash&amp;key=<?php echo urlencode($_GET['key'])?>&amp;hkey=<?php echo urlencode($hkey)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
+ <a href="edit.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=hash&amp;key=<?php echo urlencode($_GET['key'])?>&amp;hkey=<?php echo urlencode($hkey)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
</div></td><td><div>
- <a href="delete.php?s=<?php echo $server['id']?>&amp;type=hash&amp;key=<?php echo urlencode($_GET['key'])?>&amp;hkey=<?php echo urlencode($hkey)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
+ <a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=hash&amp;key=<?php echo urlencode($_GET['key'])?>&amp;hkey=<?php echo urlencode($hkey)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
</div></td></tr>
<?php $alt = !$alt; } ?>
@@ -219,9 +219,9 @@ else if ($type == 'list') { ?>
$value = $redis->lIndex($_GET['key'], $i);
?>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $i?></div></td><td><div><?php echo nl2br(format_html($value))?></div></td><td><div>
- <a href="edit.php?s=<?php echo $server['id']?>&amp;type=list&amp;key=<?php echo urlencode($_GET['key'])?>&amp;index=<?php echo $i?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
+ <a href="edit.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=list&amp;key=<?php echo urlencode($_GET['key'])?>&amp;index=<?php echo $i?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
</div></td><td><div>
- <a href="delete.php?s=<?php echo $server['id']?>&amp;type=list&amp;key=<?php echo urlencode($_GET['key'])?>&amp;index=<?php echo $i?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
+ <a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=list&amp;key=<?php echo urlencode($_GET['key'])?>&amp;index=<?php echo $i?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
</div></td></tr>
<?php $alt = !$alt; } ?>
@@ -237,12 +237,12 @@ else if ($type == 'set') {
<tr><th><div>Value</div></th><th><div>&nbsp;</div></th><th><div>&nbsp;</div></th></tr>
<?php foreach ($values as $value) {
- $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value));
+ $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&d='.$server['db'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value));
?>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $display_value ?></div></td><td><div>
- <a href="edit.php?s=<?php echo $server['id']?>&amp;type=set&amp;key=<?php echo urlencode($_GET['key'])?>&amp;value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
+ <a href="edit.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=set&amp;key=<?php echo urlencode($_GET['key'])?>&amp;value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
</div></td><td><div>
- <a href="delete.php?s=<?php echo $server['id']?>&amp;type=set&amp;key=<?php echo urlencode($_GET['key'])?>&amp;value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
+ <a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=set&amp;key=<?php echo urlencode($_GET['key'])?>&amp;value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
</div></td></tr>
<?php $alt = !$alt; } ?>
@@ -258,11 +258,11 @@ else if ($type == 'zset') { ?>
<?php foreach ($values as $value) {
$score = $redis->zScore($_GET['key'], $value);
- $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value));
+ $display_value = $redis->exists($value) ? '<a href="view.php?s='.$server['id'].'&d='.$server['db'].'&key='.urlencode($value).'">'.nl2br(format_html($value)).'</a>' : nl2br(format_html($value));
?>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $score?></div></td><td><div><?php echo $display_value ?></div></td><td><div>
- <a href="edit.php?s=<?php echo $server['id']?>&amp;type=zset&amp;key=<?php echo urlencode($_GET['key'])?>&amp;score=<?php echo $score?>&amp;value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
- <a href="delete.php?s=<?php echo $server['id']?>&amp;type=zset&amp;key=<?php echo urlencode($_GET['key'])?>&amp;value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
+ <a href="edit.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=zset&amp;key=<?php echo urlencode($_GET['key'])?>&amp;score=<?php echo $score?>&amp;value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a>
+ <a href="delete.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=zset&amp;key=<?php echo urlencode($_GET['key'])?>&amp;value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a>
</div></td></tr>
<?php $alt = !$alt; } ?>
@@ -272,7 +272,7 @@ if ($type != 'string') { ?>
</table>
<p>
- <a href="edit.php?s=<?php echo $server['id']?>&amp;type=<?php echo $type?>&amp;key=<?php echo urlencode($_GET['key'])?>" class="add">Add another value</a>
+ <a href="edit.php?s=<?php echo $server['id']?>&amp;d=<?php echo $server['db']?>&amp;type=<?php echo $type?>&amp;key=<?php echo urlencode($_GET['key'])?>" class="add">Add another value</a>
</p>
<?php }