2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Routes;
|
|
|
|
|
|
|
|
use Illuminate\Routing\Router;
|
|
|
|
|
|
|
|
class ServerRoutes {
|
|
|
|
|
|
|
|
public function map(Router $router) {
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'server/{server}',
|
|
|
|
'middleware' => [
|
|
|
|
'auth',
|
|
|
|
'server'
|
|
|
|
]
|
|
|
|
], function ($server) use ($router) {
|
|
|
|
// Index View for Server
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'server.index',
|
|
|
|
'uses' => 'Server\ServerController@getIndex'
|
|
|
|
]);
|
2015-12-06 18:58:49 +00:00
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// File Manager Routes
|
|
|
|
$router->get('/files', [
|
|
|
|
'as' => 'files.index',
|
|
|
|
'uses' => 'Server\ServerController@getFiles'
|
|
|
|
]);
|
2015-12-06 18:58:49 +00:00
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->get('/files/edit/{file}', [
|
|
|
|
'as' => 'files.edit',
|
|
|
|
'uses' => 'Server\ServerController@getEditFile'
|
|
|
|
])->where('file', '.*');
|
|
|
|
|
|
|
|
$router->get('/files/download/{file}', [
|
|
|
|
'as' => 'files.download',
|
|
|
|
'uses' => 'Server\ServerController@getDownloadFile'
|
|
|
|
])->where('file', '.*');
|
|
|
|
|
|
|
|
$router->get('/files/add', [
|
|
|
|
'as' => 'files.add',
|
|
|
|
'uses' => 'Server\ServerController@getAddFile'
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Assorted AJAX Routes
|
2015-12-06 18:58:49 +00:00
|
|
|
$router->group(['prefix' => 'ajax'], function ($server) use ($router) {
|
2016-01-04 21:09:39 +00:00
|
|
|
// Returns Server Status
|
|
|
|
$router->get('status', [
|
|
|
|
'uses' => 'Server\AjaxController@getStatus'
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Sets the Default Connection for the Server
|
|
|
|
$router->post('set-connection', [
|
|
|
|
'uses' => 'Server\AjaxController@postSetConnection'
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Assorted File Manager URLs
|
|
|
|
$router->post('files/directory-list', [
|
|
|
|
'uses' => 'Server\AjaxController@postDirectoryList'
|
|
|
|
]);
|
|
|
|
|
|
|
|
$router->post('files/save', [
|
|
|
|
'uses' => 'Server\AjaxController@postSaveFile'
|
|
|
|
]);
|
2015-12-06 18:58:49 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|