改进 Nodes

This commit is contained in:
iVampireSP.com 2023-01-05 13:51:33 +08:00
parent c04c83ec67
commit d3eef1b4a6
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 11 additions and 1 deletions

View File

@ -26,6 +26,11 @@ public function module_reports(Request $request)
public function nodes() { public function nodes() {
$nodes = Cluster::nodes(true); $nodes = Cluster::nodes(true);
return $this->success($nodes); $current_node_id = Cluster::currentNode()['id'];
return $this->success([
'nodes' => $nodes,
'current_node_id' => $current_node_id,
]);
} }
} }

View File

@ -142,4 +142,9 @@ public static function registerThisNode($report = true): void
Cluster::publish('node.ok'); Cluster::publish('node.ok');
} }
} }
public static function currentNode()
{
return config('settings.node');
}
} }