From 0e0b58ba5e29b9c68aad6d8dca1d80b07ea5663a Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 25 Aug 2020 21:00:43 -0700 Subject: [PATCH 1/2] Update wrapper.blade.php --- resources/views/templates/wrapper.blade.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/resources/views/templates/wrapper.blade.php b/resources/views/templates/wrapper.blade.php index 333a0f98..213f0935 100644 --- a/resources/views/templates/wrapper.blade.php +++ b/resources/views/templates/wrapper.blade.php @@ -35,21 +35,11 @@ @import url('//fonts.googleapis.com/css?family=IBM+Plex+Mono|IBM+Plex+Sans:500&display=swap'); - @section('assets') -{{-- {!! $asset->css('main.css') !!}--}} - @show + @yield('assets') @include('layouts.scripts') - @if(\Illuminate\Support\Str::contains(config('app.version'), ['-alpha', '-beta'])) -
-

- You are running a pre-release version of Pterodactyl. Please report any issues - via GitHub. -

-
- @endif @section('content') @yield('above-container') @yield('container') From ac1559de5e8170bcd97ae0f22812fd46b8141b69 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 25 Aug 2020 21:54:41 -0700 Subject: [PATCH 2/2] Revert "Less obtuse mounting code" This reverts commit 9d95c5ab32277cb5115b7c86b7cb2ef626d50ae2. --- app/Models/Mount.php | 18 +++++---- app/Models/MountNode.php | 39 ------------------- app/Models/MountServer.php | 39 ------------------- .../ServerConfigurationStructureService.php | 16 ++++++-- 4 files changed, 23 insertions(+), 89 deletions(-) delete mode 100644 app/Models/MountNode.php delete mode 100644 app/Models/MountServer.php diff --git a/app/Models/Mount.php b/app/Models/Mount.php index 81e9a57c..ac0b5da9 100644 --- a/app/Models/Mount.php +++ b/app/Models/Mount.php @@ -2,9 +2,6 @@ namespace Pterodactyl\Models; -use MountNode; -use MountServer; - /** * @property int $id * @property string $uuid @@ -48,6 +45,11 @@ class Mount extends Model */ protected $attributes = [ 'id' => 'int', + 'uuid' => 'string', + 'name' => 'string', + 'description' => 'string', + 'source' => 'string', + 'target' => 'string', 'read_only' => 'bool', 'user_mountable' => 'bool', ]; @@ -87,18 +89,20 @@ class Mount extends Model /** * Returns all nodes that have this mount assigned. * - * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function nodes() { - return $this->hasManyThrough(Server::class, MountNode::class); + return $this->belongsToMany(Node::class); } /** - * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough + * Returns all servers that have this mount assigned. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function servers() { - return $this->hasManyThrough(Server::class, MountServer::class); + return $this->belongsToMany(Server::class); } } diff --git a/app/Models/MountNode.php b/app/Models/MountNode.php deleted file mode 100644 index 77f8bf3d..00000000 --- a/app/Models/MountNode.php +++ /dev/null @@ -1,39 +0,0 @@ -belongsTo(Node::class); - } - - /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function mount() - { - return $this->belongsTo(Mount::class); - } -} diff --git a/app/Models/MountServer.php b/app/Models/MountServer.php deleted file mode 100644 index 77b60208..00000000 --- a/app/Models/MountServer.php +++ /dev/null @@ -1,39 +0,0 @@ -belongsTo(Server::class); - } - - /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function mount() - { - return $this->belongsTo(Mount::class); - } -} diff --git a/app/Services/Servers/ServerConfigurationStructureService.php b/app/Services/Servers/ServerConfigurationStructureService.php index ec8bbf56..fea2eaac 100644 --- a/app/Services/Servers/ServerConfigurationStructureService.php +++ b/app/Services/Servers/ServerConfigurationStructureService.php @@ -9,7 +9,6 @@ namespace Pterodactyl\Services\Servers; -use Pterodactyl\Models\Mount; use Pterodactyl\Models\Server; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; @@ -72,6 +71,17 @@ class ServerConfigurationStructureService */ protected function returnCurrentFormat(Server $server) { + $mounts = $server->mounts; + foreach ($mounts as $mount) { + unset($mount->id); + unset($mount->uuid); + unset($mount->name); + unset($mount->description); + $mount->read_only = $mount->read_only == 1; + unset($mount->user_mountable); + unset($mount->pivot); + } + return [ 'uuid' => $server->uuid, 'suspended' => (bool) $server->suspended, @@ -102,9 +112,7 @@ class ServerConfigurationStructureService ], 'mappings' => $server->getAllocationMappings(), ], - 'mounts' => $server->mounts->map(function (Mount $mount) { - return $mount->only('uuid', 'source', 'description', 'read_only'); - })->toArray(), + 'mounts' => $mounts, ]; }