77use Pterodactyl \Http \Controllers \Controller ;
88use Pterodactyl \Services \Eggs \EggConfigurationService ;
99use Pterodactyl \Repositories \Eloquent \ServerRepository ;
10+ use Pterodactyl \Services \Servers \ServerConfigurationStructureService ;
1011
11- class ServerConfigurationController extends Controller
12+ class ServerDetailsController extends Controller
1213{
1314 /**
1415 * @var \Pterodactyl\Services\Eggs\EggConfigurationService
@@ -20,21 +21,34 @@ class ServerConfigurationController extends Controller
2021 */
2122 private $ repository ;
2223
24+ /**
25+ * @var \Pterodactyl\Services\Servers\ServerConfigurationStructureService
26+ */
27+ private $ configurationStructureService ;
28+
2329 /**
2430 * ServerConfigurationController constructor.
2531 *
2632 * @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
33+ * @param \Pterodactyl\Services\Servers\ServerConfigurationStructureService $configurationStructureService
2734 * @param \Pterodactyl\Services\Eggs\EggConfigurationService $eggConfigurationService
2835 */
29- public function __construct (ServerRepository $ repository , EggConfigurationService $ eggConfigurationService )
30- {
36+ public function __construct (
37+ ServerRepository $ repository ,
38+ ServerConfigurationStructureService $ configurationStructureService ,
39+ EggConfigurationService $ eggConfigurationService
40+ ) {
3141 $ this ->eggConfigurationService = $ eggConfigurationService ;
3242 $ this ->repository = $ repository ;
43+ $ this ->configurationStructureService = $ configurationStructureService ;
3344 }
3445
3546 /**
47+ * Returns details about the server that allows Wings to self-recover and ensure
48+ * that the state of the server matches the Panel at all times.
49+ *
3650 * @param \Illuminate\Http\Request $request
37- * @param $uuid
51+ * @param string $uuid
3852 * @return \Illuminate\Http\JsonResponse
3953 *
4054 * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@@ -43,8 +57,9 @@ public function __invoke(Request $request, $uuid)
4357 {
4458 $ server = $ this ->repository ->getByUuid ($ uuid );
4559
46- return JsonResponse::create (
47- $ this ->eggConfigurationService ->handle ($ server )
48- );
60+ return JsonResponse::create ([
61+ 'settings ' => $ this ->configurationStructureService ->handle ($ server ),
62+ 'process_configuration ' => $ this ->eggConfigurationService ->handle ($ server ),
63+ ]);
4964 }
5065}
0 commit comments