From b8cd06887229645b05cc0a3dab85ba30bf25207d Mon Sep 17 00:00:00 2001 From: z-song Date: Wed, 10 Jul 2019 18:32:29 +0800 Subject: [PATCH] Fix #11 #19 --- resources/views/index.blade.php | 2 +- resources/views/layout.blade.php | 2 +- src/RedisController.php | 2 +- src/RedisManager.php | 11 +++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 723f9f6..ae51139 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -75,7 +75,7 @@ {{ $key[0] }} @php($type = $key[1]->getPayload()) - {{ $type }} + {{ $type }} {{ $key[2] }} diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index 7e51bd8..41e4e54 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -44,7 +44,7 @@ @foreach($connections[$conn] as $name => $value) {{ $name }} - {{ $value }} + {{ is_array($value) ? json_encode($value) : $value }} @endforeach diff --git a/src/RedisController.php b/src/RedisController.php index 70e72e3..0896b55 100644 --- a/src/RedisController.php +++ b/src/RedisController.php @@ -25,7 +25,7 @@ public function index() $connection = request('conn', 'default'); $manager = $this->manager(); - +//dd($manager->getConnections()); $variables = [ 'conn' => $connection, 'info' => $manager->getInformation(), diff --git a/src/RedisManager.php b/src/RedisManager.php index d018967..7340f8f 100644 --- a/src/RedisManager.php +++ b/src/RedisManager.php @@ -11,6 +11,7 @@ use Encore\Admin\RedisManager\DataType\Strings; use Illuminate\Http\Request; use Illuminate\Redis\Connections\Connection; +use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Redis; use Predis\Collection\Iterator\Keyspace; @@ -267,4 +268,14 @@ public function execute($command) return $this->getConnection()->executeRaw($command); } + + /** + * @param string $type + * + * @return mixed + */ + public static function typeColor($type) + { + return Arr::get(static::$typeColor, $type, 'default'); + } }