mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-22 17:12:30 +01:00
228 lines
12 KiB
PHP
228 lines
12 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Pterodactyl\Http\Controllers\Admin;
|
|
use Pterodactyl\Http\Middleware\Admin\Servers\ServerInstalled;
|
|
|
|
Route::get('/', [Admin\BaseController::class, 'index'])->name('admin.index');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Location Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/api
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'api'], function () {
|
|
Route::get('/', [Admin\ApiController::class, 'index'])->name('admin.api.index');
|
|
Route::get('/new', [Admin\ApiController::class, 'create'])->name('admin.api.new');
|
|
|
|
Route::post('/new', [Admin\ApiController::class, 'store']);
|
|
|
|
Route::delete('/revoke/{identifier}', [Admin\ApiController::class, 'delete'])->name('admin.api.delete');
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Location Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/locations
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'locations'], function () {
|
|
Route::get('/', [Admin\LocationController::class, 'index'])->name('admin.locations');
|
|
Route::get('/view/{location}', [Admin\LocationController::class, 'view'])->name('admin.locations.view');
|
|
|
|
Route::post('/', [Admin\LocationController::class, 'create']);
|
|
Route::patch('/view/{location}', [Admin\LocationController::class, 'update']);
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Database Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/databases
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'databases'], function () {
|
|
Route::get('/', [Admin\DatabaseController::class, 'index'])->name('admin.databases');
|
|
Route::get('/view/{host}', [Admin\DatabaseController::class, 'view'])->name('admin.databases.view');
|
|
|
|
Route::post('/', [Admin\DatabaseController::class, 'create']);
|
|
Route::patch('/view/{host}', [Admin\DatabaseController::class, 'update']);
|
|
Route::delete('/view/{host}', [Admin\DatabaseController::class, 'delete']);
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Settings Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/settings
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'settings'], function () {
|
|
Route::get('/', [Admin\Settings\IndexController::class, 'index'])->name('admin.settings');
|
|
Route::get('/mail', [Admin\Settings\MailController::class, 'index'])->name('admin.settings.mail');
|
|
Route::get('/advanced', [Admin\Settings\AdvancedController::class, 'index'])->name('admin.settings.advanced');
|
|
|
|
Route::post('/mail/test', [Admin\Settings\MailController::class, 'test'])->name('admin.settings.mail.test');
|
|
|
|
Route::patch('/', [Admin\Settings\IndexController::class, 'update']);
|
|
Route::patch('/mail', [Admin\Settings\MailController::class, 'update']);
|
|
Route::patch('/advanced', [Admin\Settings\AdvancedController::class, 'update']);
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| User Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/users
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'users'], function () {
|
|
Route::get('/', [Admin\UserController::class, 'index'])->name('admin.users');
|
|
Route::get('/accounts.json', [Admin\UserController::class, 'json'])->name('admin.users.json');
|
|
Route::get('/new', [Admin\UserController::class, 'create'])->name('admin.users.new');
|
|
Route::get('/view/{user}', [Admin\UserController::class, 'view'])->name('admin.users.view');
|
|
|
|
Route::post('/new', [Admin\UserController::class, 'store']);
|
|
|
|
Route::patch('/view/{user}', [Admin\UserController::class, 'update']);
|
|
Route::delete('/view/{user}', [Admin\UserController::class, 'delete']);
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Server Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/servers
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'servers'], function () {
|
|
Route::get('/', [Admin\Servers\ServerController::class, 'index'])->name('admin.servers');
|
|
Route::get('/new', [Admin\Servers\CreateServerController::class, 'index'])->name('admin.servers.new');
|
|
Route::get('/view/{server}', [Admin\Servers\ServerViewController::class, 'index'])->name('admin.servers.view');
|
|
|
|
Route::group(['middleware' => [ServerInstalled::class]], function () {
|
|
Route::get('/view/{server}/details', [Admin\Servers\ServerViewController::class, 'details'])->name('admin.servers.view.details');
|
|
Route::get('/view/{server}/build', [Admin\Servers\ServerViewController::class, 'build'])->name('admin.servers.view.build');
|
|
Route::get('/view/{server}/startup', [Admin\Servers\ServerViewController::class, 'startup'])->name('admin.servers.view.startup');
|
|
Route::get('/view/{server}/database', [Admin\Servers\ServerViewController::class, 'database'])->name('admin.servers.view.database');
|
|
Route::get('/view/{server}/mounts', [Admin\Servers\ServerViewController::class, 'mounts'])->name('admin.servers.view.mounts');
|
|
});
|
|
|
|
Route::get('/view/{server}/manage', [Admin\Servers\ServerViewController::class, 'manage'])->name('admin.servers.view.manage');
|
|
Route::get('/view/{server}/delete', [Admin\Servers\ServerViewController::class, 'delete'])->name('admin.servers.view.delete');
|
|
|
|
Route::post('/new', [Admin\Servers\CreateServerController::class, 'store']);
|
|
Route::post('/view/{server}/build', [Admin\ServersController::class, 'updateBuild']);
|
|
Route::post('/view/{server}/startup', [Admin\ServersController::class, 'saveStartup']);
|
|
Route::post('/view/{server}/database', [Admin\ServersController::class, 'newDatabase']);
|
|
Route::post('/view/{server}/mounts/{mount}', [Admin\ServersController::class, 'addMount'])->name('admin.servers.view.mounts.toggle');
|
|
Route::post('/view/{server}/manage/toggle', [Admin\ServersController::class, 'toggleInstall'])->name('admin.servers.view.manage.toggle');
|
|
Route::post('/view/{server}/manage/suspension', [Admin\ServersController::class, 'manageSuspension'])->name('admin.servers.view.manage.suspension');
|
|
Route::post('/view/{server}/manage/reinstall', [Admin\ServersController::class, 'reinstallServer'])->name('admin.servers.view.manage.reinstall');
|
|
Route::post('/view/{server}/manage/transfer', [Admin\Servers\ServerTransferController::class, 'transfer'])->name('admin.servers.view.manage.transfer');
|
|
Route::post('/view/{server}/delete', [Admin\ServersController::class, 'delete']);
|
|
|
|
Route::patch('/view/{server}/details', [Admin\ServersController::class, 'setDetails']);
|
|
Route::patch('/view/{server}/database', [Admin\ServersController::class, 'resetDatabasePassword']);
|
|
|
|
Route::delete('/view/{server}/database/{database}/delete', [Admin\ServersController::class, 'deleteDatabase'])->name('admin.servers.view.database.delete');
|
|
Route::delete('/view/{server}/mounts/{mount}', [Admin\ServersController::class, 'deleteMount']);
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Node Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/nodes
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'nodes'], function () {
|
|
Route::get('/', [Admin\Nodes\NodeController::class, 'index'])->name('admin.nodes');
|
|
Route::get('/new', [Admin\NodesController::class, 'create'])->name('admin.nodes.new');
|
|
Route::get('/view/{node}', [Admin\Nodes\NodeViewController::class, 'index'])->name('admin.nodes.view');
|
|
Route::get('/view/{node}/settings', [Admin\Nodes\NodeViewController::class, 'settings'])->name('admin.nodes.view.settings');
|
|
Route::get('/view/{node}/configuration', [Admin\Nodes\NodeViewController::class, 'configuration'])->name('admin.nodes.view.configuration');
|
|
Route::get('/view/{node}/allocation', [Admin\Nodes\NodeViewController::class, 'allocations'])->name('admin.nodes.view.allocation');
|
|
Route::get('/view/{node}/servers', [Admin\Nodes\NodeViewController::class, 'servers'])->name('admin.nodes.view.servers');
|
|
Route::get('/view/{node}/system-information', Admin\Nodes\SystemInformationController::class);
|
|
|
|
Route::post('/new', [Admin\NodesController::class, 'store']);
|
|
Route::post('/view/{node}/allocation', [Admin\NodesController::class, 'createAllocation']);
|
|
Route::post('/view/{node}/allocation/remove', [Admin\NodesController::class, 'allocationRemoveBlock'])->name('admin.nodes.view.allocation.removeBlock');
|
|
Route::post('/view/{node}/allocation/alias', [Admin\NodesController::class, 'allocationSetAlias'])->name('admin.nodes.view.allocation.setAlias');
|
|
Route::post('/view/{node}/settings/token', Admin\NodeAutoDeployController::class)->name('admin.nodes.view.configuration.token');
|
|
|
|
Route::patch('/view/{node}/settings', [Admin\NodesController::class, 'updateSettings']);
|
|
|
|
Route::delete('/view/{node}/delete', [Admin\NodesController::class, 'delete'])->name('admin.nodes.view.delete');
|
|
Route::delete('/view/{node}/allocation/remove/{allocation}', [Admin\NodesController::class, 'allocationRemoveSingle'])->name('admin.nodes.view.allocation.removeSingle');
|
|
Route::delete('/view/{node}/allocations', [Admin\NodesController::class, 'allocationRemoveMultiple'])->name('admin.nodes.view.allocation.removeMultiple');
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Mount Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/mounts
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'mounts'], function () {
|
|
Route::get('/', [Admin\MountController::class, 'index'])->name('admin.mounts');
|
|
Route::get('/view/{mount}', [Admin\MountController::class, 'view'])->name('admin.mounts.view');
|
|
|
|
Route::post('/', [Admin\MountController::class, 'create']);
|
|
Route::post('/{mount}/eggs', [Admin\MountController::class, 'addEggs'])->name('admin.mounts.eggs');
|
|
Route::post('/{mount}/nodes', [Admin\MountController::class, 'addNodes'])->name('admin.mounts.nodes');
|
|
|
|
Route::patch('/view/{mount}', [Admin\MountController::class, 'update']);
|
|
|
|
Route::delete('/{mount}/eggs/{egg_id}', [Admin\MountController::class, 'deleteEgg']);
|
|
Route::delete('/{mount}/nodes/{node_id}', [Admin\MountController::class, 'deleteNode']);
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Nest Controller Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /admin/nests
|
|
|
|
|
*/
|
|
Route::group(['prefix' => 'nests'], function () {
|
|
Route::get('/', [Admin\Nests\NestController::class, 'index'])->name('admin.nests');
|
|
Route::get('/new', [Admin\Nests\NestController::class, 'create'])->name('admin.nests.new');
|
|
Route::get('/view/{nest}', [Admin\Nests\NestController::class, 'view'])->name('admin.nests.view');
|
|
Route::get('/egg/new', [Admin\Nests\EggController::class, 'create'])->name('admin.nests.egg.new');
|
|
Route::get('/egg/{egg}', [Admin\Nests\EggController::class, 'view'])->name('admin.nests.egg.view');
|
|
Route::get('/egg/{egg}/export', [Admin\Nests\EggShareController::class, 'export'])->name('admin.nests.egg.export');
|
|
Route::get('/egg/{egg}/variables', [Admin\Nests\EggVariableController::class, 'view'])->name('admin.nests.egg.variables');
|
|
Route::get('/egg/{egg}/scripts', [Admin\Nests\EggScriptController::class, 'index'])->name('admin.nests.egg.scripts');
|
|
|
|
Route::post('/new', [Admin\Nests\NestController::class, 'store']);
|
|
Route::post('/import', [Admin\Nests\EggShareController::class, 'import'])->name('admin.nests.egg.import');
|
|
Route::post('/egg/new', [Admin\Nests\EggController::class, 'store']);
|
|
Route::post('/egg/{egg}/variables', [Admin\Nests\EggVariableController::class, 'store']);
|
|
|
|
Route::put('/egg/{egg}', [Admin\Nests\EggShareController::class, 'update']);
|
|
|
|
Route::patch('/view/{nest}', [Admin\Nests\NestController::class, 'update']);
|
|
Route::patch('/egg/{egg}', [Admin\Nests\EggController::class, 'update']);
|
|
Route::patch('/egg/{egg}/scripts', [Admin\Nests\EggScriptController::class, 'update']);
|
|
Route::patch('/egg/{egg}/variables/{variable}', [Admin\Nests\EggVariableController::class, 'update'])->name('admin.nests.egg.variables.edit');
|
|
|
|
Route::delete('/view/{nest}', [Admin\Nests\NestController::class, 'destroy']);
|
|
Route::delete('/egg/{egg}', [Admin\Nests\EggController::class, 'destroy']);
|
|
Route::delete('/egg/{egg}/variables/{variable}', [Admin\Nests\EggVariableController::class, 'destroy']);
|
|
});
|