Skip to content

Commit 3a5d21f

Browse files
committed
Filemanager cleanup
1 parent 5839034 commit 3a5d21f

File tree

6 files changed

+58
-33
lines changed

6 files changed

+58
-33
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1212
### Changed
1313
* Panel now throws proper 504: Gateway Timeout errors on server listing when daemon is offline.
1414
* Sessions handled through redis now use a seperate database (default `1`) to store session database to avoid logging users out when flushing the cache.
15+
* File manager UI improved to be clearer with buttons and cleaner on mobile.
1516

1617
## v0.7.5 (Derelict Dermodactylus)
1718
### Fixed

public/themes/pterodactyl/css/pterodactyl.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ p.small {
145145
font-size: 14px !important;
146146
}
147147

148+
.table .min-size {
149+
width:1px;
150+
white-space: nowrap;
151+
}
152+
153+
@media (max-width:767px) {
154+
.box-header > .box-tools {
155+
position: relative !important;
156+
padding: 0px 10px 10px;
157+
}
158+
}
159+
148160
.middle, .align-middle {
149161
vertical-align: middle !important;
150162
}

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/src/actions.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class ActionsClass {
284284
swal({
285285
type: 'warning',
286286
title: '',
287-
text: 'Are you sure you want to delete <code>' + delName + '</code>? There is <strong>no</strong> reversing this action.',
287+
text: 'Are you sure you want to delete <code>' + delName + '</code>?',
288288
html: true,
289289
showCancelButton: true,
290290
showConfirmButton: true,
@@ -380,16 +380,22 @@ class ActionsClass {
380380
if (selectedItems.length != 0)
381381
{
382382
let formattedItems = "";
383+
let i = 0;
383384
$.each(selectedItems, function(key, value) {
384-
formattedItems += ("<code>" + value + "</code>, ");
385-
})
385+
formattedItems += ("<code>" + value + "</code>, ");
386+
i++;
387+
return i < 5;
388+
});
386389

387390
formattedItems = formattedItems.slice(0, -2);
391+
if (selectedItems.length > 5) {
392+
formattedItems += ', and ' + (selectedItems.length - 5) + ' other(s)';
393+
}
388394

389395
swal({
390396
type: 'warning',
391397
title: '',
392-
text: 'Are you sure you want to delete:' + formattedItems + '? There is <strong>no</strong> reversing this action.',
398+
text: 'Are you sure you want to delete the following files: ' + formattedItems + '?',
393399
html: true,
394400
showCancelButton: true,
395401
showConfirmButton: true,

resources/lang/en/server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@
273273
'last_modified' => 'Last Modified',
274274
'add_new' => 'Add New File',
275275
'add_folder' => 'Add New Folder',
276-
'mass_actions' => 'Mass actions',
277-
'delete' => 'Delete',
276+
'mass_actions' => 'Mass Actions',
277+
'delete' => 'Delete Files',
278278
'edit' => [
279279
'header' => 'Edit File',
280280
'header_sub' => 'Make modifications to a file from the web.',

resources/themes/pterodactyl/server/files/list.blade.php

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,45 @@
66

77
<div class="box-header with-border">
88
<h3 class="box-title">/home/container{{ $directory['header'] }}</h3>
9-
<div class="box-tools pull-right">
10-
<div class="btn-group">
11-
<button type="button" id="mass_actions" class="btn btn-sm btn-info dropdown-toggle disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
12-
@lang('server.files.mass_actions') <span class="caret"></span>
13-
</button>
14-
<ul class="dropdown-menu dropdown-massactions">
15-
<li><a href="#" id="selective-deletion" data-action="selective-deletion">@lang('server.files.delete') <i class="fa fa-fw fa-trash-o"></i></a></li>
16-
</ul>
17-
</div>
18-
<button class="btn btn-sm btn-success btn-icon" data-action="add-folder">
19-
<i class="fa fa-fw fa-folder-open-o"></i>
20-
</button>
9+
<div class="box-tools">
2110
<a href="/server/{{ $server->uuidShort }}/files/add/@if($directory['header'] !== '')?dir={{ $directory['header'] }}@endif">
2211
<button class="btn btn-success btn-sm btn-icon">
23-
<i class="fa fa-fw fa-file-text-o"></i>
12+
New File <i class="fa fa-fw fa-file-text-o"></i>
2413
</button>
2514
</a>
15+
<button class="btn btn-sm btn-success btn-icon" data-action="add-folder">
16+
New Folder <i class="fa fa-fw fa-folder-open-o"></i>
17+
</button>
2618
<label class="btn btn-primary btn-sm btn-icon">
27-
<i class="fa fa-fw fa-upload"></i><input type="file" id="files_touch_target" class="hidden">
19+
Upload <i class="fa fa-fw fa-upload"></i><input type="file" id="files_touch_target" class="hidden">
2820
</label>
21+
<div class="btn-group hidden-xs">
22+
<button type="button" id="mass_actions" class="btn btn-sm btn-default dropdown-toggle disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
23+
@lang('server.files.mass_actions') <span class="caret"></span>
24+
</button>
25+
<ul class="dropdown-menu dropdown-massactions">
26+
<li><a href="#" id="selective-deletion" data-action="selective-deletion">@lang('server.files.delete') <i class="fa fa-fw fa-trash-o"></i></a></li>
27+
</ul>
28+
</div>
2929
</div>
3030
</div>
3131
<div class="box-body table-responsive no-padding">
3232
<table class="table table-hover" id="file_listing" data-current-dir="{{ $directory['header'] }}">
3333
<thead>
3434
<tr>
35-
<th style="width:4%;" class="middle">
36-
<input type="checkbox" class="select-all-files" data-action="selectAll"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files" style="font-size:14px;"></i>
35+
<th class="middle min-size">
36+
<input type="checkbox" class="select-all-files hidden-xs" data-action="selectAll"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files" style="font-size:14px;"></i>
3737
</th>
38-
<th style="width:55%">@lang('server.files.file_name')</th>
39-
<th style="width:15%" class="hidden-xs">@lang('server.files.size')</th>
40-
<th style="width:20%" class="hidden-xs">@lang('server.files.last_modified')</th>
41-
<th style="width:6%"></th>
38+
<th>@lang('server.files.file_name')</th>
39+
<th class="hidden-xs">@lang('server.files.size')</th>
40+
<th class="hidden-xs">@lang('server.files.last_modified')</th>
41+
<th></th>
4242
</tr>
4343
</thead>
4444
<tbody id="append_files_to">
4545
@if (isset($directory['first']) && $directory['first'] === true)
4646
<tr data-type="disabled">
47-
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
47+
<td class="middle min-size"><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
4848
<td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">&larr;</a></a></td>
4949
<td class="hidden-xs"></td>
5050
<td class="hidden-xs"></td>
@@ -53,7 +53,7 @@
5353
@endif
5454
@if (isset($directory['show']) && $directory['show'] === true)
5555
<tr data-type="disabled">
56-
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
56+
<td class="middle min-size"><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
5757
<td data-name="{{ rawurlencode($directory['link']) }}">
5858
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">&larr; {{ $directory['link_show'] }}</a>
5959
</td>
@@ -64,7 +64,9 @@
6464
@endif
6565
@foreach ($folders as $folder)
6666
<tr data-type="folder">
67-
<td data-identifier="type" class="middle"><input type="checkbox" class="select-folder" data-action="addSelection"><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
67+
<td class="middle min-size" data-identifier="type">
68+
<input type="checkbox" class="select-folder hidden-xs" data-action="addSelection"><i class="fa fa-folder" style="margin-left: 0.859px;"></i>
69+
</td>
6870
<td data-identifier="name" data-name="{{ rawurlencode($folder['entry']) }}" data-path="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}@endif/">
6971
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
7072
</td>
@@ -79,12 +81,14 @@
7981
{{ $carbon->diffForHumans() }}
8082
@endif
8183
</td>
82-
<td><button class="btn btn-xxs btn-default disable-menu-hide" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h disable-menu-hide"></i></td>
84+
<td class="min-size">
85+
<button class="btn btn-xxs btn-default disable-menu-hide" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h disable-menu-hide"></i></button>
86+
</td>
8387
</tr>
8488
@endforeach
8589
@foreach ($files as $file)
8690
<tr data-type="file" data-mime="{{ $file['mime'] }}">
87-
<td data-identifier="type" class="middle"><input type="checkbox" class="select-file" data-action="addSelection">
91+
<td class="middle min-size" data-identifier="type"><input type="checkbox" class="select-file hidden-xs" data-action="addSelection">
8892
{{-- oh boy --}}
8993
@if(in_array($file['mime'], [
9094
'application/x-7z-compressed',
@@ -156,7 +160,9 @@
156160
{{ $carbon->diffForHumans() }}
157161
@endif
158162
</td>
159-
<td><button class="btn btn-xxs btn-default disable-menu-hide" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h disable-menu-hide"></i></td>
163+
<td class="min-size">
164+
<button class="btn btn-xxs btn-default disable-menu-hide" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h disable-menu-hide"></i></button>
165+
</td>
160166
</tr>
161167
@endforeach
162168
</tbody>

0 commit comments

Comments
 (0)