Filemanager cleanup
This commit is contained in:
parent
5839034e8f
commit
3a5d21f455
6 changed files with 58 additions and 33 deletions
|
@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
### Changed
|
### Changed
|
||||||
* Panel now throws proper 504: Gateway Timeout errors on server listing when daemon is offline.
|
* Panel now throws proper 504: Gateway Timeout errors on server listing when daemon is offline.
|
||||||
* Sessions handled through redis now use a seperate database (default `1`) to store session database to avoid logging users out when flushing the cache.
|
* Sessions handled through redis now use a seperate database (default `1`) to store session database to avoid logging users out when flushing the cache.
|
||||||
|
* File manager UI improved to be clearer with buttons and cleaner on mobile.
|
||||||
|
|
||||||
## v0.7.5 (Derelict Dermodactylus)
|
## v0.7.5 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -145,6 +145,18 @@ p.small {
|
||||||
font-size: 14px !important;
|
font-size: 14px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table .min-size {
|
||||||
|
width:1px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:767px) {
|
||||||
|
.box-header > .box-tools {
|
||||||
|
position: relative !important;
|
||||||
|
padding: 0px 10px 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.middle, .align-middle {
|
.middle, .align-middle {
|
||||||
vertical-align: middle !important;
|
vertical-align: middle !important;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -284,7 +284,7 @@ class ActionsClass {
|
||||||
swal({
|
swal({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: '',
|
title: '',
|
||||||
text: 'Are you sure you want to delete <code>' + delName + '</code>? There is <strong>no</strong> reversing this action.',
|
text: 'Are you sure you want to delete <code>' + delName + '</code>?',
|
||||||
html: true,
|
html: true,
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
showConfirmButton: true,
|
showConfirmButton: true,
|
||||||
|
@ -380,16 +380,22 @@ class ActionsClass {
|
||||||
if (selectedItems.length != 0)
|
if (selectedItems.length != 0)
|
||||||
{
|
{
|
||||||
let formattedItems = "";
|
let formattedItems = "";
|
||||||
|
let i = 0;
|
||||||
$.each(selectedItems, function(key, value) {
|
$.each(selectedItems, function(key, value) {
|
||||||
formattedItems += ("<code>" + value + "</code>, ");
|
formattedItems += ("<code>" + value + "</code>, ");
|
||||||
})
|
i++;
|
||||||
|
return i < 5;
|
||||||
|
});
|
||||||
|
|
||||||
formattedItems = formattedItems.slice(0, -2);
|
formattedItems = formattedItems.slice(0, -2);
|
||||||
|
if (selectedItems.length > 5) {
|
||||||
|
formattedItems += ', and ' + (selectedItems.length - 5) + ' other(s)';
|
||||||
|
}
|
||||||
|
|
||||||
swal({
|
swal({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: '',
|
title: '',
|
||||||
text: 'Are you sure you want to delete:' + formattedItems + '? There is <strong>no</strong> reversing this action.',
|
text: 'Are you sure you want to delete the following files: ' + formattedItems + '?',
|
||||||
html: true,
|
html: true,
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
showConfirmButton: true,
|
showConfirmButton: true,
|
||||||
|
|
|
@ -273,8 +273,8 @@ return [
|
||||||
'last_modified' => 'Last Modified',
|
'last_modified' => 'Last Modified',
|
||||||
'add_new' => 'Add New File',
|
'add_new' => 'Add New File',
|
||||||
'add_folder' => 'Add New Folder',
|
'add_folder' => 'Add New Folder',
|
||||||
'mass_actions' => 'Mass actions',
|
'mass_actions' => 'Mass Actions',
|
||||||
'delete' => 'Delete',
|
'delete' => 'Delete Files',
|
||||||
'edit' => [
|
'edit' => [
|
||||||
'header' => 'Edit File',
|
'header' => 'Edit File',
|
||||||
'header_sub' => 'Make modifications to a file from the web.',
|
'header_sub' => 'Make modifications to a file from the web.',
|
||||||
|
|
|
@ -6,45 +6,45 @@
|
||||||
|
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">/home/container{{ $directory['header'] }}</h3>
|
<h3 class="box-title">/home/container{{ $directory['header'] }}</h3>
|
||||||
<div class="box-tools pull-right">
|
<div class="box-tools">
|
||||||
<div class="btn-group">
|
|
||||||
<button type="button" id="mass_actions" class="btn btn-sm btn-info dropdown-toggle disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
@lang('server.files.mass_actions') <span class="caret"></span>
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu dropdown-massactions">
|
|
||||||
<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>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<button class="btn btn-sm btn-success btn-icon" data-action="add-folder">
|
|
||||||
<i class="fa fa-fw fa-folder-open-o"></i>
|
|
||||||
</button>
|
|
||||||
<a href="/server/{{ $server->uuidShort }}/files/add/@if($directory['header'] !== '')?dir={{ $directory['header'] }}@endif">
|
<a href="/server/{{ $server->uuidShort }}/files/add/@if($directory['header'] !== '')?dir={{ $directory['header'] }}@endif">
|
||||||
<button class="btn btn-success btn-sm btn-icon">
|
<button class="btn btn-success btn-sm btn-icon">
|
||||||
<i class="fa fa-fw fa-file-text-o"></i>
|
New File <i class="fa fa-fw fa-file-text-o"></i>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
<button class="btn btn-sm btn-success btn-icon" data-action="add-folder">
|
||||||
|
New Folder <i class="fa fa-fw fa-folder-open-o"></i>
|
||||||
|
</button>
|
||||||
<label class="btn btn-primary btn-sm btn-icon">
|
<label class="btn btn-primary btn-sm btn-icon">
|
||||||
<i class="fa fa-fw fa-upload"></i><input type="file" id="files_touch_target" class="hidden">
|
Upload <i class="fa fa-fw fa-upload"></i><input type="file" id="files_touch_target" class="hidden">
|
||||||
</label>
|
</label>
|
||||||
|
<div class="btn-group hidden-xs">
|
||||||
|
<button type="button" id="mass_actions" class="btn btn-sm btn-default dropdown-toggle disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
@lang('server.files.mass_actions') <span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-massactions">
|
||||||
|
<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>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body table-responsive no-padding">
|
<div class="box-body table-responsive no-padding">
|
||||||
<table class="table table-hover" id="file_listing" data-current-dir="{{ $directory['header'] }}">
|
<table class="table table-hover" id="file_listing" data-current-dir="{{ $directory['header'] }}">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:4%;" class="middle">
|
<th class="middle min-size">
|
||||||
<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>
|
<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>
|
||||||
</th>
|
</th>
|
||||||
<th style="width:55%">@lang('server.files.file_name')</th>
|
<th>@lang('server.files.file_name')</th>
|
||||||
<th style="width:15%" class="hidden-xs">@lang('server.files.size')</th>
|
<th class="hidden-xs">@lang('server.files.size')</th>
|
||||||
<th style="width:20%" class="hidden-xs">@lang('server.files.last_modified')</th>
|
<th class="hidden-xs">@lang('server.files.last_modified')</th>
|
||||||
<th style="width:6%"></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="append_files_to">
|
<tbody id="append_files_to">
|
||||||
@if (isset($directory['first']) && $directory['first'] === true)
|
@if (isset($directory['first']) && $directory['first'] === true)
|
||||||
<tr data-type="disabled">
|
<tr data-type="disabled">
|
||||||
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
<td class="middle min-size"><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
||||||
<td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">←</a></a></td>
|
<td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">←</a></a></td>
|
||||||
<td class="hidden-xs"></td>
|
<td class="hidden-xs"></td>
|
||||||
<td class="hidden-xs"></td>
|
<td class="hidden-xs"></td>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
@endif
|
@endif
|
||||||
@if (isset($directory['show']) && $directory['show'] === true)
|
@if (isset($directory['show']) && $directory['show'] === true)
|
||||||
<tr data-type="disabled">
|
<tr data-type="disabled">
|
||||||
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
<td class="middle min-size"><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
||||||
<td data-name="{{ rawurlencode($directory['link']) }}">
|
<td data-name="{{ rawurlencode($directory['link']) }}">
|
||||||
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">← {{ $directory['link_show'] }}</a>
|
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">← {{ $directory['link_show'] }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -64,7 +64,9 @@
|
||||||
@endif
|
@endif
|
||||||
@foreach ($folders as $folder)
|
@foreach ($folders as $folder)
|
||||||
<tr data-type="folder">
|
<tr data-type="folder">
|
||||||
<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>
|
<td class="middle min-size" data-identifier="type">
|
||||||
|
<input type="checkbox" class="select-folder hidden-xs" data-action="addSelection"><i class="fa fa-folder" style="margin-left: 0.859px;"></i>
|
||||||
|
</td>
|
||||||
<td data-identifier="name" data-name="{{ rawurlencode($folder['entry']) }}" data-path="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}@endif/">
|
<td data-identifier="name" data-name="{{ rawurlencode($folder['entry']) }}" data-path="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}@endif/">
|
||||||
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
|
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -79,12 +81,14 @@
|
||||||
{{ $carbon->diffForHumans() }}
|
{{ $carbon->diffForHumans() }}
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<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>
|
<td class="min-size">
|
||||||
|
<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>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
@foreach ($files as $file)
|
@foreach ($files as $file)
|
||||||
<tr data-type="file" data-mime="{{ $file['mime'] }}">
|
<tr data-type="file" data-mime="{{ $file['mime'] }}">
|
||||||
<td data-identifier="type" class="middle"><input type="checkbox" class="select-file" data-action="addSelection">
|
<td class="middle min-size" data-identifier="type"><input type="checkbox" class="select-file hidden-xs" data-action="addSelection">
|
||||||
{{-- oh boy --}}
|
{{-- oh boy --}}
|
||||||
@if(in_array($file['mime'], [
|
@if(in_array($file['mime'], [
|
||||||
'application/x-7z-compressed',
|
'application/x-7z-compressed',
|
||||||
|
@ -156,7 +160,9 @@
|
||||||
{{ $carbon->diffForHumans() }}
|
{{ $carbon->diffForHumans() }}
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<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>
|
<td class="min-size">
|
||||||
|
<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>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in a new issue