-
app/Http/Controllers/Admin/Nodes/SystemInformationController.php
Open in GitHubuse Illuminate\Support\Str; use Illuminate\Http\Request; use Pterodactyl\Models\Node; use Illuminate\Http\JsonResponse; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\Wings\DaemonConfigurationRepository; class SystemInformationController extends Controller { private $repository; public function __construct(DaemonConfigurationRepository $repository) { $this->repository = $repository; } public function __invoke(Request $request, Node $node) { $data = $this->repository->setNode($node)->getSystemInformation(); return JsonResponse::create([ 'version' => $data['version'] ?? '', 'system' => [ 'type' => Str::title($data['os'] ?? 'Unknown'), 'arch' => $data['architecture'] ?? '--', 'release' => $data['kernel_version'] ?? '--', 'cpus' => $data['cpu_count'] ?? 0, ], ]); } }
-
routes/admin.php
Open in GitHubuse Illuminate\Support\Facades\Route; Route::group(['prefix' => 'nodes'], function () { // Route::get('/view/{node}/system-information', 'Nodes\SystemInformationController'); // }); //