Skip to content

Commit de0b9be

Browse files
committed
Minor visual tweaking and filemanager backend improvements.
1 parent ee309b0 commit de0b9be

File tree

10 files changed

+47
-17
lines changed

10 files changed

+47
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
77
### Fixed
88
* `[rc.1]` — Server deletion is fixed, caused by removed download table.
99
* `[rc.1]` — Server status indication on front-end no longer shows `Error` when server is marked as installing or suspended.
10+
* `[rc.1]` — Fixes issues with SteamCMD not registering and installing games properly.
11+
12+
### Changed
13+
* Panel now sends all non-default allocations as `ALLOC_#__IP` and `ALLOC_#__PORT` to the daemon, as well as the location.
1014

1115
## v0.6.0-rc.1 (Courageous Carniadactylus)
1216
### Fixed

app/Http/Controllers/Admin/BaseController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ public function postSettings(Request $request)
6464
{
6565
$validator = Validator::make($request->all(), [
6666
'company' => 'required|between:1,256',
67-
'default_language' => 'required|alpha_dash|min:2|max:5',
67+
// 'default_language' => 'required|alpha_dash|min:2|max:5',
6868
]);
6969

7070
if ($validator->fails()) {
7171
return redirect()->route('admin.settings')->withErrors($validator->errors())->withInput();
7272
}
7373

7474
Settings::set('company', $request->input('company'));
75-
Settings::set('default_language', $request->input('default_language'));
75+
// Settings::set('default_language', $request->input('default_language'));
7676

7777
Alert::success('Settings have been successfully updated.')->flash();
7878

app/Http/Controllers/Admin/NodesController.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,17 @@ public function viewIndex(Request $request, $id)
124124
DB::raw('SUM(memory) as memory, SUM(disk) as disk')
125125
)->where('node_id', $node->id)->first()
126126
)->mapWithKeys(function ($item, $key) use ($node) {
127-
$percent = ($item / $node->{$key}) * 100;
127+
if ($node->{$key . '_overallocate'} > 0) {
128+
$withover = $node->{$key} * (1 + ($node->{$key . '_overallocate'} / 100));
129+
} else {
130+
$withover = $node->{$key};
131+
}
132+
133+
$percent = ($item / $withover) * 100;
128134

129135
return [$key => [
130-
'value' => $item,
136+
'value' => number_format($item),
137+
'max' => number_format($withover),
131138
'percent' => $percent,
132139
'css' => ($percent <= 75) ? 'green' : (($percent > 90) ? 'red' : 'yellow'),
133140
]];

app/Repositories/Daemon/FileRepository.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,21 @@ public function returnDirectoryListing($directory)
144144
throw new Exception('A valid directory must be specified in order to list its contents.');
145145
}
146146

147-
$res = $this->server->guzzleClient()->request('GET', '/server/directory/' . rawurlencode($directory));
147+
try {
148+
$res = $this->server->guzzleClient()->request('GET', '/server/directory/' . rawurlencode($directory));
149+
} catch(\GuzzleHttp\Exception\ClientException $ex) {
150+
$json = json_decode($ex->getResponse()->getBody());
151+
152+
throw new DisplayException($json->error);
153+
} catch (\GuzzleHttp\Exception\ServerException $ex) {
154+
throw new DisplayException('A remote server error was encountered while attempting to display this directory.');
155+
} catch (\GuzzleHttp\Exception\ConnectException $ex) {
156+
throw new DisplayException('A ConnectException was encountered: unable to contact daemon.');
157+
} catch (\Exception $ex) {
158+
throw $ex;
159+
}
148160

149161
$json = json_decode($res->getBody());
150-
if ($res->getStatusCode() !== 200) {
151-
throw new DisplayException('An error occured while attempting to save this file. ' . $res->getBody());
152-
}
153162

154163
// Iterate through results
155164
$files = [];

public/themes/pterodactyl/js/frontend/files/filemanager.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/themes/pterodactyl/js/frontend/files/filemanager.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/themes/pterodactyl/js/frontend/files/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class FileManager {
6262
swal({
6363
type: 'error',
6464
title: 'File Error',
65-
text: 'An error occured while attempting to process this request. Please try again.',
65+
text: jqXHR.responseText || 'An error occured while attempting to process this request. Please try again.',
6666
});
6767
console.error(jqXHR);
6868
});

