Skip to content

Commit 6bc51ad

Browse files
committed
Merge branch 'develop' into dane/fix-performance-snafu
2 parents 1598dac + ac1559d commit 6bc51ad

File tree

5 files changed

+24
-100
lines changed

5 files changed

+24
-100
lines changed

app/Models/Mount.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace Pterodactyl\Models;
44

5-
use MountNode;
6-
use MountServer;
7-
85
/**
96
* @property int $id
107
* @property string $uuid
@@ -48,6 +45,11 @@ class Mount extends Model
4845
*/
4946
protected $attributes = [
5047
'id' => 'int',
48+
'uuid' => 'string',
49+
'name' => 'string',
50+
'description' => 'string',
51+
'source' => 'string',
52+
'target' => 'string',
5153
'read_only' => 'bool',
5254
'user_mountable' => 'bool',
5355
];
@@ -87,18 +89,20 @@ public function eggs()
8789
/**
8890
* Returns all nodes that have this mount assigned.
8991
*
90-
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
92+
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
9193
*/
9294
public function nodes()
9395
{
94-
return $this->hasManyThrough(Server::class, MountNode::class);
96+
return $this->belongsToMany(Node::class);
9597
}
9698

9799
/**
98-
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
100+
* Returns all servers that have this mount assigned.
101+
*
102+
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
99103
*/
100104
public function servers()
101105
{
102-
return $this->hasManyThrough(Server::class, MountServer::class);
106+
return $this->belongsToMany(Server::class);
103107
}
104108
}

app/Models/MountNode.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/Models/MountServer.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/Services/Servers/ServerConfigurationStructureService.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace Pterodactyl\Services\Servers;
1111

12-
use Pterodactyl\Models\Mount;
1312
use Pterodactyl\Models\Server;
1413
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
1514

@@ -72,6 +71,17 @@ public function handle(Server $server, bool $legacy = false): array
7271
*/
7372
protected function returnCurrentFormat(Server $server)
7473
{
74+
$mounts = $server->mounts;
75+
foreach ($mounts as $mount) {
76+
unset($mount->id);
77+
unset($mount->uuid);
78+
unset($mount->name);
79+
unset($mount->description);
80+
$mount->read_only = $mount->read_only == 1;
81+
unset($mount->user_mountable);
82+
unset($mount->pivot);
83+
}
84+
7585
return [
7686
'uuid' => $server->uuid,
7787
'suspended' => (bool) $server->suspended,
@@ -102,9 +112,7 @@ protected function returnCurrentFormat(Server $server)
102112
],
103113
'mappings' => $server->getAllocationMappings(),
104114
],
105-
'mounts' => $server->mounts->map(function (Mount $mount) {
106-
return $mount->only('uuid', 'source', 'description', 'read_only');
107-
})->toArray(),
115+
'mounts' => $mounts,
108116
];
109117
}
110118

resources/views/templates/wrapper.blade.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,11 @@
3535
@import url('//fonts.googleapis.com/css?family=IBM+Plex+Mono|IBM+Plex+Sans:500&display=swap');
3636
</style>
3737

38-
@section('assets')
39-
{{-- {!! $asset->css('main.css') !!}--}}
40-
@show
38+
@yield('assets')
4139

4240
@include('layouts.scripts')
4341
</head>
4442
<body class="{{ $css['body'] ?? 'bg-neutral-50' }}">
45-
@if(\Illuminate\Support\Str::contains(config('app.version'), ['-alpha', '-beta']))
46-
<div class="bg-red-500">
47-
<p class="text-center text-white text-sm p-3">
48-
You are running a pre-release version of Pterodactyl. Please report any issues
49-
<a href="https://github.com/pterodactyl/panel/issues" class="text-red-100">via GitHub</a>.
50-
</p>
51-
</div>
52-
@endif
5343
@section('content')
5444
@yield('above-container')
5545
@yield('container')

0 commit comments

Comments
 (0)