DVL-009 Adding Redis DB page

This commit is contained in:
cytopia 2017-04-23 14:08:54 +02:00
parent c644913694
commit e39c66cb8b
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
6 changed files with 65 additions and 2 deletions

@ -103,4 +103,3 @@ function loadClass($class) {
// Temporarily disable due to: // Temporarily disable due to:
// https://github.com/cytopia/devilbox/issues/8 // https://github.com/cytopia/devilbox/issues/8
$ENABLE_VHOST_DNS_CHECK = false; $ENABLE_VHOST_DNS_CHECK = false;

@ -0,0 +1,49 @@
<?php require '../config.php'; ?>
<?php if (loadClass('Docker')->getEnv('COMPOSE_OPTIONAL') != 1) {
header('Location: /index.php');
exit(0);
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require '../include/head.php'; ?>
</head>
<body>
<?php require '../include/navbar.php'; ?>
<div class="container">
<h1>Redis Keys</h1>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<table class="table table-striped ">
<thead class="thead-inverse ">
<tr>
<th>Key</th>
<th>Value</th>
</th>
</thead>
<tbody>
<?php foreach (loadClass('Redis')->getKeys() as $key => $value): ?>
<tr>
<td><?php echo $key;?></td>
<td><?php print_r($value);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
</body>
</html>

@ -530,6 +530,8 @@
</table> </table>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>

@ -1,7 +1,7 @@
<?php require '../config.php'; ?> <?php require '../config.php'; ?>
<?php $Docker = loadClass('Docker'); ?> <?php $Docker = loadClass('Docker'); ?>
<?php if ($Docker->getEnv('COMPOSE_OPTIONAL') != 1 ) { <?php if ($Docker->getEnv('COMPOSE_OPTIONAL') != 1 ) {
header(); header('Location: /index.php');
exit(0); exit(0);
} ?> } ?>
<!DOCTYPE html> <!DOCTYPE html>

@ -162,6 +162,11 @@ class Redis
return $this->_redis->info('all'); return $this->_redis->info('all');
} }
public function getKeys()
{
return $this->_redis->keys('*');
}
/********************************************************************************* /*********************************************************************************
* *

@ -28,6 +28,14 @@
<a class="nav-link" href="<?php echo $file == $current ? '#' : '/'.$file;?>"><?php echo $name;?><?php echo $file == $current ? ' <span class="sr-only">(current)</span>' : '';?></a> <a class="nav-link" href="<?php echo $file == $current ? '#' : '/'.$file;?>"><?php echo $name;?><?php echo $file == $current ? ' <span class="sr-only">(current)</span>' : '';?></a>
</li> </li>
<?php if (loadClass('Docker')->getEnv('COMPOSE_OPTIONAL') == 1): ?>
<?php $file = 'db_redis.php'; $name = 'Redis DB';?>
<li class="nav-item <?php echo $file == $current ? 'active' : '';?>">
<a class="nav-link" href="<?php echo $file == $current ? '#' : '/'.$file;?>"><?php echo $name;?><?php echo $file == $current ? ' <span class="sr-only">(current)</span>' : '';?></a>
</li>
<?php endif; ?>
<?php $file = 'mail.php'; $name = 'Emails';?> <?php $file = 'mail.php'; $name = 'Emails';?>
<li class="nav-item <?php echo $file == $current ? 'active' : '';?>"> <li class="nav-item <?php echo $file == $current ? 'active' : '';?>">
<a class="nav-link" href="<?php echo $file == $current ? '#' : '/'.$file;?>"><?php echo $name;?><?php echo $file == $current ? ' <span class="sr-only">(current)</span>' : '';?></a> <a class="nav-link" href="<?php echo $file == $current ? '#' : '/'.$file;?>"><?php echo $name;?><?php echo $file == $current ? ' <span class="sr-only">(current)</span>' : '';?></a>