2015-12-06 19:58:49 +01:00
|
|
|
<?php
|
2016-01-20 01:10:39 +01:00
|
|
|
/**
|
2016-01-20 22:05:16 +01:00
|
|
|
* Pterodactyl - Panel
|
2017-01-24 23:57:08 +01:00
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
|
2016-12-07 23:46:38 +01:00
|
|
|
* Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com>.
|
2016-01-20 01:10:39 +01:00
|
|
|
*
|
2016-01-20 21:56:40 +01:00
|
|
|
* 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:
|
2016-01-20 01:10:39 +01:00
|
|
|
*
|
2016-01-20 21:56:40 +01:00
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
2016-01-20 01:10:39 +01:00
|
|
|
*
|
2016-01-20 21:56:40 +01:00
|
|
|
* 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.
|
2016-01-20 01:10:39 +01:00
|
|
|
*/
|
2016-12-07 23:46:38 +01:00
|
|
|
|
2015-12-06 19:58:49 +01:00
|
|
|
namespace Pterodactyl\Http\Routes;
|
|
|
|
|
|
|
|
use Illuminate\Routing\Router;
|
|
|
|
|
2016-12-07 23:46:38 +01:00
|
|
|
class AdminRoutes
|
|
|
|
{
|
|
|
|
public function map(Router $router)
|
|
|
|
{
|
2015-12-06 19:58:49 +01:00
|
|
|
|
2016-01-04 22:09:39 +01:00
|
|
|
// Admin Index
|
|
|
|
$router->get('admin', [
|
|
|
|
'as' => 'admin.index',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 03:50:43 +01:00
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
2016-01-04 22:09:39 +01:00
|
|
|
],
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\BaseController@getIndex',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
2015-12-12 07:21:17 +01:00
|
|
|
|
2016-01-21 04:08:09 +01:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/settings',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-21 04:08:09 +01:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.settings',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\BaseController@getSettings',
|
2016-01-21 04:08:09 +01:00
|
|
|
]);
|
|
|
|
$router->post('/', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\BaseController@postSettings',
|
2016-01-21 04:08:09 +01:00
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
2016-01-04 22:09:39 +01:00
|
|
|
$router->group([
|
2016-02-21 07:15:37 +01:00
|
|
|
'prefix' => 'admin/users',
|
2016-01-04 22:09:39 +01:00
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 03:50:43 +01:00
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-04 22:09:39 +01:00
|
|
|
], function () use ($router) {
|
2016-01-02 06:25:41 +01:00
|
|
|
|
2016-01-04 22:09:39 +01:00
|
|
|
// View All Accounts on System
|
|
|
|
$router->get('/', [
|
2016-02-21 07:15:37 +01:00
|
|
|
'as' => 'admin.users',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@getIndex',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
2016-10-21 21:22:47 +02:00
|
|
|
$router->get('/accounts.json', [
|
|
|
|
'as' => 'admin.users.json',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@getJson',
|
2016-10-21 21:22:47 +02:00
|
|
|
]);
|
|
|
|
|
2016-01-04 22:09:39 +01:00
|
|
|
// View Specific Account
|
|
|
|
$router->get('/view/{id}', [
|
2016-02-21 07:15:37 +01:00
|
|
|
'as' => 'admin.users.view',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@getView',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
2016-02-21 07:15:37 +01:00
|
|
|
// View Specific Account
|
|
|
|
$router->post('/view/{id}', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@updateUser',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
2016-01-02 06:25:41 +01:00
|
|
|
|
2016-02-21 07:15:37 +01:00
|
|
|
// Delete an Account Matching an ID
|
|
|
|
$router->delete('/view/{id}', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@deleteUser',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
2015-12-06 19:58:49 +01:00
|
|
|
|
2016-02-21 07:15:37 +01:00
|
|
|
// Show Create Account Page
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.users.new',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@getNew',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
2015-12-11 00:30:47 +01:00
|
|
|
|
2016-02-21 07:15:37 +01:00
|
|
|
// Handle Creating New Account
|
|
|
|
$router->post('/new', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\UserController@postNew',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Server Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/servers',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 03:50:43 +01:00
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-04 22:09:39 +01:00
|
|
|
], function () use ($router) {
|
|
|
|
|
|
|
|
// View All Servers
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.servers',
|
2017-03-05 01:03:49 +01:00
|
|
|
'uses' => 'Admin\ServersController@index',
|
|
|
|
]);
|
2016-01-04 22:09:39 +01:00
|
|
|
|
|
|
|
// View Create Server Page
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.servers.new',
|
2017-03-05 01:03:49 +01:00
|
|
|
'uses' => 'Admin\ServersController@new',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Handle POST Request for Creating Server
|
|
|
|
$router->post('/new', [
|
2017-03-05 01:03:49 +01:00
|
|
|
'uses' => 'Admin\ServersController@create',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
2016-01-03 00:04:18 +01:00
|
|
|
|
2016-01-04 22:09:39 +01:00
|
|
|
// Assorted Page Helpers
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->post('/new/nodes', [
|
|
|
|
'as' => 'admin.servers.new.nodes',
|
|
|
|
'uses' => 'Admin\ServersController@newServerNodes',
|
2016-09-02 03:16:38 +02:00
|
|
|
]);
|
2016-01-04 22:09:39 +01:00
|
|
|
|
|
|
|
$router->get('/view/{id}', [
|
|
|
|
'as' => 'admin.servers.view',
|
2017-03-05 01:03:49 +01:00
|
|
|
'uses' => 'Admin\ServersController@viewIndex',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->get('/view/{id}/details', [
|
|
|
|
'as' => 'admin.servers.view.details',
|
|
|
|
'uses' => 'Admin\ServersController@viewDetails',
|
2016-02-09 00:03:02 +01:00
|
|
|
]);
|
|
|
|
|
2016-01-04 22:09:39 +01:00
|
|
|
$router->post('/view/{id}/details', [
|
2017-03-05 01:03:49 +01:00
|
|
|
'uses' => 'Admin\ServersController@setDetails',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->post('/view/{id}/details/container', [
|
|
|
|
'as' => 'admin.servers.view.details.container',
|
|
|
|
'uses' => 'Admin\ServersController@setContainer',
|
2016-09-18 02:14:36 +02:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->get('/view/{id}/build', [
|
|
|
|
'as' => 'admin.servers.view.build',
|
|
|
|
'uses' => 'Admin\ServersController@viewBuild',
|
2016-01-11 00:57:22 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->post('/view/{id}/build', [
|
|
|
|
'uses' => 'Admin\ServersController@updateBuild',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->get('/view/{id}/startup', [
|
|
|
|
'as' => 'admin.servers.view.startup',
|
|
|
|
'uses' => 'Admin\ServersController@viewStartup',
|
|
|
|
]);
|
|
|
|
|
2017-03-05 05:45:22 +01:00
|
|
|
$router->post('/view/{id}/startup', [
|
|
|
|
'uses' => 'Admin\ServersController@saveStartup',
|
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->get('/view/{id}/database', [
|
|
|
|
'as' => 'admin.servers.view.database',
|
|
|
|
'uses' => 'Admin\ServersController@viewDatabase',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
2015-12-11 00:30:47 +01:00
|
|
|
|
2017-03-05 22:37:38 +01:00
|
|
|
$router->post('/view/{id}/database', [
|
|
|
|
'uses' => 'Admin\ServersController@newDatabase',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->patch('/view/{id}/database', [
|
|
|
|
'uses' => 'Admin\ServersController@resetDatabasePassword',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->delete('/view/{id}/database/{database}/delete', [
|
|
|
|
'as' => 'admin.servers.view.database.delete',
|
|
|
|
'uses' => 'Admin\ServersController@deleteDatabase',
|
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->get('/view/{id}/manage', [
|
|
|
|
'as' => 'admin.servers.view.manage',
|
|
|
|
'uses' => 'Admin\ServersController@viewManage',
|
2016-09-02 03:16:38 +02:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->post('/view/{id}/manage/toggle', [
|
|
|
|
'as' => 'admin.servers.view.manage.toggle',
|
|
|
|
'uses' => 'Admin\ServersController@toggleInstall',
|
2016-09-02 03:16:38 +02:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->post('/view/{id}/manage/rebuild', [
|
|
|
|
'as' => 'admin.servers.view.manage.rebuild',
|
|
|
|
'uses' => 'Admin\ServersController@rebuildContainer',
|
2016-01-04 22:09:22 +01:00
|
|
|
]);
|
2015-12-07 06:47:19 +01:00
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->post('/view/{id}/manage/suspension', [
|
|
|
|
'as' => 'admin.servers.view.manage.suspension',
|
|
|
|
'uses' => 'Admin\ServersController@manageSuspension',
|
2016-01-04 22:09:39 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-05 01:03:49 +01:00
|
|
|
$router->get('/view/{id}/delete', [
|
|
|
|
'as' => 'admin.servers.view.delete',
|
|
|
|
'uses' => 'Admin\ServersController@viewDelete',
|
2016-10-28 02:05:29 +02:00
|
|
|
]);
|
2017-03-05 01:03:49 +01:00
|
|
|
|
|
|
|
$router->post('/view/{id}/delete', [
|
|
|
|
'uses' => 'Admin\ServersController@delete',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/view/{id}/delete/continue/{force?}', [
|
|
|
|
'as' => 'admin.servers.view.delete.continue',
|
|
|
|
'uses' => 'Admin\ServersController@continueDeletion',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/view/{id}/delete/cancel', [
|
|
|
|
'as' => 'admin.servers.view.delete.cancel',
|
|
|
|
'uses' => 'Admin\ServersController@cancelDeletion',
|
|
|
|
]);
|
2015-12-06 19:58:49 +01:00
|
|
|
});
|
2016-01-04 22:09:39 +01:00
|
|
|
|
2016-01-05 05:59:45 +01:00
|
|
|
// Node Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/nodes',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 03:50:43 +01:00
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-05 05:59:45 +01:00
|
|
|
], function () use ($router) {
|
|
|
|
|
|
|
|
// View All Nodes
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.nodes',
|
2017-03-04 05:37:41 +01:00
|
|
|
'uses' => 'Admin\NodesController@index',
|
2016-01-05 05:59:45 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Add New Node
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.nodes.new',
|
2017-03-04 05:37:41 +01:00
|
|
|
'uses' => 'Admin\NodesController@new',
|
2016-01-05 05:59:45 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/new', [
|
2017-03-04 05:37:41 +01:00
|
|
|
'uses' => 'Admin\NodesController@create',
|
2016-01-05 05:59:45 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->get('/view/{id}', [
|
2016-01-05 05:59:45 +01:00
|
|
|
'as' => 'admin.nodes.view',
|
2017-03-03 23:30:39 +01:00
|
|
|
'uses' => 'Admin\NodesController@viewIndex',
|
2016-01-05 05:59:45 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->get('/view/{id}/settings', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.settings',
|
|
|
|
'uses' => 'Admin\NodesController@viewSettings',
|
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->post('/view/{id}/settings', [
|
|
|
|
'uses' => 'Admin\NodesController@updateSettings',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->get('/view/{id}/configuration', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.configuration',
|
|
|
|
'uses' => 'Admin\NodesController@viewConfiguration',
|
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->get('/view/{id}/allocation', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.allocation',
|
|
|
|
'uses' => 'Admin\NodesController@viewAllocation',
|
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->post('/view/{id}/allocation', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'uses' => 'Admin\NodesController@createAllocation',
|
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->get('/view/{id}/servers', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.servers',
|
|
|
|
'uses' => 'Admin\NodesController@viewServers',
|
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->delete('/view/{id}/delete', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.delete',
|
2017-03-04 05:14:23 +01:00
|
|
|
'uses' => 'Admin\NodesController@delete',
|
2016-01-06 00:31:25 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->delete('/view/{id}/allocation/remove/{allocation}', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.allocation.removeSingle',
|
|
|
|
'uses' => 'Admin\NodesController@allocationRemoveSingle',
|
2016-09-30 03:34:20 +02:00
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->post('/view/{id}/allocation/remove', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.allocation.removeBlock',
|
|
|
|
'uses' => 'Admin\NodesController@allocationRemoveBlock',
|
2016-09-30 03:34:20 +02:00
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->post('/view/{id}/allocation/alias', [
|
2017-03-03 23:30:39 +01:00
|
|
|
'as' => 'admin.nodes.view.allocation.setAlias',
|
|
|
|
'uses' => 'Admin\NodesController@allocationSetAlias',
|
2016-01-10 06:38:16 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-04 05:14:23 +01:00
|
|
|
$router->get('/view/{id}/settings/token', [
|
|
|
|
'as' => 'admin.nodes.view.configuration.token',
|
|
|
|
'uses' => 'Admin\NodesController@setToken',
|
2017-01-07 18:10:11 +01:00
|
|
|
]);
|
2016-01-05 05:59:45 +01:00
|
|
|
});
|
|
|
|
|
2016-01-16 07:20:27 +01:00
|
|
|
// Location Routes
|
2016-01-11 01:22:21 +01:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/locations',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 03:50:43 +01:00
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-11 01:22:21 +01:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.locations',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\LocationsController@getIndex',
|
2016-01-11 01:22:21 +01:00
|
|
|
]);
|
2016-01-17 04:29:35 +01:00
|
|
|
$router->delete('/{id}', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\LocationsController@deleteLocation',
|
2016-01-17 04:29:35 +01:00
|
|
|
]);
|
2016-01-17 04:57:28 +01:00
|
|
|
$router->patch('/{id}', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\LocationsController@patchLocation',
|
2016-01-17 04:57:28 +01:00
|
|
|
]);
|
|
|
|
$router->post('/', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\LocationsController@postLocation',
|
2016-01-17 04:57:28 +01:00
|
|
|
]);
|
2016-01-11 01:22:21 +01:00
|
|
|
});
|
|
|
|
|
2016-02-13 06:18:32 +01:00
|
|
|
// Database Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/databases',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-02-13 06:18:32 +01:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.databases',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\DatabaseController@getIndex',
|
2016-02-13 06:18:32 +01:00
|
|
|
]);
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.databases.new',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\DatabaseController@getNew',
|
2016-02-13 06:18:32 +01:00
|
|
|
]);
|
|
|
|
$router->post('/new', [
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\DatabaseController@postNew',
|
2016-02-13 06:18:32 +01:00
|
|
|
]);
|
2016-02-15 03:43:20 +01:00
|
|
|
$router->delete('/delete/{id}', [
|
|
|
|
'as' => 'admin.databases.delete',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\DatabaseController@deleteDatabase',
|
2016-02-15 03:43:20 +01:00
|
|
|
]);
|
|
|
|
$router->delete('/delete-server/{id}', [
|
|
|
|
'as' => 'admin.databases.delete-server',
|
2016-12-07 23:46:38 +01:00
|
|
|
'uses' => 'Admin\DatabaseController@deleteServer',
|
2016-02-15 03:43:20 +01:00
|
|
|
]);
|
2016-02-13 06:18:32 +01:00
|
|
|
});
|
|
|
|
|
2016-02-15 21:21:28 +01:00
|
|
|
// Service Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/services',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-07 23:46:38 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-02-15 21:21:28 +01:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.services',
|
2017-03-11 00:25:12 +01:00
|
|
|
'uses' => 'Admin\ServiceController@index',
|
2016-02-15 21:21:28 +01:00
|
|
|
]);
|
|
|
|
|
2016-02-20 22:02:49 +01:00
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.services.new',
|
2017-03-11 00:25:12 +01:00
|
|
|
'uses' => 'Admin\ServiceController@new',
|
2016-02-20 22:02:49 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/new', [
|
2017-03-11 00:25:12 +01:00
|
|
|
'uses' => 'Admin\ServiceController@create',
|
2016-02-20 22:02:49 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-11 00:25:12 +01:00
|
|
|
$router->get('/view/{id}', [
|
|
|
|
'as' => 'admin.services.view',
|
|
|
|
'uses' => 'Admin\ServiceController@view',
|
2016-02-20 22:23:04 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-12 20:59:17 +01:00
|
|
|
$router->post('/view/{id}', 'Admin\ServiceController@edit');
|
|
|
|
|
|
|
|
$router->get('/view/{id}/functions', [
|
|
|
|
'as' => 'admin.services.view.functions',
|
|
|
|
'uses' => 'Admin\ServiceController@viewFunctions',
|
2016-11-09 23:58:14 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-11 00:25:12 +01:00
|
|
|
$router->delete('/view/{id}', [
|
|
|
|
'uses' => 'Admin\ServiceController@delete',
|
2016-11-09 23:58:14 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-11 00:25:12 +01:00
|
|
|
// ---------------------
|
|
|
|
// Service Option Routes
|
|
|
|
// ---------------------
|
|
|
|
$router->get('/option/new', [
|
2016-02-20 22:45:13 +01:00
|
|
|
'as' => 'admin.services.option.new',
|
2017-03-11 00:25:12 +01:00
|
|
|
'uses' => 'Admin\OptionController@new',
|
2016-02-15 21:21:28 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-12 06:00:06 +01:00
|
|
|
$router->post('/option/new', 'Admin\OptionController@create');
|
|
|
|
|
2017-03-11 00:25:12 +01:00
|
|
|
$router->get('/option/{id}', [
|
|
|
|
'as' => 'admin.services.option.view',
|
|
|
|
'uses' => 'Admin\OptionController@viewConfiguration',
|
2016-02-20 22:55:05 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-12 21:28:38 +01:00
|
|
|
$router->post('/option/{id}', 'Admin\OptionController@editConfiguration');
|
|
|
|
|
2017-03-11 00:25:12 +01:00
|
|
|
$router->get('/option/{id}/variables', [
|
2017-03-12 06:00:06 +01:00
|
|
|
'as' => 'admin.services.option.variables',
|
2017-03-11 00:25:12 +01:00
|
|
|
'uses' => 'Admin\OptionController@viewVariables',
|
2016-02-21 06:38:03 +01:00
|
|
|
]);
|
|
|
|
|
2017-03-12 21:28:38 +01:00
|
|
|
$router->post('/option/{id}/variables', 'Admin\OptionController@createVariable');
|
|
|
|
|
2017-03-12 06:00:06 +01:00
|
|
|
$router->post('/option/{id}/variables/{variable}', [
|
|
|
|
'as' => 'admin.services.option.variables.edit',
|
|
|
|
'uses' => 'Admin\OptionController@editVariable',
|
2016-02-21 06:38:03 +01:00
|
|
|
]);
|
2016-02-15 21:21:28 +01:00
|
|
|
});
|
|
|
|
|
2016-11-16 02:20:32 +01:00
|
|
|
// Service Packs
|
|
|
|
$router->group([
|
2017-03-11 00:25:12 +01:00
|
|
|
'prefix' => 'admin/packs',
|
2016-11-16 02:20:32 +01:00
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-14 22:56:25 +01:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-11-16 02:20:32 +01:00
|
|
|
], function () use ($router) {
|
2016-11-16 05:12:47 +01:00
|
|
|
$router->get('/', [
|
2017-03-11 00:25:12 +01:00
|
|
|
'as' => 'admin.packs',
|
2017-03-15 02:18:36 +01:00
|
|
|
'uses' => 'Admin\PackController@index',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.packs.new',
|
|
|
|
'uses' => 'Admin\PackController@new',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/new', 'Admin\PackController@create');
|
|
|
|
|
|
|
|
$router->get('/new/template', [
|
|
|
|
'as' => 'admin.packs.new.template',
|
|
|
|
'uses' => 'Admin\PackController@newTemplate',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->get('/view/{id}', [
|
|
|
|
'as' => 'admin.packs.view',
|
|
|
|
'uses' => 'Admin\PackController@view',
|
|
|
|
]);
|
2016-11-16 02:20:32 +01:00
|
|
|
});
|
2015-12-06 19:58:49 +01:00
|
|
|
}
|
|
|
|
}
|