Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

* upstream/master:
  It is possible to delete whole trees now. Made the keys column a bit wider.
  • Loading branch information...
commit 39aa4ccea86e792488308cd83374d0fc9a05e8c6 2 parents 069e894 + 70d1978
@tapvt authored
Showing with 42 additions and 5 deletions.
  1. +12 −3 css/index.css
  2. +11 −0 delete.php
  3. +4 −2 index.php
  4. +15 −0 js/index.js
View
15 css/index.css
@@ -4,7 +4,7 @@ position: absolute;
top: 0;
bottom: 0;
left: 0;
-width: 18em;
+width: 24em;
height: 100%;
padding-left: 1em;
border-right: 1px solid #000;
@@ -28,7 +28,7 @@ text-decoration: underline;
position: fixed;
top: 15.5em;
bottom: 0;
-width: 18em;
+width: 24em;
padding-bottom: 1em;
overflow: auto;
}
@@ -59,6 +59,7 @@ display: none;
#keys .icon {
padding: 1px 0 1px 20px;
background: url(../images/folder-open.png) left center no-repeat;
+white-space: nowrap;
}
#keys li.collapsed ul {
@@ -96,11 +97,19 @@ background-image: url(../images/tree-lastnode-expanded.gif);
background-image: url(../images/tree-lastnode-collapsed.gif);
}
+#keys .deltree {
+display: none;
+}
+
+#keys .icon:hover .deltree {
+display: inline;
+}
+
#frame {
position: fixed;
top: 0;
-left: 19em;
+left: 25em;
right: 0;
bottom: 0;
padding-left: 1em;
View
11 delete.php
@@ -49,4 +49,15 @@
die('?view&s='.$server['id'].'&key='.urlencode($_GET['key']));
}
+
+if (isset($_GET['tree'])) {
+ $keys = $redis->keys($_GET['tree'].'*');
+
+ foreach ($keys as $key) {
+ $redis->delete($key);
+ }
+
+ die;
+}
+
?>
View
6 index.php
@@ -123,8 +123,10 @@ function print_namespace($item, $name, $fullkey, $islast) {
// Does this namespace also contain subkeys?
if (count($item) > 0) {
?>
- <li class="folder<?php echo empty($fullkey) ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>"><div class="icon"><?php echo format_html($name)?> <span class="info">(<?php echo count($item)?>)</span></div>
- <ul>
+ <li class="folder<?php echo empty($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 (!empty($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 } ?>
+ </div><ul>
<?php
$l = count($item);
View
15 js/index.js
@@ -84,5 +84,20 @@ $(function() {
}
});
});
+
+ $('.deltree').click(function(e) {
+ e.preventDefault();
+
+ if (confirm('Are you sure you want to delete this whole tree and all it\'s keys?')) {
+ $.ajax({
+ type: "POST",
+ url: this.href,
+ data: 'post=1',
+ success: function(url) {
+ top.location.href = top.location.pathname;
+ }
+ });
+ }
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.