2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
2016-01-20 00:10:39 +00:00
|
|
|
/**
|
2016-01-20 21:05:16 +00:00
|
|
|
* Pterodactyl - Panel
|
2016-01-20 00:10:39 +00:00
|
|
|
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>
|
2016-12-07 22:46:38 +00:00
|
|
|
* Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com>.
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00: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 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00: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 00:10:39 +00:00
|
|
|
*/
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
namespace Pterodactyl\Http\Routes;
|
|
|
|
|
|
|
|
use Illuminate\Routing\Router;
|
|
|
|
|
2016-12-07 22:46:38 +00:00
|
|
|
class AdminRoutes
|
|
|
|
{
|
|
|
|
public function map(Router $router)
|
|
|
|
{
|
2015-12-06 18:58:49 +00:00
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// Admin Index
|
|
|
|
$router->get('admin', [
|
|
|
|
'as' => 'admin.index',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 02:50:43 +00:00
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
2016-01-04 21:09:39 +00:00
|
|
|
],
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\BaseController@getIndex',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
2015-12-12 06:21:17 +00:00
|
|
|
|
2016-01-21 03:08:09 +00:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/settings',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-21 03:08:09 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.settings',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\BaseController@getSettings',
|
2016-01-21 03:08:09 +00:00
|
|
|
]);
|
|
|
|
$router->post('/', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\BaseController@postSettings',
|
2016-01-21 03:08:09 +00:00
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->group([
|
2016-02-21 06:15:37 +00:00
|
|
|
'prefix' => 'admin/users',
|
2016-01-04 21:09:39 +00:00
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 02:50:43 +00:00
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-04 21:09:39 +00:00
|
|
|
], function () use ($router) {
|
2016-01-02 05:25:41 +00:00
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// View All Accounts on System
|
|
|
|
$router->get('/', [
|
2016-02-21 06:15:37 +00:00
|
|
|
'as' => 'admin.users',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@getIndex',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
2016-10-21 19:22:47 +00:00
|
|
|
$router->get('/accounts.json', [
|
|
|
|
'as' => 'admin.users.json',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@getJson',
|
2016-10-21 19:22:47 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// View Specific Account
|
|
|
|
$router->get('/view/{id}', [
|
2016-02-21 06:15:37 +00:00
|
|
|
'as' => 'admin.users.view',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@getView',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 06:15:37 +00:00
|
|
|
// View Specific Account
|
|
|
|
$router->post('/view/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@updateUser',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
2016-01-02 05:25:41 +00:00
|
|
|
|
2016-02-21 06:15:37 +00:00
|
|
|
// Delete an Account Matching an ID
|
|
|
|
$router->delete('/view/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@deleteUser',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
2015-12-06 18:58:49 +00:00
|
|
|
|
2016-02-21 06:15:37 +00:00
|
|
|
// Show Create Account Page
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.users.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@getNew',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
2015-12-10 23:30:47 +00:00
|
|
|
|
2016-02-21 06:15:37 +00:00
|
|
|
// Handle Creating New Account
|
|
|
|
$router->post('/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\UserController@postNew',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Server Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/servers',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 02:50:43 +00:00
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-04 21:09:39 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
|
|
|
|
// View All Servers
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.servers',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@getIndex', ]);
|
2016-01-04 21:09:39 +00:00
|
|
|
|
|
|
|
// View Create Server Page
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.servers.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@getNew',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Handle POST Request for Creating Server
|
|
|
|
$router->post('/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postNewServer',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
2016-01-02 23:04:18 +00:00
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// Assorted Page Helpers
|
2016-09-02 01:16:38 +00:00
|
|
|
$router->post('/new/get-nodes', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postNewServerGetNodes',
|
2016-09-02 01:16:38 +00:00
|
|
|
]);
|
2016-01-04 21:09:39 +00:00
|
|
|
|
2016-09-02 01:16:38 +00:00
|
|
|
$router->post('/new/get-ips', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postNewServerGetIps',
|
2016-09-02 01:16:38 +00:00
|
|
|
]);
|
2016-01-04 21:09:39 +00:00
|
|
|
|
2016-09-02 01:16:38 +00:00
|
|
|
$router->post('/new/service-options', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postNewServerServiceOptions',
|
2016-09-02 01:16:38 +00:00
|
|
|
]);
|
2016-01-04 21:09:39 +00:00
|
|
|
|
2016-11-27 19:30:44 +00:00
|
|
|
$router->post('/new/option-details', [
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\ServersController@postNewServerOptionDetails',
|
2016-09-02 01:16:38 +00:00
|
|
|
]);
|
2016-01-04 21:09:39 +00:00
|
|
|
// End Assorted Page Helpers
|
|
|
|
|
|
|
|
// View Specific Server
|
|
|
|
$router->get('/view/{id}', [
|
|
|
|
'as' => 'admin.servers.view',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@getView',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-08 23:03:02 +00:00
|
|
|
// Database Stuffs
|
|
|
|
$router->post('/view/{id}/database', [
|
|
|
|
'as' => 'admin.servers.database',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postDatabase',
|
2016-02-08 23:03:02 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// Change Server Details
|
|
|
|
$router->post('/view/{id}/details', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postUpdateServerDetails',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
2016-09-18 00:14:36 +00:00
|
|
|
// Change Server Details
|
|
|
|
$router->post('/view/{id}/container', [
|
|
|
|
'as' => 'admin.servers.post.container',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postUpdateContainerDetails',
|
2016-09-18 00:14:36 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-10 23:57:22 +00:00
|
|
|
// Change Server Details
|
|
|
|
$router->post('/view/{id}/startup', [
|
|
|
|
'as' => 'admin.servers.post.startup',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postUpdateServerStartup',
|
2016-01-10 23:57:22 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// Rebuild Server
|
|
|
|
$router->post('/view/{id}/rebuild', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postUpdateServerToggleBuild',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Change Build Details
|
|
|
|
$router->post('/view/{id}/build', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postUpdateServerUpdateBuild',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
2015-12-10 23:30:47 +00:00
|
|
|
|
2016-09-02 01:16:38 +00:00
|
|
|
// Suspend Server
|
|
|
|
$router->post('/view/{id}/suspend', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postSuspendServer',
|
2016-09-02 01:16:38 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Unsuspend Server
|
|
|
|
$router->post('/view/{id}/unsuspend', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postUnsuspendServer',
|
2016-09-02 01:16:38 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-04 21:09:22 +00:00
|
|
|
// Change Install Status
|
|
|
|
$router->post('/view/{id}/installed', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@postToggleInstall',
|
2016-01-04 21:09:22 +00:00
|
|
|
]);
|
2015-12-07 05:47:19 +00:00
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// Delete [force delete]
|
|
|
|
$router->delete('/view/{id}/{force?}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServersController@deleteServer',
|
2016-01-04 21:09:39 +00:00
|
|
|
]);
|
|
|
|
|
2016-10-28 00:05:29 +00:00
|
|
|
$router->post('/view/{id}/queuedDeletion', [
|
|
|
|
'uses' => 'Admin\ServersController@postQueuedDeletionHandler',
|
2016-12-07 22:46:38 +00:00
|
|
|
'as' => 'admin.servers.post.queuedDeletion',
|
2016-10-28 00:05:29 +00:00
|
|
|
]);
|
2015-12-06 18:58:49 +00:00
|
|
|
});
|
2016-01-04 21:09:39 +00:00
|
|
|
|
2016-01-05 04:59:45 +00:00
|
|
|
// Node Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/nodes',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 02:50:43 +00:00
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-05 04:59:45 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
|
|
|
|
// View All Nodes
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.nodes',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@getIndex',
|
2016-01-05 04:59:45 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Add New Node
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.nodes.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@getNew',
|
2016-01-05 04:59:45 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@postNew',
|
2016-01-05 04:59:45 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
// View Node
|
|
|
|
$router->get('/view/{id}', [
|
|
|
|
'as' => 'admin.nodes.view',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@getView',
|
2016-01-05 04:59:45 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-05 23:31:25 +00:00
|
|
|
$router->post('/view/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@postView',
|
2016-01-05 23:31:25 +00:00
|
|
|
]);
|
|
|
|
|
2016-09-30 01:34:20 +00:00
|
|
|
$router->delete('/view/{id}/deallocate/single/{allocation}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@deallocateSingle',
|
2016-09-30 01:34:20 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/view/{id}/deallocate/block', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@deallocateBlock',
|
2016-09-30 01:34:20 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/view/{id}/alias', [
|
|
|
|
'as' => 'admin.nodes.alias',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@setAlias',
|
2016-01-10 05:38:16 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->get('/view/{id}/allocations.json', [
|
|
|
|
'as' => 'admin.nodes.view.allocations',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@getAllocationsJson',
|
2016-01-10 05:38:16 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/view/{id}/allocations', [
|
|
|
|
'as' => 'admin.nodes.post.allocations',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@postAllocations',
|
2016-01-09 01:01:18 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-06 04:41:16 +00:00
|
|
|
// View Deploy
|
|
|
|
$router->get('/view/{id}/deploy', [
|
|
|
|
'as' => 'admin.nodes.deply',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@getScript',
|
2016-02-06 04:41:16 +00:00
|
|
|
]);
|
|
|
|
|
2016-01-10 21:59:19 +00:00
|
|
|
$router->delete('/view/{id}', [
|
|
|
|
'as' => 'admin.nodes.delete',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\NodesController@deleteNode',
|
2016-01-10 21:59:19 +00:00
|
|
|
]);
|
2016-01-05 04:59:45 +00:00
|
|
|
});
|
|
|
|
|
2016-01-16 06:20:27 +00:00
|
|
|
// Location Routes
|
2016-01-11 00:22:21 +00:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/locations',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
2016-01-13 02:50:43 +00:00
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-01-11 00:22:21 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.locations',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\LocationsController@getIndex',
|
2016-01-11 00:22:21 +00:00
|
|
|
]);
|
2016-01-17 03:29:35 +00:00
|
|
|
$router->delete('/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\LocationsController@deleteLocation',
|
2016-01-17 03:29:35 +00:00
|
|
|
]);
|
2016-01-17 03:57:28 +00:00
|
|
|
$router->patch('/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\LocationsController@patchLocation',
|
2016-01-17 03:57:28 +00:00
|
|
|
]);
|
|
|
|
$router->post('/', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\LocationsController@postLocation',
|
2016-01-17 03:57:28 +00:00
|
|
|
]);
|
2016-01-11 00:22:21 +00:00
|
|
|
});
|
|
|
|
|
2016-02-13 05:18:32 +00:00
|
|
|
// Database Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/databases',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-02-13 05:18:32 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.databases',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\DatabaseController@getIndex',
|
2016-02-13 05:18:32 +00:00
|
|
|
]);
|
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.databases.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\DatabaseController@getNew',
|
2016-02-13 05:18:32 +00:00
|
|
|
]);
|
|
|
|
$router->post('/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\DatabaseController@postNew',
|
2016-02-13 05:18:32 +00:00
|
|
|
]);
|
2016-02-15 02:43:20 +00:00
|
|
|
$router->delete('/delete/{id}', [
|
|
|
|
'as' => 'admin.databases.delete',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\DatabaseController@deleteDatabase',
|
2016-02-15 02:43:20 +00:00
|
|
|
]);
|
|
|
|
$router->delete('/delete-server/{id}', [
|
|
|
|
'as' => 'admin.databases.delete-server',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\DatabaseController@deleteServer',
|
2016-02-15 02:43:20 +00:00
|
|
|
]);
|
2016-02-13 05:18:32 +00:00
|
|
|
});
|
|
|
|
|
2016-02-15 20:21:28 +00:00
|
|
|
// Service Routes
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/services',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-07 22:46:38 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-02-15 20:21:28 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.services',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@getIndex',
|
2016-02-15 20:21:28 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-20 21:02:49 +00:00
|
|
|
$router->get('/new', [
|
|
|
|
'as' => 'admin.services.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@getNew',
|
2016-02-20 21:02:49 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postNew',
|
2016-02-20 21:02:49 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-15 20:21:28 +00:00
|
|
|
$router->get('/service/{id}', [
|
|
|
|
'as' => 'admin.services.service',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@getService',
|
2016-02-15 20:21:28 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/service/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postService',
|
2016-02-15 20:21:28 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-20 21:23:04 +00:00
|
|
|
$router->delete('/service/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@deleteService',
|
2016-02-20 21:23:04 +00:00
|
|
|
]);
|
|
|
|
|
2016-11-09 22:58:14 +00:00
|
|
|
$router->get('/service/{id}/configuration', [
|
|
|
|
'as' => 'admin.services.service.config',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\ServiceController@getConfiguration',
|
2016-11-09 22:58:14 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/service/{id}/configuration', [
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postConfiguration',
|
2016-11-09 22:58:14 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:07:03 +00:00
|
|
|
$router->get('/service/{service}/option/new', [
|
2016-02-20 21:45:13 +00:00
|
|
|
'as' => 'admin.services.option.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@newOption',
|
2016-02-20 21:45:13 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:07:03 +00:00
|
|
|
$router->post('/service/{service}/option/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postNewOption',
|
2016-02-20 21:45:13 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:07:03 +00:00
|
|
|
$router->get('/service/{service}/option/{option}', [
|
2016-02-15 20:21:28 +00:00
|
|
|
'as' => 'admin.services.option',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@getOption',
|
2016-02-15 20:21:28 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:07:03 +00:00
|
|
|
$router->post('/service/{service}/option/{option}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postOption',
|
2016-02-15 20:21:28 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:07:03 +00:00
|
|
|
$router->delete('/service/{service}/option/{id}', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@deleteOption',
|
2016-02-20 21:55:05 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:38:03 +00:00
|
|
|
$router->get('/service/{service}/option/{option}/variable/new', [
|
|
|
|
'as' => 'admin.services.option.variable.new',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@getNewVariable',
|
2016-02-21 05:38:03 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('/service/{service}/option/{option}/variable/new', [
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postNewVariable',
|
2016-02-21 05:38:03 +00:00
|
|
|
]);
|
|
|
|
|
2016-02-21 05:07:03 +00:00
|
|
|
$router->post('/service/{service}/option/{option}/variable/{variable}', [
|
2016-02-15 20:21:28 +00:00
|
|
|
'as' => 'admin.services.option.variable',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@postOptionVariable',
|
2016-02-15 20:21:28 +00:00
|
|
|
]);
|
2016-02-21 05:38:03 +00:00
|
|
|
|
|
|
|
$router->get('/service/{service}/option/{option}/variable/{variable}/delete', [
|
|
|
|
'as' => 'admin.services.option.variable.delete',
|
2016-12-07 22:46:38 +00:00
|
|
|
'uses' => 'Admin\ServiceController@deleteVariable',
|
2016-02-21 05:38:03 +00:00
|
|
|
]);
|
2016-02-15 20:21:28 +00:00
|
|
|
});
|
|
|
|
|
2016-11-16 01:20:32 +00:00
|
|
|
// Service Packs
|
|
|
|
$router->group([
|
|
|
|
'prefix' => 'admin/services/packs',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'admin',
|
2016-12-14 21:56:25 +00:00
|
|
|
'csrf',
|
|
|
|
],
|
2016-11-16 01:20:32 +00:00
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/new/{option?}', [
|
|
|
|
'as' => 'admin.services.packs.new',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@new',
|
2016-11-16 01:20:32 +00:00
|
|
|
]);
|
|
|
|
$router->post('/new', [
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@create',
|
2016-11-16 01:20:32 +00:00
|
|
|
]);
|
2016-11-16 22:22:22 +00:00
|
|
|
$router->get('/upload/{option?}', [
|
|
|
|
'as' => 'admin.services.packs.uploadForm',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@uploadForm',
|
2016-11-16 22:22:22 +00:00
|
|
|
]);
|
|
|
|
$router->post('/upload', [
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@postUpload',
|
2016-11-16 22:22:22 +00:00
|
|
|
]);
|
2016-11-16 04:12:47 +00:00
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'admin.services.packs',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@listAll',
|
2016-11-16 04:12:47 +00:00
|
|
|
]);
|
|
|
|
$router->get('/for/option/{option}', [
|
|
|
|
'as' => 'admin.services.packs.option',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@listByOption',
|
2016-11-16 04:12:47 +00:00
|
|
|
]);
|
|
|
|
$router->get('/for/service/{service}', [
|
|
|
|
'as' => 'admin.services.packs.service',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@listByService',
|
2016-11-16 01:20:32 +00:00
|
|
|
]);
|
|
|
|
$router->get('/edit/{pack}', [
|
|
|
|
'as' => 'admin.services.packs.edit',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@edit',
|
2016-11-16 01:20:32 +00:00
|
|
|
]);
|
2016-11-16 04:12:47 +00:00
|
|
|
$router->post('/edit/{pack}', [
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@update',
|
2016-11-16 04:12:47 +00:00
|
|
|
]);
|
|
|
|
$router->get('/edit/{pack}/export/{archive?}', [
|
|
|
|
'as' => 'admin.services.packs.export',
|
2016-12-14 21:56:25 +00:00
|
|
|
'uses' => 'Admin\PackController@export',
|
2016-11-16 04:12:47 +00:00
|
|
|
]);
|
2016-11-16 01:20:32 +00:00
|
|
|
});
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|
|
|
|
}
|