diff --git a/flush.php b/flush.php new file mode 100644 index 0000000..4e74489 --- /dev/null +++ b/flush.php @@ -0,0 +1,13 @@ +flushdb(); + diff --git a/images/flush.png b/images/flush.png new file mode 100644 index 0000000..54c7d16 Binary files /dev/null and b/images/flush.png differ diff --git a/includes/config.sample.inc.php b/includes/config.sample.inc.php index b88ff85..1227fce 100644 --- a/includes/config.sample.inc.php +++ b/includes/config.sample.inc.php @@ -25,6 +25,7 @@ '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 + 'flush' => false // Set to true to enable the flushdb button for this instance. )*/ ), @@ -50,8 +51,6 @@ ),*/ - - // You can ignore settings below this point. 'maxkeylen' => 100, diff --git a/index.php b/index.php index cf1fb40..98418ac 100644 --- a/index.php +++ b/index.php @@ -173,6 +173,9 @@ function print_namespace($item, $name, $fullkey, $islast) { [I] [E] [I] + +[F] +

diff --git a/js/index.js b/js/index.js index 58f374e..9886aa6 100644 --- a/js/index.js +++ b/js/index.js @@ -20,8 +20,21 @@ $(function() { href += '.php'; } } - - $('#iframe').attr('src', href); + + if (href.indexOf('flush.php') == 0) { + if (confirm('Are you sure you want to delete this key and all it\'s values?')) { + $.ajax({ + type: "POST", + url: href, + data: 'post=1', + success: function() { + window.location.reload(); + } + }); + } + } else { + $('#iframe').attr('src', href); + } }); @@ -98,5 +111,6 @@ $(function() { }); } }); + });