Merge branch 'develop' into attributes
This commit is contained in:
commit
294c348976
21 changed files with 225 additions and 102 deletions
15
app/Exceptions/ManifestDoesNotExistException.php
Normal file
15
app/Exceptions/ManifestDoesNotExistException.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Spatie\Ignition\Contracts\Solution;
|
||||
use Spatie\Ignition\Contracts\ProvidesSolution;
|
||||
|
||||
class ManifestDoesNotExistException extends Exception implements ProvidesSolution
|
||||
{
|
||||
public function getSolution(): Solution
|
||||
{
|
||||
return new Solutions\ManifestDoesNotExistSolution();
|
||||
}
|
||||
}
|
25
app/Exceptions/Solutions/ManifestDoesNotExistSolution.php
Normal file
25
app/Exceptions/Solutions/ManifestDoesNotExistSolution.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Exceptions\Solutions;
|
||||
|
||||
use Spatie\Ignition\Contracts\Solution;
|
||||
|
||||
class ManifestDoesNotExistSolution implements Solution
|
||||
{
|
||||
public function getSolutionTitle(): string
|
||||
{
|
||||
return "The manifest.json file hasn't been generated yet";
|
||||
}
|
||||
|
||||
public function getSolutionDescription(): string
|
||||
{
|
||||
return 'Run yarn run build:production to build the frontend first.';
|
||||
}
|
||||
|
||||
public function getDocumentationLinks(): array
|
||||
{
|
||||
return [
|
||||
'Docs' => 'https://github.com/pterodactyl/panel/blob/develop/package.json',
|
||||
];
|
||||
}
|
||||
}
|
|
@ -36,6 +36,7 @@ class SettingsController extends ClientApiController
|
|||
{
|
||||
$this->repository->update($server->id, [
|
||||
'name' => $request->input('name'),
|
||||
'description' => $request->input('description') ?? '',
|
||||
]);
|
||||
|
||||
if ($server->name !== $request->input('name')) {
|
||||
|
|
|
@ -11,7 +11,7 @@ class RenameServerRequest extends ClientApiRequest implements ClientPermissionsR
|
|||
{
|
||||
/**
|
||||
* Returns the permissions string indicating which permission should be used to
|
||||
* validate that the authenticated user has permission to perform this action aganist
|
||||
* validate that the authenticated user has permission to perform this action against
|
||||
* the given resource (server).
|
||||
*/
|
||||
public function permission(): string
|
||||
|
@ -26,6 +26,7 @@ class RenameServerRequest extends ClientApiRequest implements ClientPermissionsR
|
|||
{
|
||||
return [
|
||||
'name' => Server::getRules()['name'],
|
||||
'description' => 'string|nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ class Permission extends Model
|
|||
'settings' => [
|
||||
'description' => 'Permissions that control a user\'s access to the settings for this server.',
|
||||
'keys' => [
|
||||
'rename' => 'Allows a user to rename this server.',
|
||||
'rename' => 'Allows a user to rename this server and change the description of it.',
|
||||
'reinstall' => 'Allows a user to trigger a reinstall of this server.',
|
||||
],
|
||||
],
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace Pterodactyl\Services\Helpers;
|
|||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Filesystem\FilesystemManager;
|
||||
use Illuminate\Contracts\Filesystem\Filesystem;
|
||||
use Pterodactyl\Exceptions\ManifestDoesNotExistException;
|
||||
|
||||
class AssetHashService
|
||||
{
|
||||
|
@ -106,6 +107,11 @@ class AssetHashService
|
|||
);
|
||||
}
|
||||
|
||||
return static::$manifest;
|
||||
$manifest = static::$manifest;
|
||||
if ($manifest === null) {
|
||||
throw new ManifestDoesNotExistException();
|
||||
}
|
||||
|
||||
return $manifest;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue