2017-04-02 01:01:10 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Pterodactyl - Panel
|
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
Route::get('/', 'BaseController@getIndex')->name('admin.index');
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Location Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/locations
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'locations'], function () {
|
|
|
|
Route::get('/', 'LocationController@index')->name('admin.locations');
|
2017-06-15 04:53:24 +00:00
|
|
|
Route::get('/view/{location}', 'LocationController@view')->name('admin.locations.view');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
|
|
|
Route::post('/', 'LocationController@create');
|
2017-06-25 00:49:09 +00:00
|
|
|
Route::patch('/view/{location}', 'LocationController@update');
|
2017-04-02 01:01:10 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Database Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/databases
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'databases'], function () {
|
|
|
|
Route::get('/', 'DatabaseController@index')->name('admin.databases');
|
2017-06-18 00:48:31 +00:00
|
|
|
Route::get('/view/{host}', 'DatabaseController@view')->name('admin.databases.view');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
|
|
|
Route::post('/', 'DatabaseController@create');
|
2017-06-18 00:48:31 +00:00
|
|
|
Route::patch('/view/{host}', 'DatabaseController@update');
|
2017-04-02 01:01:10 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Settings Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/settings
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'settings'], function () {
|
|
|
|
Route::get('/', 'BaseController@getSettings')->name('admin.settings');
|
|
|
|
|
|
|
|
Route::post('/', 'BaseController@postSettings');
|
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| User Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/users
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'users'], function () {
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::get('/', 'UserController@index')->name('admin.users');
|
|
|
|
Route::get('/accounts.json', 'UserController@json')->name('admin.users.json');
|
|
|
|
Route::get('/new', 'UserController@create')->name('admin.users.new');
|
2017-06-11 03:28:44 +00:00
|
|
|
Route::get('/view/{user}', 'UserController@view')->name('admin.users.view');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::post('/new', 'UserController@store');
|
2017-06-11 03:28:44 +00:00
|
|
|
Route::patch('/view/{user}', 'UserController@update');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-06-11 03:28:44 +00:00
|
|
|
Route::delete('/view/{user}', 'UserController@delete');
|
2017-04-02 01:01:10 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Server Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/servers
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'servers'], function () {
|
|
|
|
Route::get('/', 'ServersController@index')->name('admin.servers');
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::get('/new', 'ServersController@create')->name('admin.servers.new');
|
2017-07-23 19:51:18 +00:00
|
|
|
Route::get('/view/{server}', 'ServersController@viewIndex')->name('admin.servers.view');
|
|
|
|
Route::get('/view/{server}/details', 'ServersController@viewDetails')->name('admin.servers.view.details');
|
|
|
|
Route::get('/view/{server}/build', 'ServersController@viewBuild')->name('admin.servers.view.build');
|
|
|
|
Route::get('/view/{server}/startup', 'ServersController@viewStartup')->name('admin.servers.view.startup');
|
|
|
|
Route::get('/view/{server}/database', 'ServersController@viewDatabase')->name('admin.servers.view.database');
|
|
|
|
Route::get('/view/{server}/manage', 'ServersController@viewManage')->name('admin.servers.view.manage');
|
|
|
|
Route::get('/view/{server}/delete', 'ServersController@viewDelete')->name('admin.servers.view.delete');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::post('/new', 'ServersController@store');
|
2017-04-14 04:07:58 +00:00
|
|
|
Route::post('/new/nodes', 'ServersController@nodes')->name('admin.servers.new.nodes');
|
2017-07-23 19:51:18 +00:00
|
|
|
Route::post('/view/{server}/build', 'ServersController@updateBuild');
|
|
|
|
Route::post('/view/{server}/startup', 'ServersController@saveStartup');
|
|
|
|
Route::post('/view/{server}/database', 'ServersController@newDatabase');
|
|
|
|
Route::post('/view/{server}/manage/toggle', 'ServersController@toggleInstall')->name('admin.servers.view.manage.toggle');
|
|
|
|
Route::post('/view/{server}/manage/rebuild', 'ServersController@rebuildContainer')->name('admin.servers.view.manage.rebuild');
|
|
|
|
Route::post('/view/{server}/manage/suspension', 'ServersController@manageSuspension')->name('admin.servers.view.manage.suspension');
|
|
|
|
Route::post('/view/{server}/manage/reinstall', 'ServersController@reinstallServer')->name('admin.servers.view.manage.reinstall');
|
|
|
|
Route::post('/view/{server}/delete', 'ServersController@delete');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-07-23 01:15:01 +00:00
|
|
|
Route::patch('/view/{server}/details', 'ServersController@setDetails');
|
|
|
|
Route::patch('/view/{server}/details/container', 'ServersController@setContainer')->name('admin.servers.view.details.container');
|
2017-07-23 19:51:18 +00:00
|
|
|
Route::patch('/view/{server}/database', 'ServersController@resetDatabasePassword');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-07-23 19:51:18 +00:00
|
|
|
Route::delete('/view/{server}/database/{database}/delete', 'ServersController@deleteDatabase')->name('admin.servers.view.database.delete');
|
2017-04-02 01:01:10 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Node Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/nodes
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'nodes'], function () {
|
|
|
|
Route::get('/', 'NodesController@index')->name('admin.nodes');
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::get('/new', 'NodesController@create')->name('admin.nodes.new');
|
2017-08-05 22:20:07 +00:00
|
|
|
Route::get('/view/{node}', 'NodesController@viewIndex')->name('admin.nodes.view');
|
|
|
|
Route::get('/view/{node}/settings', 'NodesController@viewSettings')->name('admin.nodes.view.settings');
|
|
|
|
Route::get('/view/{node}/configuration', 'NodesController@viewConfiguration')->name('admin.nodes.view.configuration');
|
|
|
|
Route::get('/view/{node}/allocation', 'NodesController@viewAllocation')->name('admin.nodes.view.allocation');
|
|
|
|
Route::get('/view/{node}/servers', 'NodesController@viewServers')->name('admin.nodes.view.servers');
|
|
|
|
Route::get('/view/{node}/settings/token', 'NodesController@setToken')->name('admin.nodes.view.configuration.token');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::post('/new', 'NodesController@store');
|
2017-08-05 22:20:07 +00:00
|
|
|
Route::post('/view/{node}/allocation', 'NodesController@createAllocation');
|
|
|
|
Route::post('/view/{node}/allocation/remove', 'NodesController@allocationRemoveBlock')->name('admin.nodes.view.allocation.removeBlock');
|
|
|
|
Route::post('/view/{node}/allocation/alias', 'NodesController@allocationSetAlias')->name('admin.nodes.view.allocation.setAlias');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
Route::patch('/view/{node}/settings', 'NodesController@updateSettings');
|
|
|
|
|
|
|
|
Route::delete('/view/{node}/delete', 'NodesController@delete')->name('admin.nodes.view.delete');
|
|
|
|
Route::delete('/view/{node}/allocation/remove/{allocation}', 'NodesController@allocationRemoveSingle')->name('admin.nodes.view.allocation.removeSingle');
|
2017-04-02 01:01:10 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Service Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/services
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'services'], function () {
|
|
|
|
Route::get('/', 'ServiceController@index')->name('admin.services');
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::get('/new', 'ServiceController@create')->name('admin.services.new');
|
2017-04-02 01:01:10 +00:00
|
|
|
Route::get('/view/{id}', 'ServiceController@view')->name('admin.services.view');
|
|
|
|
Route::get('/view/{id}/functions', 'ServiceController@viewFunctions')->name('admin.services.view.functions');
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::get('/option/new', 'OptionController@create')->name('admin.services.option.new');
|
2017-06-11 03:28:44 +00:00
|
|
|
Route::get('/option/{option}', 'OptionController@viewConfiguration')->name('admin.services.option.view');
|
2017-08-12 20:29:01 +00:00
|
|
|
Route::get('/option/{option}/variables', 'VariableController@view')->name('admin.services.option.variables');
|
2017-06-11 03:28:44 +00:00
|
|
|
Route::get('/option/{option}/scripts', 'OptionController@viewScripts')->name('admin.services.option.scripts');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::post('/new', 'ServiceController@store');
|
|
|
|
Route::post('/option/new', 'OptionController@store');
|
2017-08-12 20:29:01 +00:00
|
|
|
Route::post('/option/{option}/variables', 'VariableController@store');
|
2017-04-02 01:01:10 +00:00
|
|
|
|
2017-08-12 20:29:01 +00:00
|
|
|
Route::patch('/view/{option}', 'ServiceController@edit');
|
2017-08-09 04:24:55 +00:00
|
|
|
Route::patch('/option/{option}', 'OptionController@editConfiguration');
|
2017-08-12 20:29:01 +00:00
|
|
|
Route::patch('/option/{option}/scripts', 'OptionController@updateScripts');
|
|
|
|
Route::patch('/option/{option}/variables/{variable}', 'VariableController@update')->name('admin.services.option.variables.edit');
|
2017-08-09 04:24:55 +00:00
|
|
|
|
2017-04-02 01:01:10 +00:00
|
|
|
Route::delete('/view/{id}', 'ServiceController@delete');
|
2017-08-12 20:29:01 +00:00
|
|
|
Route::delete('/option/{option}', 'OptionController@delete');
|
|
|
|
Route::delete('/option/{option}/variables/{variable}', 'VariableController@delete');
|
2017-04-02 01:01:10 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Pack Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /admin/packs
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'packs'], function () {
|
|
|
|
Route::get('/', 'PackController@index')->name('admin.packs');
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::get('/new', 'PackController@create')->name('admin.packs.new');
|
2017-04-02 01:01:10 +00:00
|
|
|
Route::get('/new/template', 'PackController@newTemplate')->name('admin.packs.new.template');
|
|
|
|
Route::get('/view/{id}', 'PackController@view')->name('admin.packs.view');
|
|
|
|
|
2017-04-09 23:13:22 +00:00
|
|
|
Route::post('/new', 'PackController@store');
|
2017-04-02 01:01:10 +00:00
|
|
|
Route::post('/view/{id}', 'PackController@update');
|
|
|
|
Route::post('/view/{id}/export/{files?}', 'PackController@export')->name('admin.packs.view.export');
|
|
|
|
});
|