2016-01-24 02:30:03 +00:00
|
|
|
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
2016-01-20 20:56:40 +00:00
|
|
|
|
2016-01-24 02:30:03 +00:00
|
|
|
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
|
|
|
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
|
|
|
{{-- in the Software without restriction, including without limitation the rights --}}
|
|
|
|
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
|
|
|
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
|
|
|
{{-- furnished to do so, subject to the following conditions: --}}
|
2016-01-20 20:56:40 +00:00
|
|
|
|
2016-01-24 02:30:03 +00:00
|
|
|
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
|
|
|
{{-- copies or substantial portions of the Software. --}}
|
2016-01-20 20:56:40 +00:00
|
|
|
|
2016-01-24 02:30:03 +00:00
|
|
|
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
|
|
|
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
|
|
|
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
|
|
|
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
|
|
|
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
|
|
|
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
|
|
|
{{-- SOFTWARE. --}}
|
2016-10-02 03:09:55 +00:00
|
|
|
<table class="table table-hover" id="file_listing">
|
2015-12-06 18:58:49 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2016-10-21 22:09:35 +00:00
|
|
|
<th style="width:2%;text-align:center;"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th>
|
2016-12-02 00:11:48 +00:00
|
|
|
<th style="width:55%">File Name</th>
|
2015-12-06 18:58:49 +00:00
|
|
|
<th style="width:15%">Size</th>
|
|
|
|
<th style="width:20%">Last Modified</th>
|
2016-12-02 00:11:48 +00:00
|
|
|
<th style="width:8%"></th>
|
2016-10-02 03:09:55 +00:00
|
|
|
</tr>
|
2016-10-06 23:39:45 +00:00
|
|
|
<tr id="headerTableRow" data-currentdir="{{ $directory['header'] }}">
|
2016-10-02 03:09:55 +00:00
|
|
|
<th><i class="fa fa-folder-open"></i></th>
|
2016-12-02 00:11:48 +00:00
|
|
|
<th colspan="4">
|
2016-10-02 03:09:55 +00:00
|
|
|
<code>/home/container{{ $directory['header'] }}</code>
|
|
|
|
<small>
|
|
|
|
<a href="/server/{{ $server->uuidShort }}/files/add/@if($directory['header'] !== '')?dir={{ $directory['header'] }}@endif" class="text-muted">
|
|
|
|
<i class="fa fa-plus" data-toggle="tooltip" data-placement="top" title="Add New File(s)"></i>
|
|
|
|
</a>
|
|
|
|
</small>
|
|
|
|
</th>
|
2015-12-06 18:58:49 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2016-10-28 22:21:12 +00:00
|
|
|
<tbody id="append_files_to">
|
2015-12-06 18:58:49 +00:00
|
|
|
@if (isset($directory['first']) && $directory['first'] === true)
|
2016-10-01 19:40:38 +00:00
|
|
|
<tr data-type="disabled">
|
2016-10-02 03:09:55 +00:00
|
|
|
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
2016-10-01 18:34:18 +00:00
|
|
|
<td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">←</a></a></td>
|
2015-12-06 18:58:49 +00:00
|
|
|
<td></td>
|
|
|
|
<td></td>
|
2016-12-02 00:11:48 +00:00
|
|
|
<td></td>
|
2015-12-06 18:58:49 +00:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@if (isset($directory['show']) && $directory['show'] === true)
|
2016-10-01 19:40:38 +00:00
|
|
|
<tr data-type="disabled">
|
2016-10-02 03:09:55 +00:00
|
|
|
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
|
|
|
<td data-name="{{ rawurlencode($directory['link']) }}">
|
|
|
|
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">← {{ $directory['link_show'] }}</a>
|
|
|
|
</td>
|
2015-12-06 18:58:49 +00:00
|
|
|
<td></td>
|
|
|
|
<td></td>
|
2016-12-02 00:11:48 +00:00
|
|
|
<td></td>
|
2015-12-06 18:58:49 +00:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@foreach ($folders as $folder)
|
2016-10-02 03:09:55 +00:00
|
|
|
<tr class="align-middle" data-type="folder">
|
|
|
|
<td data-identifier="type"><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/">
|
2016-10-01 19:40:38 +00:00
|
|
|
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
|
|
|
|
</td>
|
2016-10-01 18:34:18 +00:00
|
|
|
<td data-identifier="size">{{ $folder['size'] }}</td>
|
2016-10-28 20:34:23 +00:00
|
|
|
<td data-identifier="modified">
|
|
|
|
<?php $carbon = Carbon::createFromTimestamp($folder['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
|
|
|
|
@if($carbon->diffInMinutes(Carbon::now()) > 60)
|
|
|
|
{{ $carbon->format('m/d/y H:i:s') }}
|
|
|
|
@elseif($carbon->diffInSeconds(Carbon::now()) < 5 || $carbon->isFuture())
|
|
|
|
<em>seconds ago</em>
|
|
|
|
@else
|
|
|
|
{{ $carbon->diffForHumans() }}
|
|
|
|
@endif
|
|
|
|
</td>
|
2017-01-03 21:47:33 +00:00
|
|
|
<td><button class="btn btn-xxs btn-default" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h"></i></button></td>
|
2015-12-06 18:58:49 +00:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
@foreach ($files as $file)
|
2016-10-01 19:40:38 +00:00
|
|
|
<tr class="align-middle" data-type="file" data-mime="{{ $file['mime'] }}">
|
2016-10-02 03:09:55 +00:00
|
|
|
<td data-identifier="type">
|
|
|
|
{{-- oh boy --}}
|
|
|
|
@if(in_array($file['mime'], [
|
|
|
|
'application/x-7z-compressed',
|
|
|
|
'application/zip',
|
|
|
|
'application/x-compressed-zip',
|
|
|
|
'application/x-tar',
|
|
|
|
'application/x-gzip',
|
|
|
|
'application/x-bzip',
|
|
|
|
'application/x-bzip2',
|
|
|
|
'application/java-archive'
|
|
|
|
]))
|
|
|
|
<i class="fa fa-file-archive-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(in_array($file['mime'], [
|
|
|
|
'application/json',
|
|
|
|
'application/javascript',
|
|
|
|
'application/xml',
|
|
|
|
'application/xhtml+xml',
|
|
|
|
'text/xml',
|
|
|
|
'text/css',
|
|
|
|
'text/html',
|
|
|
|
'text/x-perl',
|
|
|
|
'text/x-shellscript'
|
|
|
|
]))
|
|
|
|
<i class="fa fa-file-code-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(starts_with($file['mime'], 'image'))
|
|
|
|
<i class="fa fa-file-image-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(starts_with($file['mime'], 'video'))
|
|
|
|
<i class="fa fa-file-video-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(starts_with($file['mime'], 'video'))
|
|
|
|
<i class="fa fa-file-audio-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(starts_with($file['mime'], 'application/vnd.ms-powerpoint'))
|
|
|
|
<i class="fa fa-file-powerpoint-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(in_array($file['mime'], [
|
|
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
|
|
|
'application/msword'
|
|
|
|
]) || starts_with($file['mime'], 'application/vnd.ms-word'))
|
|
|
|
<i class="fa fa-file-word-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif(in_array($file['mime'], [
|
|
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
|
|
|
|
]) || starts_with($file['mime'], 'application/vnd.ms-excel'))
|
|
|
|
<i class="fa fa-file-excel-o" style="margin-left: 2px;"></i>
|
|
|
|
@elseif($file['mime'] === 'application/pdf')
|
|
|
|
<i class="fa fa-file-pdf-o" style="margin-left: 2px;"></i>
|
|
|
|
@else
|
|
|
|
<i class="fa fa-file-text-o" style="margin-left: 2px;"></i>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td data-identifier="name" data-name="{{ rawurlencode($file['entry']) }}" data-path="@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}@endif/">
|
|
|
|
@if(in_array($file['mime'], $editableMime))
|
2016-01-09 03:42:33 +00:00
|
|
|
@can('edit-files', $server)
|
2016-01-18 03:54:03 +00:00
|
|
|
<a href="/server/{{ $server->uuidShort }}/files/edit/@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}" class="edit_file">{{ $file['entry'] }}</a>
|
2015-12-06 18:58:49 +00:00
|
|
|
@else
|
|
|
|
{{ $file['entry'] }}
|
|
|
|
@endcan
|
|
|
|
@else
|
|
|
|
{{ $file['entry'] }}
|
|
|
|
@endif
|
|
|
|
</td>
|
2016-10-01 19:40:38 +00:00
|
|
|
<td data-identifier="size">{{ $file['size'] }}</td>
|
2016-10-28 20:34:23 +00:00
|
|
|
<td data-identifier="modified">
|
|
|
|
<?php $carbon = Carbon::createFromTimestamp($file['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
|
|
|
|
@if($carbon->diffInMinutes(Carbon::now()) > 60)
|
|
|
|
{{ $carbon->format('m/d/y H:i:s') }}
|
|
|
|
@elseif($carbon->diffInSeconds(Carbon::now()) < 5 || $carbon->isFuture())
|
|
|
|
<em>seconds ago</em>
|
|
|
|
@else
|
|
|
|
{{ $carbon->diffForHumans() }}
|
|
|
|
@endif
|
|
|
|
</td>
|
2017-01-03 21:47:33 +00:00
|
|
|
<td><button class="btn btn-xxs btn-default" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h"></i></button></td>
|
2015-12-06 18:58:49 +00:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|