改进 返回
This commit is contained in:
parent
283db6cad9
commit
b2d69f38d8
@ -30,11 +30,6 @@ public function nodes(): JsonResponse
|
|||||||
{
|
{
|
||||||
$nodes = ClusterSupport::nodes(true);
|
$nodes = ClusterSupport::nodes(true);
|
||||||
|
|
||||||
$current_node_id = ClusterSupport::currentNode()['id'];
|
return $this->success($nodes);
|
||||||
|
|
||||||
return $this->success([
|
|
||||||
'nodes' => $nodes,
|
|
||||||
'current_node_id' => $current_node_id,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,15 +129,19 @@ public static function nodes($hide_ip = false): array
|
|||||||
{
|
{
|
||||||
$nodes = self::hgetAll('nodes');
|
$nodes = self::hgetAll('nodes');
|
||||||
|
|
||||||
|
$append_nodes = [];
|
||||||
|
|
||||||
foreach ($nodes as $key => $node) {
|
foreach ($nodes as $key => $node) {
|
||||||
$nodes[$key] = json_decode($node, true);
|
$nodes[$key] = json_decode($node, true);
|
||||||
|
|
||||||
if ($hide_ip) {
|
if ($hide_ip) {
|
||||||
unset($nodes[$key]['ip']);
|
unset($nodes[$key]['ip']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$append_nodes[] = $nodes[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $nodes;
|
return $append_nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function hgetAll($hashKey, $default = []): array
|
public static function hgetAll($hashKey, $default = []): array
|
||||||
|
Loading…
Reference in New Issue
Block a user