resources/themes/pterodactyl/admin/nodes/view/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<span class="info-box-icon"><i class="ion ion-ios-folder-outline"></i></span>
104104
<div class="info-box-content" style="padding: 15px 10px 0;">
105105
<span class="info-box-text">Disk Space Allocated</span>
106-
<span class="info-box-number">{{ $stats['disk']['value'] }} Mb</span>
106+
<span class="info-box-number">{{ $stats['disk']['value'] }} / {{ $stats['disk']['max'] }} Mb</span>
107107
<div class="progress">
108108
<div class="progress-bar" style="width: {{ $stats['disk']['percent'] }}%"></div>
109109
</div>
@@ -115,7 +115,7 @@
115115
<span class="info-box-icon"><i class="ion ion-ios-barcode-outline"></i></span>
116116
<div class="info-box-content" style="padding: 15px 10px 0;">
117117
<span class="info-box-text">Memory Allocated</span>
118-
<span class="info-box-number">{{ $stats['memory']['value'] }} Mb</span>
118+
<span class="info-box-number">{{ $stats['memory']['value'] }} / {{ $stats['memory']['max'] }} Mb</span>
119119
<div class="progress">
120120
<div class="progress-bar" style="width: {{ $stats['memory']['percent'] }}%"></div>
121121
</div>

resources/themes/pterodactyl/admin/settings.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<p class="text-muted"><small>This is the name that is used throughout the panel and in emails sent to clients.</small></p>
4949
</div>
5050
</div>
51-
<div class="form-group col-md-6">
51+
{{-- <div class="form-group col-md-6">
5252
<label class="control-label">Default Language:</label>
5353
<div>
5454
<select name="default_language" class="form-control">
@@ -65,7 +65,7 @@
6565
</select>
6666
<p class="text-muted"><small>This is the default language that all clients will use unless they manually change it.</small></p>
6767
</div>
68-
</div>
68+
</div> --}}
6969
</div>
7070
<div class="row">
7171
<div class="col-md-12">

resources/themes/pterodactyl/admin/users/index.blade.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<th>Email</td>
5858
<th>Client Name</th>
5959
<th>Username</th>
60+
<th class="text-center">2FA</th>
6061
<th class="text-center" data-toggle="tooltip" data-placement="top" title="Servers that this user is marked as the owner of.">Servers Owned</th>
6162
<th class="text-center" data-toggle="tooltip" data-placement="top" title="Servers that this user can access because they are marked as a subuser.">Can Access</th>
6263
<th></th>
@@ -69,9 +70,18 @@
6970
<td><a href="{{ route('admin.users.view', $user->id) }}">{{ $user->email }}</a></td>
7071
<td>{{ $user->name_last }}, {{ $user->name_first }}</td>
7172
<td>{{ $user->username }}</td>
72-
<td class="text-center">{{ $user->servers_count }}</td>
73+
<td class="text-center">
74+
@if($user->use_totp)
75+
<i class="fa fa-lock text-green"></i>
76+
@else
77+
<i class="fa fa-unlock text-red"></i>
78+
@endif
79+
</td>
80+
<td class="text-center">
81+
<a href="{{ route('admin.servers', ['query' => $user->email]) }}">{{ $user->servers_count }}</a>
82+
</td>
7383
<td class="text-center">{{ $user->subuser_of_count }}</td>
74-
<td class="text-center"><img src="https://www.gravatar.com/avatar/{{ md5(strtolower($user->email)) }}?s=20" class="img-circle" /></td>
84+
<td class="text-center"><img src="https://www.gravatar.com/avatar/{{ md5(strtolower($user->email)) }}?s=100" style="height:20px;" class="img-circle" /></td>
7585
</tr>
7686
@endforeach
7787
</tbody>

0 commit comments

Comments
 (0)