feat: add v2node support

This commit is contained in:
xboard committed 2025-11-22 20:33:38 +08:00
1 parent af431d178e
commit 7801a0fb19
5 files changed
+50 -9

No files matched your search

+6 -2
View File
@@ -14,10 +14,11 @@ class Server
public function handle(Request $request, Closure $next, ?string $nodeType = null)
{
$this->validateRequest($request);
$nodeType = $request->input('node_type', $nodeType);
$normalizedNodeType = ServerModel::normalizeType($nodeType);
$serverInfo = ServerService::getServer(
$request->input('node_id'),
$request->input('node_type') ?? $nodeType
$normalizedNodeType
);
if (!$serverInfo) {
throw new ApiException('Server does not exist');
@@ -43,6 +44,9 @@ class Server
'node_type' => [
'nullable',
function ($attribute, $value, $fail) use ($request) {
if ($value === "v2node") {
$value = null;
}
if (!ServerModel::isValidType($value)) {
$fail("Invalid node type specified");
return;