You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues before opening this feature request.
Describe the feature you would like to see.
It would be great if the panel has the ability to create admin/databases using api-application route instead of creating the database host manulally.
Describe the solution you'd like.
I think we can add the following to api-application route
in the file routes\api-application.php we can add Route::post('/', [Admin\DatabaseController::class, 'create']);
under Endpoint: /api/application/nodes and modify the create method instead of returning redirect response to be the same as the return response from this endpoint Route::post('/', [Application\Servers\DatabaseController::class, 'store']);
this way we can call api/application/nodes/admin/databases and create a the host database
Simple workaround was to add the following code to panel api-application.
1- routes/api-application.php
// added use admin controller at the top
use Pterodactyl\Http\Controllers\Admin;
/*
|--------------------------------------------------------------------------
| Node Controller Routes
|--------------------------------------------------------------------------
|
| Endpoint: /api/application/nodes
|
*/
Route::group(['prefix' => '/nodes'], function () {
// databases
Route::post('/admin/databases', [Admin\DatabaseController::class, 'createdb']);
Route::delete('/admin/databases/{host:id}', [Admin\DatabaseController::class, 'deletedb']);
... the rest of the code
});
// added use Response at the top
use Illuminate\Http\Response;
/**
* Handle request to create a new database host.
*
* @throws \Throwable
*/
public function createdb(DatabaseHostFormRequest $request): Response
{
$host = $this->creationService->handle($request->normalize());
return response($host, 200);
}
/**
* Handle request to delete a database host.
*
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException
*/
public function deletedb(int $host): Response
{
$this->deletionService->handle($host);
return response('', 204);
}
The text was updated successfully, but these errors were encountered:
Is there an existing feature request for this?
Describe the feature you would like to see.
It would be great if the panel has the ability to create admin/databases using api-application route instead of creating the database host manulally.
Describe the solution you'd like.
I think we can add the following to api-application route
in the file
routes\api-application.php
we can addRoute::post('/', [Admin\DatabaseController::class, 'create']);
under
Endpoint: /api/application/nodes
and modify the create method instead of returning redirect response to be the same as the return response from this endpointRoute::post('/', [Application\Servers\DatabaseController::class, 'store']);
this way we can call
api/application/nodes/admin/databases
and create a the host databaseSimple workaround was to add the following code to panel api-application.
1- routes/api-application.php
2- app/Http/Controllers/Admin/DatabaseController.php
The text was updated successfully, but these errors were encountered: