@extends("client.layouts.app") @section("title", __('client.hosting.files.title')) @section("content") @php use Illuminate\Support\Str; $home = $listing['home']; $cur = $listing['path']; $rel = trim(Str::startsWith($cur, $home) ? substr($cur, strlen($home)) : '', '/'); $segments = $rel === '' ? [] : explode('/', $rel); $parent = $cur !== $home ? dirname($cur) : null; if ($parent !== null && ! Str::startsWith($parent, $home)) { $parent = $home; } $editable = ['txt','text','md','markdown','html','htm','css','scss','js','mjs','ts','jsx','tsx','vue','json','xml','yml','yaml','ini','conf','cfg','env','log','sh','bash','sql','php','py','rb','go','java','c','cpp','h','htaccess','gitignore']; $fileRoute = fn($p) => route('client.services.files', ['service' => $service, 'path' => $p]); $count = $listing['ok'] ? count($listing['entries']) : 0; $iconFor = function($ext){ $map = ['php'=>['ri-code-s-slash-line','#8b5cf6'],'html'=>['ri-html5-line','#e34f26'],'htm'=>['ri-html5-line','#e34f26'], 'css'=>['ri-css3-line','#2965f1'],'scss'=>['ri-css3-line','#cf649a'],'js'=>['ri-javascript-line','#f0db4f'],'mjs'=>['ri-javascript-line','#f0db4f'], 'json'=>['ri-braces-line','#f59e0b'],'md'=>['ri-markdown-line','#64748b'],'sql'=>['ri-database-2-line','#0ea5e9'], 'zip'=>['ri-file-zip-line','#f59e0b'],'gz'=>['ri-file-zip-line','#f59e0b'],'tar'=>['ri-file-zip-line','#f59e0b'],'rar'=>['ri-file-zip-line','#f59e0b'], 'png'=>['ri-image-line','#10b981'],'jpg'=>['ri-image-line','#10b981'],'jpeg'=>['ri-image-line','#10b981'],'gif'=>['ri-image-line','#10b981'],'svg'=>['ri-image-line','#10b981'],'webp'=>['ri-image-line','#10b981'],'ico'=>['ri-image-line','#10b981'], 'pdf'=>['ri-file-pdf-2-line','#ef4444'],'log'=>['ri-file-list-2-line','#64748b'],'txt'=>['ri-file-text-line','#64748b'], 'env'=>['ri-key-2-line','#f59e0b'],'sh'=>['ri-terminal-box-line','#10b981'],'py'=>['ri-code-line','#3776ab']]; return $map[$ext] ?? ['ri-file-line','#94a3b8']; }; @endphp {{ $service->product?->name ?? __('client.services.title') }}

{{ __('client.hosting.files.title') }}

{{ __('client.hosting.files.subtitle') }}
{{ $count }} {{ __('client.hosting.files.items') }}
@if(! $listing['ok'])
{{ $listing['message'] ?: __('client.hosting.files.load_failed') }}
@else
@php($acc = $home) @foreach($segments as $seg)@php($acc = $acc.'/'.$seg)/{{ $seg }}@endforeach
{{ __('client.hosting.files.new_folder') }}
@csrf
{{ __('client.hosting.files.new_file') }}
@csrf
{{ __('client.hosting.files.uploading') }}
{{ __('client.hosting.files.drop_here') }}
@if($parent !== null) @endif @forelse($listing['entries'] as $e) @php($isFolder = ($e['type'] ?? '') === 'folder') @php($ext = strtolower($e['extension'] ?? pathinfo($e['name'] ?? '', PATHINFO_EXTENSION))) @php($canEdit = ! $isFolder && (in_array($ext, $editable, true) || (int)($e['size'] ?? 0) === 0)) @php($ic = $isFolder ? ['ri-folder-fill','#f6c343'] : $iconFor($ext)) @empty @endforelse
{{ __('client.hosting.files.name') }}{{ __('client.hosting.files.size') }} {{ __('client.hosting.files.modified') }}{{ __('client.hosting.files.permissions') }} {{ __('common.table.actions') }}
..
@if($isFolder){{ $e['name'] }}@else{{ $e['name'] }}@endif {{ $isFolder ? '—' : ($e['size_formatted'] ?? $e['size'] ?? '') }} {{ $e['modified_str'] ?? '' }} {{ $e['permissions_octal'] ?? '' }} @if(! $isFolder)@if($canEdit)@endif @endif
@csrf
@csrf
{{ __('client.hosting.files.empty') }}
@endif @endsection