diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index 996f8667..4940de53 100755 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin; use App\Http\Requests\Admin\ServerSave; use App\Http\Requests\Admin\ServerUpdate; +use App\Services\ServerService; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\ServerGroup; @@ -190,4 +191,11 @@ class ServerController extends Controller 'data' => true ]); } + + public function viewConfig(Request $request) + { + $serverService = new ServerService(); + $config = $serverService->getConfig($request->input('node_id'), 23333); + die(json_encode($config, JSON_UNESCAPED_UNICODE)); + } } diff --git a/app/Http/Routes/AdminRoute.php b/app/Http/Routes/AdminRoute.php index 3f01a1a4..d489dab3 100644 --- a/app/Http/Routes/AdminRoute.php +++ b/app/Http/Routes/AdminRoute.php @@ -29,6 +29,7 @@ class AdminRoute $router->post('/server/drop', 'Admin\\ServerController@drop'); $router->post('/server/update', 'Admin\\ServerController@update'); $router->post('/server/copy', 'Admin\\ServerController@copy'); + $router->post('/server/viewConfig', 'Admin\\ServerController@viewConfig'); // Order $router->get ('/order/fetch', 'Admin\\OrderController@fetch'); $router->post('/order/repair', 'Admin\\OrderController@repair');