Push updated server views
This commit is contained in:
parent
9a14cb5687
commit
e688468920
17 changed files with 1245 additions and 776 deletions
|
@ -7,12 +7,17 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
|||
### Changed
|
||||
* New theme applied to Admin CP. Many graphical changes were made, some data was moved around and some display data changed. Too much was changed to feasibly log it all in here. Major breaking changes or notable new features will be logged.
|
||||
* New server creation page now makes significantly less AJAX calls and is much quicker to respond.
|
||||
* Server and Node view pages wee modified to split tabs into individual pages to make re-themeing and modifications significantly easier, and reduce MySQL query loads on page.
|
||||
|
||||
### Fixed
|
||||
* Fixes potential bug with invalid CIDR notation (ex: `192.168.1.1/z`) when adding allocations that could cause over 4 million records to be created at once.
|
||||
|
||||
### Added
|
||||
* Ability to assign multiple allocations at once when creating a new server.
|
||||
|
||||
### Deprecated
|
||||
* Old API calls to `Server::create` will fail due to changed data structure.
|
||||
* Many old routes were modified to reflect new standards in panel, and many of the controller functions being called were also modified. This shouldn't really impact anyone unless you have been digging into the code and modifying things.
|
||||
|
||||
## v0.6.0-pre.4 (Courageous Carniadactylus)
|
||||
### Fixed
|
||||
|
|
|
@ -29,6 +29,7 @@ use Alert;
|
|||
use Javascript;
|
||||
use Pterodactyl\Models;
|
||||
use Illuminate\Http\Request;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Repositories\ServerRepository;
|
||||
|
@ -38,14 +39,12 @@ use Pterodactyl\Exceptions\DisplayValidationException;
|
|||
class ServersController extends Controller
|
||||
{
|
||||
/**
|
||||
* Controller Constructor.
|
||||
* Display the index page with all servers currently on the system.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function getIndex(Request $request)
|
||||
public function index(Request $request)
|
||||
{
|
||||
$servers = Models\Server::withTrashed()->with(
|
||||
'node', 'user', 'allocation'
|
||||
|
@ -60,7 +59,13 @@ class ServersController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function getNew(Request $request)
|
||||
/**
|
||||
* Display create new server page.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function new(Request $request)
|
||||
{
|
||||
$services = Models\Service::with('options.packs', 'options.variables')->get();
|
||||
Javascript::put([
|
||||
|
@ -77,55 +82,38 @@ class ServersController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function getView(Request $request, $id)
|
||||
{
|
||||
$server = Models\Server::withTrashed()->with(
|
||||
'user', 'option.variables', 'variables',
|
||||
'node.allocations', 'databases.host'
|
||||
)->findOrFail($id);
|
||||
|
||||
$server->option->variables->transform(function ($item, $key) use ($server) {
|
||||
$item->server_value = $server->variables->where('variable_id', $item->id)->pluck('variable_value')->first();
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
return view('admin.servers.view', [
|
||||
'server' => $server,
|
||||
'assigned' => $server->node->allocations->where('server_id', $server->id)->sortBy('port')->sortBy('ip'),
|
||||
'unassigned' => $server->node->allocations->where('server_id', null)->sortBy('port')->sortBy('ip'),
|
||||
'db_servers' => Models\DatabaseServer::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function postNewServer(Request $request)
|
||||
/**
|
||||
* Create server controller method.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function create(Request $request)
|
||||
{
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$response = $server->create($request->except('_token'));
|
||||
$repo = new ServerRepository;
|
||||
$server = $repo->create($request->except('_token'));
|
||||
|
||||
return redirect()->route('admin.servers.view', ['id' => $response->id]);
|
||||
return redirect()->route('admin.servers.view', $server->id);
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.servers.new')->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
|
||||
return redirect()->route('admin.servers.new')->withInput();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to add this server. Please try again.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers.new')->withInput();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.new')->withInput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JSON tree of all avaliable nodes in a given location.
|
||||
* Returns a tree of all avaliable nodes in a given location.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
* @param Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function postNewServerGetNodes(Request $request)
|
||||
public function newServerNodes(Request $request)
|
||||
{
|
||||
$nodes = Models\Node::with('allocations')->where('location_id', $request->input('location'))->get();
|
||||
|
||||
|
@ -149,263 +137,388 @@ class ServersController extends Controller
|
|||
})->values();
|
||||
}
|
||||
|
||||
public function postUpdateServerDetails(Request $request, $id)
|
||||
/**
|
||||
* Display the index when viewing a specific server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewIndex(Request $request, $id)
|
||||
{
|
||||
return view('admin.servers.view.index', ['server' => Models\Server::withTrashed()->findOrFail($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the details page when viewing a specific server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewDetails(Request $request, $id)
|
||||
{
|
||||
$server = Models\Server::where('installed', 1)->findOrFail($id);
|
||||
|
||||
return view('admin.servers.view.details', ['server' => $server]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the build details page when viewing a specific server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewBuild(Request $request, $id)
|
||||
{
|
||||
$server = Models\Server::where('installed', 1)->with('node.allocations')->findOrFail($id);
|
||||
|
||||
return view('admin.servers.view.build', [
|
||||
'server' => $server,
|
||||
'assigned' => $server->node->allocations->where('server_id', $server->id)->sortBy('port')->sortBy('ip'),
|
||||
'unassigned' => $server->node->allocations->where('server_id', null)->sortBy('port')->sortBy('ip'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display startup configuration page for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewStartup(Request $request, $id)
|
||||
{
|
||||
$server = Models\Server::where('installed', 1)->with('option.variables', 'variables')->findOrFail($id);
|
||||
$server->option->variables->transform(function ($item, $key) use ($server) {
|
||||
$item->server_value = $server->variables->where('variable_id', $item->id)->pluck('variable_value')->first();
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
return view('admin.servers.view.startup', ['server' => $server]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the database management page for a specific server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewDatabase(Request $request, $id)
|
||||
{
|
||||
$server = Models\Server::where('installed', 1)->with('databases.host')->findOrFail($id);
|
||||
|
||||
return view('admin.servers.view.build', ['server' => $server]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the management page when viewing a specific server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewManage(Request $request, $id)
|
||||
{
|
||||
return view('admin.servers.view.manage', ['server' => Models\Server::findOrFail($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the deletion page for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function viewDelete(Request $request, $id)
|
||||
{
|
||||
return view('admin.servers.view.delete', ['server' => Models\Server::withTrashed()->findOrFail($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the details for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function setDetails(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;;
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->updateDetails($id, $request->intersect([
|
||||
$repo->updateDetails($id, $request->intersect([
|
||||
'owner_id', 'name', 'reset_token',
|
||||
]));
|
||||
|
||||
Alert::success('Server details were successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_details',
|
||||
])->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
return redirect()->route('admin.servers.view.details', $id)->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to update this server. Please try again.')->flash();
|
||||
Alert::danger('An unhandled exception occured while attemping to update this server. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_details',
|
||||
])->withInput();
|
||||
return redirect()->route('admin.servers.view.details', $id)->withInput();
|
||||
}
|
||||
|
||||
public function postUpdateContainerDetails(Request $request, $id)
|
||||
/**
|
||||
* Set the new docker container for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function setContainer(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->updateContainer($id, $request->intersect('docker_image'));
|
||||
$repo->updateContainer($id, $request->intersect('docker_image'));
|
||||
|
||||
Alert::success('Successfully updated this server\'s docker image.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_details',
|
||||
])->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
return redirect()->route('admin.servers.view.details', $id)->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to update this server\'s docker image. Please try again.')->flash();
|
||||
Alert::danger('An unhandled exception occured while attemping to update this server\'s docker image. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_details',
|
||||
]);
|
||||
return redirect()->route('admin.servers.view.details', $id);
|
||||
}
|
||||
|
||||
public function postUpdateServerToggleBuild(Request $request, $id)
|
||||
/**
|
||||
* Toggles the install status for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function toggleInstall(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
try {
|
||||
$repo->toggleInstall($id);
|
||||
|
||||
Alert::success('Server install status was successfully toggled.')->flash();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to toggle this servers status. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view.manage', $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup a server to have a container rebuild.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function rebuildContainer(Request $request, $id)
|
||||
{
|
||||
$server = Models\Server::with('node')->findOrFail($id);
|
||||
|
||||
try {
|
||||
$res = $server->node->guzzleClient([
|
||||
$server->node->guzzleClient([
|
||||
'X-Access-Server' => $server->uuid,
|
||||
'X-Access-Token' => $server->node->daemonSecret,
|
||||
])->request('POST', '/server/rebuild');
|
||||
|
||||
Alert::success('A rebuild has been queued successfully. It will run the next time this server is booted.')->flash();
|
||||
} catch (\GuzzleHttp\Exception\TransferException $ex) {
|
||||
} catch (TransferException $ex) {
|
||||
Log::warning($ex);
|
||||
Alert::danger('An error occured while attempting to toggle a rebuild.')->flash();
|
||||
Alert::danger('A TransferException was encountered while trying to contact the daemon, please ensure it is online and accessible. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_manage',
|
||||
]);
|
||||
return redirect()->route('admin.servers.view.manage', $id);
|
||||
}
|
||||
|
||||
public function postUpdateServerUpdateBuild(Request $request, $id)
|
||||
/**
|
||||
* Manage the suspension status for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function manageSuspension(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
$action = $request->input('action');
|
||||
|
||||
if (! in_array($action, ['suspend', 'unsuspend'])) {
|
||||
Alert::danger('Invalid action was passed to function.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers.view.manage', $id);
|
||||
}
|
||||
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->changeBuild($id, $request->intersect([
|
||||
'allocation_id', 'add_allocations',
|
||||
'remove_allocations', 'memory',
|
||||
'swap', 'io', 'cpu',
|
||||
]));
|
||||
Alert::success('Server details were successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_build',
|
||||
])->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
$repo->$action($id);
|
||||
|
||||
Alert::success('Server has been ' . $action . 'ed.');
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_build',
|
||||
]);
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to add this server. Please try again.')->flash();
|
||||
Alert::danger('An unhandled exception occured while attemping to ' . $action . ' this server. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_build',
|
||||
]);
|
||||
return redirect()->route('admin.servers.view.manage', $id);
|
||||
}
|
||||
|
||||
public function deleteServer(Request $request, $id, $force = null)
|
||||
/**
|
||||
* Update the build configuration for a server.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function updateBuild(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->deleteServer($id, $force);
|
||||
$repo->changeBuild($id, $request->intersect([
|
||||
'allocation_id', 'add_allocations', 'remove_allocations',
|
||||
'memory', 'swap', 'io', 'cpu',
|
||||
]));
|
||||
|
||||
Alert::success('Server details were successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.servers.view.build', $id)->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to add this server. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view.build', $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the server deletion process.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function delete(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
|
||||
try {
|
||||
$repo->queueDeletion($id, ($request->input('is_force') > 0));
|
||||
Alert::success('Server has been marked for deletion on the system.')->flash();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to delete this server. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view.delete', $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a pending server deletion request.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function cancelDeletion(Request $request, $id)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
|
||||
$repo->cancelDeletion($id);
|
||||
Alert::success('Server deletion has been cancelled. This server will remain suspended until you unsuspend it.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers.view.delete', $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips the queue and continues the server deletion process.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Response\RedirectResponse
|
||||
*/
|
||||
public function continueDeletion(Request $request, $id, $method)
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
|
||||
try {
|
||||
$repo->delete($id, (isset($method) && $method === 'force'));
|
||||
Alert::success('Server was successfully deleted from the system.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers');
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (TransferException $ex) {
|
||||
Log::warning($ex);
|
||||
Alert::danger('A TransferException occurred while attempting to delete this server from the daemon, please ensure it is running. This error has been logged.')->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to delete this server. Please try again.')->flash();
|
||||
Alert::danger('An unhandled exception occured while attemping to delete this server. This error has been logged.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_delete',
|
||||
]);
|
||||
return redirect()->route('admin.servers.view.delete', $id);
|
||||
}
|
||||
|
||||
public function postToggleInstall(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->toggleInstall($id);
|
||||
Alert::success('Server status was successfully toggled.')->flash();
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled exception occured while attemping to toggle this servers status.')->flash();
|
||||
} finally {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_manage',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function postUpdateServerStartup(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->updateStartup($id, $request->except([
|
||||
'_token',
|
||||
]), true);
|
||||
Alert::success('Server startup variables were successfully updated.')->flash();
|
||||
} catch (\Pterodactyl\Exceptions\DisplayException $e) {
|
||||
Alert::danger($e->getMessage())->flash();
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e);
|
||||
Alert::danger('An unhandled exception occured while attemping to update startup variables for this server. Please try again.')->flash();
|
||||
} finally {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_startup',
|
||||
])->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function postDatabase(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$repo = new DatabaseRepository;
|
||||
$repo->create($id, $request->only([
|
||||
'db_server', 'database', 'remote',
|
||||
]));
|
||||
Alert::success('Added new database to this server.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_database',
|
||||
])->withInput()->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An exception occured while attempting to add a new database for this server.')->flash();
|
||||
}
|
||||
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_database',
|
||||
])->withInput();
|
||||
}
|
||||
|
||||
public function postSuspendServer(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$repo = new ServerRepository;
|
||||
$repo->suspend($id);
|
||||
Alert::success('Server has been suspended on the system. All running processes have been stopped and will not be startable until it is un-suspended.');
|
||||
} catch (DisplayException $e) {
|
||||
Alert::danger($e->getMessage())->flash();
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e);
|
||||
Alert::danger('An unhandled exception occured while attemping to suspend this server. Please try again.')->flash();
|
||||
} finally {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_manage',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function postUnsuspendServer(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$repo = new ServerRepository;
|
||||
$repo->unsuspend($id);
|
||||
Alert::success('Server has been unsuspended on the system. Access has been re-enabled.');
|
||||
} catch (DisplayException $e) {
|
||||
Alert::danger($e->getMessage())->flash();
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e);
|
||||
Alert::danger('An unhandled exception occured while attemping to unsuspend this server. Please try again.')->flash();
|
||||
} finally {
|
||||
return redirect()->route('admin.servers.view', [
|
||||
'id' => $id,
|
||||
'tab' => 'tab_manage',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function postQueuedDeletionHandler(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$repo = new ServerRepository;
|
||||
if (! is_null($request->input('cancel'))) {
|
||||
$repo->cancelDeletion($id);
|
||||
Alert::success('Server deletion has been cancelled. This server will remain suspended until you unsuspend it.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers.view', $id);
|
||||
} elseif (! is_null($request->input('delete'))) {
|
||||
$repo->deleteNow($id);
|
||||
Alert::success('Server was successfully deleted from the system.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers');
|
||||
} elseif (! is_null($request->input('force_delete'))) {
|
||||
$repo->deleteNow($id, true);
|
||||
Alert::success('Server was successfully force deleted from the system.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers');
|
||||
}
|
||||
} catch (DisplayException $ex) {
|
||||
Alert::danger($ex->getMessage())->flash();
|
||||
|
||||
return redirect()->route('admin.servers.view', $id);
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
Alert::danger('An unhandled error occured while attempting to perform this action.')->flash();
|
||||
|
||||
return redirect()->route('admin.servers.view', $id);
|
||||
}
|
||||
}
|
||||
// //
|
||||
// public function postUpdateServerStartup(Request $request, $id)
|
||||
// {
|
||||
// try {
|
||||
// $server = new ServerRepository;
|
||||
// $server->updateStartup($id, $request->except([
|
||||
// '_token',
|
||||
// ]), true);
|
||||
// Alert::success('Server startup variables were successfully updated.')->flash();
|
||||
// } catch (\Pterodactyl\Exceptions\DisplayException $e) {
|
||||
// Alert::danger($e->getMessage())->flash();
|
||||
// } catch (\Exception $e) {
|
||||
// Log::error($e);
|
||||
// Alert::danger('An unhandled exception occured while attemping to update startup variables for this server. Please try again.')->flash();
|
||||
// } finally {
|
||||
// return redirect()->route('admin.servers.view', [
|
||||
// 'id' => $id,
|
||||
// 'tab' => 'tab_startup',
|
||||
// ])->withInput();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public function postDatabase(Request $request, $id)
|
||||
// {
|
||||
// try {
|
||||
// $repo = new DatabaseRepository;
|
||||
// $repo->create($id, $request->only([
|
||||
// 'db_server', 'database', 'remote',
|
||||
// ]));
|
||||
// Alert::success('Added new database to this server.')->flash();
|
||||
// } catch (DisplayValidationException $ex) {
|
||||
// return redirect()->route('admin.servers.view', [
|
||||
// 'id' => $id,
|
||||
// 'tab' => 'tab_database',
|
||||
// ])->withInput()->withErrors(json_decode($ex->getMessage()))->withInput();
|
||||
// } catch (\Exception $ex) {
|
||||
// Log::error($ex);
|
||||
// Alert::danger('An exception occured while attempting to add a new database for this server.')->flash();
|
||||
// }
|
||||
//
|
||||
// return redirect()->route('admin.servers.view', [
|
||||
// 'id' => $id,
|
||||
// 'tab' => 'tab_database',
|
||||
// ])->withInput();
|
||||
// }
|
||||
// //
|
||||
}
|
||||
|
|
|
@ -121,89 +121,103 @@ class AdminRoutes
|
|||
// View All Servers
|
||||
$router->get('/', [
|
||||
'as' => 'admin.servers',
|
||||
'uses' => 'Admin\ServersController@getIndex', ]);
|
||||
'uses' => 'Admin\ServersController@index',
|
||||
]);
|
||||
|
||||
// View Create Server Page
|
||||
$router->get('/new', [
|
||||
'as' => 'admin.servers.new',
|
||||
'uses' => 'Admin\ServersController@getNew',
|
||||
'uses' => 'Admin\ServersController@new',
|
||||
]);
|
||||
|
||||
// Handle POST Request for Creating Server
|
||||
$router->post('/new', [
|
||||
'uses' => 'Admin\ServersController@postNewServer',
|
||||
'uses' => 'Admin\ServersController@create',
|
||||
]);
|
||||
|
||||
// Assorted Page Helpers
|
||||
$router->post('/new/get-nodes', [
|
||||
'as' => 'admin.servers.new.get-nodes',
|
||||
'uses' => 'Admin\ServersController@postNewServerGetNodes',
|
||||
$router->post('/new/nodes', [
|
||||
'as' => 'admin.servers.new.nodes',
|
||||
'uses' => 'Admin\ServersController@newServerNodes',
|
||||
]);
|
||||
|
||||
// View Specific Server
|
||||
$router->get('/view/{id}', [
|
||||
'as' => 'admin.servers.view',
|
||||
'uses' => 'Admin\ServersController@getView',
|
||||
'uses' => 'Admin\ServersController@viewIndex',
|
||||
]);
|
||||
|
||||
// Database Stuffs
|
||||
$router->post('/view/{id}/database', [
|
||||
'as' => 'admin.servers.database',
|
||||
'uses' => 'Admin\ServersController@postDatabase',
|
||||
]);
|
||||
|
||||
// Change Server Details
|
||||
$router->post('/view/{id}/details', [
|
||||
$router->get('/view/{id}/details', [
|
||||
'as' => 'admin.servers.view.details',
|
||||
'uses' => 'Admin\ServersController@postUpdateServerDetails',
|
||||
'uses' => 'Admin\ServersController@viewDetails',
|
||||
]);
|
||||
|
||||
// Change Server Details
|
||||
$router->post('/view/{id}/container', [
|
||||
'as' => 'admin.servers.post.container',
|
||||
'uses' => 'Admin\ServersController@postUpdateContainerDetails',
|
||||
$router->post('/view/{id}/details', [
|
||||
'uses' => 'Admin\ServersController@setDetails',
|
||||
]);
|
||||
|
||||
// Change Server Details
|
||||
$router->post('/view/{id}/startup', [
|
||||
'as' => 'admin.servers.post.startup',
|
||||
'uses' => 'Admin\ServersController@postUpdateServerStartup',
|
||||
$router->post('/view/{id}/details/container', [
|
||||
'as' => 'admin.servers.view.details.container',
|
||||
'uses' => 'Admin\ServersController@setContainer',
|
||||
]);
|
||||
|
||||
// Rebuild Server
|
||||
$router->post('/view/{id}/rebuild', [
|
||||
'uses' => 'Admin\ServersController@postUpdateServerToggleBuild',
|
||||
$router->get('/view/{id}/build', [
|
||||
'as' => 'admin.servers.view.build',
|
||||
'uses' => 'Admin\ServersController@viewBuild',
|
||||
]);
|
||||
|
||||
// Change Build Details
|
||||
$router->post('/view/{id}/build', [
|
||||
'uses' => 'Admin\ServersController@postUpdateServerUpdateBuild',
|
||||
'uses' => 'Admin\ServersController@updateBuild',
|
||||
]);
|
||||
|
||||
// Suspend Server
|
||||
$router->post('/view/{id}/suspend', [
|
||||
'uses' => 'Admin\ServersController@postSuspendServer',
|
||||
$router->get('/view/{id}/startup', [
|
||||
'as' => 'admin.servers.view.startup',
|
||||
'uses' => 'Admin\ServersController@viewStartup',
|
||||
]);
|
||||
|
||||
// Unsuspend Server
|
||||
$router->post('/view/{id}/unsuspend', [
|
||||
'uses' => 'Admin\ServersController@postUnsuspendServer',
|
||||
$router->get('/view/{id}/database', [
|
||||
'as' => 'admin.servers.view.database',
|
||||
'uses' => 'Admin\ServersController@viewDatabase',
|
||||
]);
|
||||
|
||||
// Change Install Status
|
||||
$router->post('/view/{id}/installed', [
|
||||
'uses' => 'Admin\ServersController@postToggleInstall',
|
||||
$router->get('/view/{id}/manage', [
|
||||
'as' => 'admin.servers.view.manage',
|
||||
'uses' => 'Admin\ServersController@viewManage',
|
||||
]);
|
||||
|
||||
// Delete [force delete]
|
||||
$router->delete('/view/{id}/{force?}', [
|
||||
'uses' => 'Admin\ServersController@deleteServer',
|
||||
$router->post('/view/{id}/manage/toggle', [
|
||||
'as' => 'admin.servers.view.manage.toggle',
|
||||
'uses' => 'Admin\ServersController@toggleInstall',
|
||||
]);
|
||||
|
||||
$router->post('/view/{id}/queuedDeletion', [
|
||||
'uses' => 'Admin\ServersController@postQueuedDeletionHandler',
|
||||
'as' => 'admin.servers.post.queuedDeletion',
|
||||
$router->post('/view/{id}/manage/rebuild', [
|
||||
'as' => 'admin.servers.view.manage.rebuild',
|
||||
'uses' => 'Admin\ServersController@rebuildContainer',
|
||||
]);
|
||||
|
||||
$router->post('/view/{id}/manage/suspension', [
|
||||
'as' => 'admin.servers.view.manage.suspension',
|
||||
'uses' => 'Admin\ServersController@manageSuspension',
|
||||
]);
|
||||
|
||||
$router->get('/view/{id}/delete', [
|
||||
'as' => 'admin.servers.view.delete',
|
||||
'uses' => 'Admin\ServersController@viewDelete',
|
||||
]);
|
||||
|
||||
$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',
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
// Node Routes
|
||||
|
|
|
@ -58,6 +58,6 @@ class DeleteServer extends Job implements ShouldQueue
|
|||
public function handle()
|
||||
{
|
||||
$repo = new ServerRepository;
|
||||
$repo->deleteNow($this->id);
|
||||
$repo->delete($this->id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server creating event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function creating(Server $server)
|
||||
{
|
||||
|
@ -52,8 +52,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server created event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function created(Server $server)
|
||||
{
|
||||
|
@ -73,8 +73,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server deleting event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function deleting(Server $server)
|
||||
{
|
||||
|
@ -86,8 +86,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server deleted event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(Server $server)
|
||||
{
|
||||
|
@ -103,8 +103,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server saving event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function saving(Server $server)
|
||||
{
|
||||
|
@ -114,8 +114,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server saved event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function saved(Server $server)
|
||||
{
|
||||
|
@ -123,10 +123,10 @@ class ServerObserver
|
|||
}
|
||||
|
||||
/**
|
||||
* Listen to the Server saving event.
|
||||
* Listen to the Server updating event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function updating(Server $server)
|
||||
{
|
||||
|
@ -136,8 +136,8 @@ class ServerObserver
|
|||
/**
|
||||
* Listen to the Server saved event.
|
||||
*
|
||||
* @param Server $server [description]
|
||||
* @return [type] [description]
|
||||
* @param Server $server The server model.
|
||||
* @return void
|
||||
*/
|
||||
public function updated(Server $server)
|
||||
{
|
||||
|
|
|
@ -352,7 +352,7 @@ class ServerRepository
|
|||
|
||||
// Validate Fields
|
||||
$validator = Validator::make($data, [
|
||||
'owner_id' => 'sometimes|required|numeric|exists:users,id',
|
||||
'owner_id' => 'sometimes|required|integer|exists:users,id',
|
||||
'name' => 'sometimes|required|regex:([\w .-]{1,200})',
|
||||
'reset_token' => 'sometimes|required|accepted',
|
||||
]);
|
||||
|
@ -369,14 +369,14 @@ class ServerRepository
|
|||
$server = Models\Server::with('user')->findOrFail($id);
|
||||
|
||||
// Update daemon secret if it was passed.
|
||||
if (isset($data['reset_token']) || (isset($data['owner_id']) && $data['owner_id'] !== $server->user->id)) {
|
||||
if (isset($data['reset_token']) || (isset($data['owner_id']) && (int) $data['owner_id'] !== $server->user->id)) {
|
||||
$oldDaemonKey = $server->daemonSecret;
|
||||
$server->daemonSecret = $uuid->generate('servers', 'daemonSecret');
|
||||
$resetDaemonKey = true;
|
||||
}
|
||||
|
||||
// Update Server Owner if it was passed.
|
||||
if (isset($data['owner_id']) && $data['owner_id'] !== $server->user->id) {
|
||||
if (isset($data['owner_id']) && (int) $data['owner_id'] !== $server->user->id) {
|
||||
$server->owner_id = $data['owner_id'];
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,7 @@ class ServerRepository
|
|||
return true;
|
||||
} catch (TransferException $ex) {
|
||||
DB::rollBack();
|
||||
throw new DisplayException('An error occured while attempting to update the container image.', $ex);
|
||||
throw new DisplayException('A TransferException occured while attempting to update the container image. Is the daemon online? This error has been logged.', $ex);
|
||||
} catch (\Exception $ex) {
|
||||
DB::rollBack();
|
||||
throw $ex;
|
||||
|
@ -590,7 +590,6 @@ class ServerRepository
|
|||
// This won't be committed unless the HTTP request succeedes anyways
|
||||
$server->save();
|
||||
|
||||
dd($newBuild);
|
||||
if (! empty($newBuild)) {
|
||||
$server->node->guzzleClient([
|
||||
'X-Access-Server' => $server->uuid,
|
||||
|
@ -607,7 +606,7 @@ class ServerRepository
|
|||
return $server;
|
||||
} catch (TransferException $ex) {
|
||||
DB::rollBack();
|
||||
throw new DisplayException('An error occured while attempting to update the configuration.', $ex);
|
||||
throw new DisplayException('A TransferException occured while attempting to update the server configuration, check that the daemon is online. This error has been logged.', $ex);
|
||||
} catch (\Exception $ex) {
|
||||
DB::rollBack();
|
||||
throw $ex;
|
||||
|
@ -723,13 +722,13 @@ class ServerRepository
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteServer($id, $force)
|
||||
public function queueDeletion($id, $force = false)
|
||||
{
|
||||
$server = Models\Server::findOrFail($id);
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
if ($force === 'force' || $force) {
|
||||
if ($force) {
|
||||
$server->installed = 3;
|
||||
$server->save();
|
||||
}
|
||||
|
@ -743,7 +742,7 @@ class ServerRepository
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteNow($id, $force = false)
|
||||
public function delete($id, $force = false)
|
||||
{
|
||||
$server = Models\Server::withTrashed()->with('node')->findOrFail($id);
|
||||
|
||||
|
@ -819,8 +818,8 @@ class ServerRepository
|
|||
public function toggleInstall($id)
|
||||
{
|
||||
$server = Models\Server::findOrFail($id);
|
||||
if ($server->installed === 2) {
|
||||
throw new DisplayException('This server was marked as having a failed install, you cannot override this.');
|
||||
if ($server->installed > 1) {
|
||||
throw new DisplayException('This server was marked as having a failed install or being deleted, you cannot override this.');
|
||||
}
|
||||
$server->installed = ! $server->installed;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -141,8 +141,8 @@ li.select2-results__option--highlighted[aria-selected="false"] > .user-block > .
|
|||
color: #eee;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
margin: 2.5px;
|
||||
.select2-selection.select2-selection--multiple {
|
||||
min-height: 36px !important;
|
||||
}
|
||||
|
||||
.select2-search--inline .select2-search__field:focus {
|
||||
|
|
|
@ -111,7 +111,7 @@ $('#pLocationId').on('change', function (event) {
|
|||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: Router.route('admin.servers.new.get-nodes'),
|
||||
url: Router.route('admin.servers.new.nodes'),
|
||||
headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') },
|
||||
data: { location: currentLocation },
|
||||
}).done(function (data) {
|
||||
|
|
|
@ -1,461 +0,0 @@
|
|||
{{-- 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. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Manage Server: {{ $server->name }}
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
<h1>{{ $server->name }}<small>{{ $server->uuid }}</small></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
||||
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
|
||||
<li class="active">{{ $server->username }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if($server->suspended && ! $server->trashed())
|
||||
<div class="alert alert-warning">
|
||||
This server is suspended and has no user access. Processes cannot be started and files cannot be modified. All API access is disabled unless using a master token.
|
||||
</div>
|
||||
@elseif($server->trashed())
|
||||
<div class="callout callout-danger">
|
||||
This server is marked for deletion <strong>{{ Carbon::parse($server->deleted_at)->addMinutes(env('APP_DELETE_MINUTES', 10))->diffForHumans() }}</strong>. If you want to cancel this action simply click the button below.
|
||||
<br /><br />
|
||||
<form action="{{ route('admin.servers.post.queuedDeletion', $server->id) }}" method="POST">
|
||||
<button class="btn btn-sm btn-default" name="cancel" value="1">Cancel Deletion</button>
|
||||
<button class="btn btn-sm btn-danger pull-right" name="force_delete" value="1"><strong>Force</strong> Delete</button>
|
||||
<button class="btn btn-sm btn-danger pull-right" name="delete" style="margin-right:10px;" value="1">Delete</button>
|
||||
{!! csrf_field() !!}
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
@if(! $server->installed)
|
||||
<div class="alert alert-warning">
|
||||
This server is still running through the install process and is not avaliable for use just yet. This message will disappear once this process is completed.
|
||||
</div>
|
||||
@elseif($server->installed === 2)
|
||||
<div class="alert alert-danger">
|
||||
This server <strong>failed</strong> to install properly. You should delete it and try to create it again or check the daemon logs.
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab_about" data-toggle="tab">About</a></li>
|
||||
@if($server->installed)
|
||||
<li><a href="#tab_details" data-toggle="tab">Details</a></li>
|
||||
<li><a href="#tab_build" data-toggle="tab">Build Configuration</a></li>
|
||||
<li><a href="#tab_startup" data-toggle="tab">Startup</a></li>
|
||||
<li><a href="#tab_database" data-toggle="tab">Database</a></li>
|
||||
@endif
|
||||
@if($server->installed !== 2)
|
||||
<li><a href="#tab_manage" data-toggle="tab">Manage</a></li>
|
||||
@endif
|
||||
@if(! $server->trashed())
|
||||
<li class="tab-danger"><a href="#tab_delete" data-toggle="tab">Delete</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{{-- Start About --}}
|
||||
<div class="tab-pane active" id="tab_about" style="margin: -10px -10px -30px;">
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<td>UUID</td>
|
||||
<td>{{ $server->uuid }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker Container ID</td>
|
||||
<td data-attr="container-id"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker User ID</td>
|
||||
<td data-attr="container-user"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Owner</td>
|
||||
<td><a href="{{ route('admin.users.view', $server->owner_id) }}">{{ $server->user->email }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location</td>
|
||||
<td><a href="{{ route('admin.locations') }}">{{ $server->node->location->short }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node</td>
|
||||
<td><a href="{{ route('admin.nodes.view', $server->node_id) }}">{{ $server->node->name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Service</td>
|
||||
<td>{{ $server->option->service->name }} :: {{ $server->option->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{ $server->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Memory</td>
|
||||
<td><code>{{ $server->memory }}MB</code> / <code data-toggle="tooltip" data-placement="top" title="Swap Space">{{ $server->swap }}MB</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><abbr title="Out of Memory">OOM</abbr> Killer</td>
|
||||
<td>{!! ($server->oom_disabled === 0) ? '<span class="label label-success">Enabled</span>' : '<span class="label label-default">Disabled</span>' !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Disk Space</td>
|
||||
<td><code>{{ $server->disk }}MB</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Block IO Weight</td>
|
||||
<td><code>{{ $server->io }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CPU Limit</td>
|
||||
<td><code>{{ $server->cpu }}%</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default Connection</td>
|
||||
<td><code>{{ $server->allocation->ip }}:{{ $server->allocation->port }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Connection Alias</td>
|
||||
<td>
|
||||
@if($server->allocation->alias !== $server->allocation->ip)
|
||||
<code>{{ $server->allocation->alias }}:{{ $server->allocation->port }}</code>
|
||||
@else
|
||||
<span class="label label-default">No Alias Assigned</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Installed</td>
|
||||
<td>{!! ($server->installed === 1) ? '<span class="label label-success">Yes</span>' : '<span class="label label-danger">No</span>' !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suspended</td>
|
||||
<td>{!! ($server->suspended === 1) ? '<span class="label label-warning">Suspended</span>' : '<span class="label label-success">No</span>' !!}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{{-- End About / Start Details --}}
|
||||
@if($server->installed)
|
||||
<div class="tab-pane" id="tab_details">
|
||||
<div class="row">
|
||||
<form class="col-sm-6" action="{{ route('admin.servers.view.details', $server->id) }}" method="POST" style="border-right: 1px solid #f4f4f4;">
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Server Name</label>
|
||||
<input type="text" name="name" value="{{ old('name', $server->name) }}" class="form-control" />
|
||||
<p class="text-muted small">Character limits: <code>a-zA-Z0-9_-</code> and <code>[Space]</code> (max 35 characters).</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pUserId" class="control-label">Server Owner</label>
|
||||
<select name="owner_id" class="form-control" id="pUserId">
|
||||
<option value="{{ $server->owner_id }}" selected>{{ $server->user->email }}</option>
|
||||
</select>
|
||||
{{-- <input type="text" name="owner" value="{{ old('owner', $server->user->email) }}" class="form-control" /> --}}
|
||||
<p class="text-muted small">You can change the owner of this server by changing this field to an email matching another use on this system. If you do this a new daemon security token will be generated automatically.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Daemon Secret Token</label>
|
||||
<input type="text" disabled value="{{ $server->daemonSecret }}" class="form-control" />
|
||||
<p class="text-muted small">This token should not be shared with anyone as it has full control over this server.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" name="reset_token" id="pResetToken"/> <label for="pResetToken">Reset Daemon Token</label>
|
||||
<p class="text-muted small">Resetting this token will cause any requests using the old token to fail.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Details" />
|
||||
</div>
|
||||
</form>
|
||||
<form class="col-sm-6" action="{{ route('admin.servers.post.container', $server->id) }}" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Docker Container Image</label>
|
||||
<input type="text" name="docker_image" value="{{ $server->image }}" class="form-control" />
|
||||
<p class="text-muted small">The docker image to use for this server. The default image for this service and option combination is <code>{{ $server->option->docker_image }}</code>.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Docker Container" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{-- End Details / Start Build --}}
|
||||
<div class="tab-pane" id="tab_build">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/build" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 form-group">
|
||||
<label for="memory" class="control-label">Allocated Memory</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory" data-multiplicator="true" class="form-control" value="{{ old('memory', $server->memory) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
<p class="text-muted small">The maximum amount of memory allowed for this container.</p>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 form-group">
|
||||
<label for="swap" class="control-label">Allocated Swap</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="swap" data-multiplicator="true" class="form-control" value="{{ old('swap', $server->swap) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
<p class="text-muted small">Setting this to <code>0</code> will disable swap space on this server. Setting to <code>-1</code> will allow unlimited swap.</p>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 form-group">
|
||||
<label for="cpu" class="control-label">CPU Limit</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="cpu" class="form-control" value="{{ old('cpu', $server->cpu) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
<p class="text-muted small">Each <em>physical</em> core on the system is considered to be <code>100%</code>. Setting this value to <code>0</code> will allow a server to use CPU time without restrictions.</p>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 form-group">
|
||||
<label for="io" class="control-label">Block IO Proportion</label>
|
||||
<div>
|
||||
<input type="text" name="io" class="form-control" value="{{ old('io', $server->io) }}"/>
|
||||
</div>
|
||||
<p class="text-muted small">Changing this value can have negative effects on all containers on the system. We strongly recommend leaving this value as <code>500</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="pAllocation" class="control-label">Game Port</label>
|
||||
<select id="pAllocation" name="allocation_id" class="form-control">
|
||||
@foreach ($assigned as $assignment)
|
||||
<option value="{{ $assignment->id }}"
|
||||
@if($assignment->id === $server->allocation_id)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{ $assignment->alias }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="text-muted small">The default connection address that will be used for this game server.</p>
|
||||
</div>
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="pAddAllocations" class="control-label">Assign Additional Ports</label>
|
||||
<div>
|
||||
<select name="add_allocations[]" class="form-control" multiple id="pAddAllocations">
|
||||
@foreach ($unassigned as $assignment)
|
||||
<option value="{{ $assignment->id }}">{{ $assignment->alias }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-muted small">Please note that due to software limitations you cannot assign identical ports on different IPs to the same server.</p>
|
||||
</div>
|
||||
<div class="col-md-4 form-group">
|
||||
<label for="pRemoveAllocations" class="control-label">Remove Additional Ports</label>
|
||||
<div>
|
||||
<select name="remove_allocations[]" class="form-control" multiple id="pRemoveAllocations">
|
||||
@foreach ($assigned as $assignment)
|
||||
<option value="{{ $assignment->id }}" @if($server->allocation_id === $assignment->id)disabled @endif>{{ $assignment->alias }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-muted small">Simply select which ports you would like to remove from the list above. If you want to assign a port on a different IP that is already in use you can select it from the left and delete it here.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Build Configuration" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{-- End Build / Start Startup --}}
|
||||
<div class="tab-pane" id="tab_startup">
|
||||
Startup
|
||||
</div>
|
||||
{{-- End Startup / Start Database --}}
|
||||
<div class="tab-pane" id="tab_database">
|
||||
Database
|
||||
</div>
|
||||
@endif
|
||||
{{-- End Database / Start Manage --}}
|
||||
@if($server->installed !== 2)
|
||||
<div class="tab-pane" id="tab_manage">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-4 text-center">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/installed" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-primary">Toggle Install Status</button>
|
||||
<p class="text-muted small">This will toggle the install status for the server.</p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 text-center">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/rebuild" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-primary">Rebuild Server Container</button>
|
||||
<p class="text-muted small">This will trigger a rebuild of the server container when it next starts up. This is useful if you modified the server configuration file manually, or something just didn't work out correctly.</p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 text-center">
|
||||
@if(! $server->suspended)
|
||||
<form action="/admin/servers/view/{{ $server->id }}/suspend" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-warning">Suspend Server</button>
|
||||
<p class="text-muted small">This will suspend the server, stop any running processes, and immediately block the user from being able to access their files or otherwise manage the server through the panel or API.</p>
|
||||
</form>
|
||||
@else
|
||||
<form action="/admin/servers/view/{{ $server->id }}/unsuspend" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-success">Unsuspend Server</button>
|
||||
<p class="text-muted small">This will unsuspend the server and restore normal user access.</p>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
{{-- End Manage / Start Delete --}}
|
||||
@if(! $server->trashed())
|
||||
<div class="tab-pane" id="tab_delete">
|
||||
<div class="row">
|
||||
@if($server->installed)
|
||||
<div class="col-sm-6">
|
||||
<form action="/admin/servers/view/{{ $server->id }}" class="text-center" method="POST" data-attr="deleteServer">
|
||||
{!! csrf_field() !!}
|
||||
{!! method_field('DELETE') !!}
|
||||
<button type="submit" class="btn btn-danger">Delete Server</button>
|
||||
</form>
|
||||
<p>
|
||||
<div class="callout callout-danger">
|
||||
Deleting a server is an irreversible action. <strong>All data will be immediately removed relating to this server.</strong>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-sm-6">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/force" class="text-center" method="POST" data-attr="deleteServer">
|
||||
{!! csrf_field() !!}
|
||||
{!! method_field('DELETE') !!}
|
||||
<button type="submit" class="btn btn-danger">Force Delete Server</button>
|
||||
</form>
|
||||
<p>
|
||||
<div class="callout callout-danger">
|
||||
This is the same as deleting a server, however, if an error is returned by the daemon it is ignored and the server is still removed from the panel.
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
{{-- End Delete --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
<script>
|
||||
$('form[data-attr="deleteServer"]').submit(function (event) {
|
||||
event.preventDefault();
|
||||
swal({
|
||||
title: '',
|
||||
type: 'warning',
|
||||
text: 'Are you sure that you want to delete this server? There is no going back, all data will immediately be removed.',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
confirmButtonColor: '#d9534f',
|
||||
closeOnConfirm: false
|
||||
}, function () {
|
||||
event.target.submit();
|
||||
});
|
||||
});
|
||||
$('#pAddAllocations').select2();
|
||||
$('#pRemoveAllocations').select2();
|
||||
$('#pAllocation').select2();
|
||||
$('#pUserId').select2({
|
||||
ajax: {
|
||||
url: Router.route('admin.users.json'),
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
return {
|
||||
q: params.term, // search term
|
||||
page: params.page,
|
||||
};
|
||||
},
|
||||
processResults: function (data, params) {
|
||||
return { results: data };
|
||||
},
|
||||
cache: true,
|
||||
},
|
||||
escapeMarkup: function (markup) { return markup; },
|
||||
minimumInputLength: 2,
|
||||
templateResult: function (data) {
|
||||
if (data.loading) return data.text;
|
||||
|
||||
return '<div class="user-block"> \
|
||||
<img class="img-circle img-bordered-xs" src="https://www.gravatar.com/avatar/' + data.md5 + '?s=120" alt="User Image"> \
|
||||
<span class="username"> \
|
||||
<a href="#">' + data.name_first + ' ' + data.name_last +'</a> \
|
||||
</span> \
|
||||
<span class="description"><strong>' + data.email + '</strong> - ' + data.username + '</span> \
|
||||
</div>';
|
||||
},
|
||||
templateSelection: function (data) {
|
||||
if (typeof data.name_first === 'undefined') {
|
||||
data = {
|
||||
md5: '{{ md5(strtolower($server->user->email)) }}',
|
||||
name_first: '{{ $server->user->name_first }}',
|
||||
name_last: '{{ $server->user->name_last }}',
|
||||
email: '{{ $server->user->email }}',
|
||||
id: {{ $server->owner_id }}
|
||||
};
|
||||
}
|
||||
|
||||
return '<div> \
|
||||
<span> \
|
||||
<img class="img-rounded img-bordered-xs" src="https://www.gravatar.com/avatar/' + data.md5 + '?s=120" style="height:28px;margin-top:-4px;" alt="User Image"> \
|
||||
</span> \
|
||||
<span style="padding-left:5px;"> \
|
||||
' + data.name_first + ' ' + data.name_last + ' (<strong>' + data.email + '</strong>) \
|
||||
</span> \
|
||||
</div>';
|
||||
}
|
||||
});
|
||||
(function checkServerInfo() {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
},
|
||||
url: '{{ $server->node->scheme }}://{{ $server->node->fqdn }}:{{ $server->node->daemonListen }}/server',
|
||||
dataType: 'json',
|
||||
timeout: 5000,
|
||||
}).done(function (data) {
|
||||
$('td[data-attr="container-id"]').html('<code>' + data.container.id + '</code>');
|
||||
$('td[data-attr="container-user"]').html('<code>' + data.user + '</code>');
|
||||
}).fail(function (jqXHR) {
|
||||
$('td[data-attr="container-id"]').html('<code>error</code>');
|
||||
$('td[data-attr="container-user"]').html('<code>error</code>');
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
setTimeout(checkServerInfo, 60000);
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
158
resources/themes/pterodactyl/admin/servers/view/build.blade.php
Normal file
158
resources/themes/pterodactyl/admin/servers/view/build.blade.php
Normal file
|
@ -0,0 +1,158 @@
|
|||
{{-- 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. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Server — {{ $server->name }}: Build Details
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
<h1>{{ $server->name }}<small>Control allocations and system resources for this server.</small></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
||||
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></li>
|
||||
<li class="active">Build Configuration</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="nav-tabs-custom nav-tabs-floating">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">About</a></li>
|
||||
@if(! $server->trashed() && $server->installed === 1)
|
||||
<li><a href="{{ route('admin.servers.view.details', $server->id) }}">Details</a></li>
|
||||
<li class="active"><a href="{{ route('admin.servers.view.build', $server->id) }}">Build Configuration</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.startup', $server->id) }}">Startup</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.database', $server->id) }}">Database</a></li>
|
||||
@endif
|
||||
@if(! $server->trashed())
|
||||
<li><a href="{{ route('admin.servers.view.manage', $server->id) }}">Manage</a></li>
|
||||
@endif
|
||||
<li class="tab-danger"><a href="{{ route('admin.servers.view.delete', $server->id) }}">Delete</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form action="{{ route('admin.servers.view.build', $server->id) }}" method="POST">
|
||||
<div class="col-sm-5">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">System Resources</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="memory" class="control-label">Allocated Memory</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory" data-multiplicator="true" class="form-control" value="{{ old('memory', $server->memory) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
<p class="text-muted small">The maximum amount of memory allowed for this container. Setting this to <code>0</code> will allow unlimited memorry in a container.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="swap" class="control-label">Allocated Swap</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="swap" data-multiplicator="true" class="form-control" value="{{ old('swap', $server->swap) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
<p class="text-muted small">Setting this to <code>0</code> will disable swap space on this server. Setting to <code>-1</code> will allow unlimited swap.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cpu" class="control-label">CPU Limit</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="cpu" class="form-control" value="{{ old('cpu', $server->cpu) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
<p class="text-muted small">Each <em>physical</em> core on the system is considered to be <code>100%</code>. Setting this value to <code>0</code> will allow a server to use CPU time without restrictions.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="io" class="control-label">Block IO Proportion</label>
|
||||
<div>
|
||||
<input type="text" name="io" class="form-control" value="{{ old('io', $server->io) }}"/>
|
||||
</div>
|
||||
<p class="text-muted small">Changing this value can have negative effects on all containers on the system. We strongly recommend leaving this value as <code>500</code>.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Allocation Management</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="pAllocation" class="control-label">Game Port</label>
|
||||
<select id="pAllocation" name="allocation_id" class="form-control">
|
||||
@foreach ($assigned as $assignment)
|
||||
<option value="{{ $assignment->id }}"
|
||||
@if($assignment->id === $server->allocation_id)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{ $assignment->alias }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="text-muted small">The default connection address that will be used for this game server.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pAddAllocations" class="control-label">Assign Additional Ports</label>
|
||||
<div>
|
||||
<select name="add_allocations[]" class="form-control" multiple id="pAddAllocations">
|
||||
@foreach ($unassigned as $assignment)
|
||||
<option value="{{ $assignment->id }}">{{ $assignment->alias }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-muted small">Please note that due to software limitations you cannot assign identical ports on different IPs to the same server.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pRemoveAllocations" class="control-label">Remove Additional Ports</label>
|
||||
<div>
|
||||
<select name="remove_allocations[]" class="form-control" multiple id="pRemoveAllocations">
|
||||
@foreach ($assigned as $assignment)
|
||||
<option value="{{ $assignment->id }}" @if($server->allocation_id === $assignment->id)disabled @endif>{{ $assignment->alias }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-muted small">Simply select which ports you would like to remove from the list above. If you want to assign a port on a different IP that is already in use you can select it from the left and delete it here.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-primary pull-right">Update Build Configuration</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
<script>
|
||||
$('#pAddAllocations').select2();
|
||||
$('#pRemoveAllocations').select2();
|
||||
$('#pAllocation').select2();
|
||||
</script>
|
||||
@endsection
|
141
resources/themes/pterodactyl/admin/servers/view/delete.blade.php
Normal file
141
resources/themes/pterodactyl/admin/servers/view/delete.blade.php
Normal file
|
@ -0,0 +1,141 @@
|
|||
{{-- 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. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Server — {{ $server->name }}: Delete
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
<h1>{{ $server->name }}<small>Delete this server from the panel.</small></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
||||
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></li>
|
||||
<li class="active">Delete</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="nav-tabs-custom nav-tabs-floating">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">About</a></li>
|
||||
@if(! $server->trashed() && $server->installed === 1)
|
||||
<li><a href="{{ route('admin.servers.view.details', $server->id) }}">Details</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.build', $server->id) }}">Build Configuration</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.startup', $server->id) }}">Startup</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.database', $server->id) }}">Database</a></li>
|
||||
@endif
|
||||
@if(! $server->trashed())
|
||||
<li><a href="{{ route('admin.servers.view.manage', $server->id) }}">Manage</a></li>
|
||||
@endif
|
||||
<li class="tab-danger active"><a href="{{ route('admin.servers.view.delete', $server->id) }}">Delete</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@if($server->trashed())
|
||||
<div class="col-xs-12">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Marked for Deletion</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This server is currently marked for deletion by the system <strong>{{ Carbon::parse($server->deleted_at)->addMinutes(env('APP_DELETE_MINUTES', 10))->diffForHumans() }}</strong>.</p>
|
||||
<p class="text-danger small">Deleting a server is an irreversible action. <strong>All server data</strong> (including files and users) will be removed from the system.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.delete.cancel', $server->id) }}" method="POST" style="display:inline;">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-default btn-sm">Cancel Deletion Request</button>
|
||||
</form>
|
||||
<form data-action="delete" action="{{ route('admin.servers.view.delete.continue', ['id' => $server->id, 'force' => 'force']) }}" method="POST" style="display:inline;">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-danger btn-sm pull-right"><strong>Forcibly</strong> Delete Now</button>
|
||||
</form>
|
||||
<form data-action="delete" action="{{ route('admin.servers.view.delete.continue', $server->id) }}" method="POST" style="display:inline">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-danger btn-sm pull-right" style="margin-right:10px;">Safely Delete Now</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-xs-6">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Safely Delete Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This action will attempt to delete the server from both the panel and daemon. If either one reports an error the action will be cancelled.</p>
|
||||
<p class="text-danger small">Deleting a server is an irreversible action. <strong>All server data</strong> (including files and users) will be removed from the system.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.delete', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="is_force" value="0" />
|
||||
<button type="submit" class="btn btn-danger">Safely Delete This Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Force Delete Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This action will attempt to delete the server from both the panel and daemon. The the daemon does not respond, or reports an error the deletion will continue.</p>
|
||||
<p class="text-danger small">Deleting a server is an irreversible action. <strong>All server data</strong> (including files and users) will be removed from the system. This method may leave dangling files on your daemon if it reports an error.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.delete', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="is_force" value="1" />
|
||||
<button type="submit" class="btn btn-danger">Forcibly Delete This Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
<script>
|
||||
$('form[data-action="delete"]').submit(function (event) {
|
||||
event.preventDefault();
|
||||
swal({
|
||||
title: '',
|
||||
type: 'warning',
|
||||
text: 'Are you sure that you want to delete this server? There is no going back, all data will immediately be removed.',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
confirmButtonColor: '#d9534f',
|
||||
closeOnConfirm: false
|
||||
}, function () {
|
||||
event.target.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -0,0 +1,170 @@
|
|||
{{-- 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. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Server — {{ $server->name }}: Details
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
<h1>{{ $server->name }}<small>Edit details for this server including owner and container.</small></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
||||
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></li>
|
||||
<li class="active">Details</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="nav-tabs-custom nav-tabs-floating">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">About</a></li>
|
||||
@if(! $server->trashed() && $server->installed === 1)
|
||||
<li class="active"><a href="{{ route('admin.servers.view.details', $server->id) }}">Details</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.build', $server->id) }}">Build Configuration</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.startup', $server->id) }}">Startup</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.database', $server->id) }}">Database</a></li>
|
||||
@endif
|
||||
@if(! $server->trashed())
|
||||
<li><a href="{{ route('admin.servers.view.manage', $server->id) }}">Manage</a></li>
|
||||
@endif
|
||||
<li class="tab-danger"><a href="{{ route('admin.servers.view.delete', $server->id) }}">Delete</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Base Information</h3>
|
||||
</div>
|
||||
<form action="{{ route('admin.servers.view.details', $server->id) }}" method="POST">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Server Name</label>
|
||||
<input type="text" name="name" value="{{ old('name', $server->name) }}" class="form-control" />
|
||||
<p class="text-muted small">Character limits: <code>a-zA-Z0-9_-</code> and <code>[Space]</code> (max 35 characters).</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pUserId" class="control-label">Server Owner</label>
|
||||
<select name="owner_id" class="form-control" id="pUserId">
|
||||
<option value="{{ $server->owner_id }}" selected>{{ $server->user->email }}</option>
|
||||
</select>
|
||||
<p class="text-muted small">You can change the owner of this server by changing this field to an email matching another use on this system. If you do this a new daemon security token will be generated automatically.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Daemon Secret Token</label>
|
||||
<input type="text" disabled value="{{ $server->daemonSecret }}" class="form-control" />
|
||||
<p class="text-muted small">This token should not be shared with anyone as it has full control over this server.</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" name="reset_token" id="pResetToken"/> <label for="pResetToken">Reset Daemon Token</label>
|
||||
<p class="text-muted small">Resetting this token will cause any requests using the old token to fail.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Details" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Container Setup</h3>
|
||||
</div>
|
||||
<form action="{{ route('admin.servers.view.details.container', $server->id) }}" method="POST">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Docker Container Image</label>
|
||||
<input type="text" name="docker_image" value="{{ $server->image }}" class="form-control" />
|
||||
<p class="text-muted small">The docker image to use for this server. The default image for this service and option combination is <code>{{ $server->option->docker_image }}</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Docker Container" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
<script>
|
||||
$('#pUserId').select2({
|
||||
ajax: {
|
||||
url: Router.route('admin.users.json'),
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
return {
|
||||
q: params.term, // search term
|
||||
page: params.page,
|
||||
};
|
||||
},
|
||||
processResults: function (data, params) {
|
||||
return { results: data };
|
||||
},
|
||||
cache: true,
|
||||
},
|
||||
escapeMarkup: function (markup) { return markup; },
|
||||
minimumInputLength: 2,
|
||||
templateResult: function (data) {
|
||||
if (data.loading) return data.text;
|
||||
|
||||
return '<div class="user-block"> \
|
||||
<img class="img-circle img-bordered-xs" src="https://www.gravatar.com/avatar/' + data.md5 + '?s=120" alt="User Image"> \
|
||||
<span class="username"> \
|
||||
<a href="#">' + data.name_first + ' ' + data.name_last +'</a> \
|
||||
</span> \
|
||||
<span class="description"><strong>' + data.email + '</strong> - ' + data.username + '</span> \
|
||||
</div>';
|
||||
},
|
||||
templateSelection: function (data) {
|
||||
if (typeof data.name_first === 'undefined') {
|
||||
data = {
|
||||
md5: '{{ md5(strtolower($server->user->email)) }}',
|
||||
name_first: '{{ $server->user->name_first }}',
|
||||
name_last: '{{ $server->user->name_last }}',
|
||||
email: '{{ $server->user->email }}',
|
||||
id: {{ $server->owner_id }}
|
||||
};
|
||||
}
|
||||
|
||||
return '<div> \
|
||||
<span> \
|
||||
<img class="img-rounded img-bordered-xs" src="https://www.gravatar.com/avatar/' + data.md5 + '?s=120" style="height:28px;margin-top:-4px;" alt="User Image"> \
|
||||
</span> \
|
||||
<span style="padding-left:5px;"> \
|
||||
' + data.name_first + ' ' + data.name_last + ' (<strong>' + data.email + '</strong>) \
|
||||
</span> \
|
||||
</div>';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
203
resources/themes/pterodactyl/admin/servers/view/index.blade.php
Normal file
203
resources/themes/pterodactyl/admin/servers/view/index.blade.php
Normal file
|
@ -0,0 +1,203 @@
|
|||
{{-- 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. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Server — {{ $server->name }}
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
<h1>{{ $server->name }}<small>{{ $server->uuid }}</small></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
||||
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
|
||||
<li class="active">{{ $server->name }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="nav-tabs-custom nav-tabs-floating">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="{{ route('admin.servers.view', $server->id) }}">About</a></li>
|
||||
@if(! $server->trashed() && $server->installed === 1)
|
||||
<li><a href="{{ route('admin.servers.view.details', $server->id) }}">Details</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.build', $server->id) }}">Build Configuration</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.startup', $server->id) }}">Startup</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.database', $server->id) }}">Database</a></li>
|
||||
@endif
|
||||
@if(! $server->trashed())
|
||||
<li><a href="{{ route('admin.servers.view.manage', $server->id) }}">Manage</a></li>
|
||||
@endif
|
||||
<li class="tab-danger"><a href="{{ route('admin.servers.view.delete', $server->id) }}">Delete</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Information</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<td>UUID</td>
|
||||
<td>{{ $server->uuid }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker Container ID</td>
|
||||
<td data-attr="container-id"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker User ID</td>
|
||||
<td data-attr="container-user"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Service</td>
|
||||
<td>{{ $server->option->service->name }} :: {{ $server->option->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{ $server->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Memory</td>
|
||||
<td><code>{{ $server->memory }}MB</code> / <code data-toggle="tooltip" data-placement="top" title="Swap Space">{{ $server->swap }}MB</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><abbr title="Out of Memory">OOM</abbr> Killer</td>
|
||||
<td>{!! ($server->oom_disabled === 0) ? '<span class="label label-success">Enabled</span>' : '<span class="label label-default">Disabled</span>' !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Disk Space</td>
|
||||
<td><code>{{ $server->disk }}MB</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Block IO Weight</td>
|
||||
<td><code>{{ $server->io }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CPU Limit</td>
|
||||
<td><code>{{ $server->cpu }}%</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default Connection</td>
|
||||
<td><code>{{ $server->allocation->ip }}:{{ $server->allocation->port }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Connection Alias</td>
|
||||
<td>
|
||||
@if($server->allocation->alias !== $server->allocation->ip)
|
||||
<code>{{ $server->allocation->alias }}:{{ $server->allocation->port }}</code>
|
||||
@else
|
||||
<span class="label label-default">No Alias Assigned</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body" style="padding-bottom: 0px;">
|
||||
<div class="row">
|
||||
@if($server->suspended)
|
||||
<div class="col-sm-12">
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3 class="no-margin">Suspended</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if($server->installed !== 1)
|
||||
<div class="col-sm-12">
|
||||
<div class="small-box {{ (! $server->installed) ? 'bg-blue' : 'bg-maroon' }}">
|
||||
<div class="inner">
|
||||
<h3 class="no-margin">{{ (! $server->installed) ? 'Installing' : 'Install Failed' }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-sm-12">
|
||||
<div class="small-box bg-gray">
|
||||
<div class="inner">
|
||||
<h3>{{ str_limit($server->user->username, 8) }}</h3>
|
||||
<p>Server Owner</p>
|
||||
</div>
|
||||
<div class="icon"><i class="fa fa-user"></i></div>
|
||||
<a href="{{ route('admin.users.view', $server->user->id) }}" class="small-box-footer">
|
||||
More info <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="small-box bg-gray">
|
||||
<div class="inner">
|
||||
<h3>{{ str_limit($server->node->name, 8) }}</h3>
|
||||
<p>Server Node</p>
|
||||
</div>
|
||||
<div class="icon"><i class="fa fa-codepen"></i></div>
|
||||
<a href="{{ route('admin.nodes.view', $server->node->id) }}" class="small-box-footer">
|
||||
More info <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
<script>
|
||||
(function checkServerInfo() {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
},
|
||||
url: '{{ $server->node->scheme }}://{{ $server->node->fqdn }}:{{ $server->node->daemonListen }}/server',
|
||||
dataType: 'json',
|
||||
timeout: 5000,
|
||||
}).done(function (data) {
|
||||
$('td[data-attr="container-id"]').html('<code>' + data.container.id + '</code>');
|
||||
$('td[data-attr="container-user"]').html('<code>' + data.user + '</code>');
|
||||
}).fail(function (jqXHR) {
|
||||
$('td[data-attr="container-id"]').html('<code>error</code>');
|
||||
$('td[data-attr="container-user"]').html('<code>error</code>');
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
setTimeout(checkServerInfo, 60000);
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
127
resources/themes/pterodactyl/admin/servers/view/manage.blade.php
Normal file
127
resources/themes/pterodactyl/admin/servers/view/manage.blade.php
Normal file
|
@ -0,0 +1,127 @@
|
|||
{{-- 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. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Server — {{ $server->name }}: Manage
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
<h1>{{ $server->name }}<small>Additional actions to control this server.</small></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
||||
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></li>
|
||||
<li class="active">Manage</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="nav-tabs-custom nav-tabs-floating">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="{{ route('admin.servers.view', $server->id) }}">About</a></li>
|
||||
@if(! $server->trashed() && $server->installed === 1)
|
||||
<li><a href="{{ route('admin.servers.view.details', $server->id) }}">Details</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.build', $server->id) }}">Build Configuration</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.startup', $server->id) }}">Startup</a></li>
|
||||
<li><a href="{{ route('admin.servers.view.database', $server->id) }}">Database</a></li>
|
||||
@endif
|
||||
@if(! $server->trashed())
|
||||
<li class="active"><a href="{{ route('admin.servers.view.manage', $server->id) }}">Manage</a></li>
|
||||
@endif
|
||||
<li class="tab-danger"><a href="{{ route('admin.servers.view.delete', $server->id) }}">Delete</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Install Status</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>If you need to change the install status from uninstalled to installed, or vice versa, you may do so with the button below.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.toggle', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-primary">Toggle Install Status</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Rebuild Container</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will trigger a rebuild of the server container when it next starts up. This is useful if you modified the server configuration file manually, or something just didn't work out correctly.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.rebuild', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-default">Rebuild Server Container</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(! $server->suspended)
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Suspend Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will suspend the server, stop any running processes, and immediately block the user from being able to access their files or otherwise manage the server through the panel or API.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="suspend" />
|
||||
<button type="submit" class="btn btn-warning">Suspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Unsuspend Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will unsuspend the server and restore normal user access.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="unsuspend" />
|
||||
<button type="submit" class="btn btn-success">Unsuspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
Loading…
Reference in a new issue