diff --git a/app/Http/Controllers/Api/IndexController.php b/app/Http/Controllers/Api/IndexController.php index 3fc78d1..e86d5cb 100644 --- a/app/Http/Controllers/Api/IndexController.php +++ b/app/Http/Controllers/Api/IndexController.php @@ -30,11 +30,6 @@ public function nodes(): JsonResponse { $nodes = ClusterSupport::nodes(true); - $current_node_id = ClusterSupport::currentNode()['id']; - - return $this->success([ - 'nodes' => $nodes, - 'current_node_id' => $current_node_id, - ]); + return $this->success($nodes); } } diff --git a/app/Support/ClusterSupport.php b/app/Support/ClusterSupport.php index cba0e72..cb679c4 100644 --- a/app/Support/ClusterSupport.php +++ b/app/Support/ClusterSupport.php @@ -129,15 +129,19 @@ public static function nodes($hide_ip = false): array { $nodes = self::hgetAll('nodes'); + $append_nodes = []; + foreach ($nodes as $key => $node) { $nodes[$key] = json_decode($node, true); if ($hide_ip) { unset($nodes[$key]['ip']); } + + $append_nodes[] = $nodes[$key]; } - return $nodes; + return $append_nodes; } public static function hgetAll($hashKey, $default = []): array