add temporary file manager
This commit is contained in:
46
resources/views/files/index.blade.php
Normal file
46
resources/views/files/index.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="bg-white p-6 rounded-xl shadow-md space-y-4">
|
||||
<h1 class="text-2xl font-bold text-gray-800">Временная ссылка на файл</h1>
|
||||
|
||||
@if (!$enabled)
|
||||
<div class="p-3 bg-yellow-50 text-yellow-800 rounded-lg text-sm">
|
||||
Функция отключена конфигом (`FILE_LINKS_ENABLED=false`).
|
||||
</div>
|
||||
@else
|
||||
@if ($errors->any())
|
||||
<div class="p-3 bg-red-50 text-red-700 rounded-lg text-sm">
|
||||
{{ $errors->first() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('file_link'))
|
||||
<div class="p-3 bg-green-50 text-green-800 rounded-lg text-sm break-all">
|
||||
<p class="mb-2"><strong>Ссылка готова:</strong></p>
|
||||
<p>
|
||||
<a href="{{ session('file_link') }}" class="text-blue-600 hover:underline" target="_blank">
|
||||
{{ session('file_link') }}
|
||||
</a>
|
||||
</p>
|
||||
<p class="mt-2">Действует до: {{ session('file_expires_at') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('files.upload') }}" enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="file" class="block text-gray-700 mb-1">Выберите файл</label>
|
||||
<input id="file" type="file" name="file" required
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
||||
</div>
|
||||
|
||||
<button type="submit"
|
||||
class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2.5 px-4 rounded-lg transition">
|
||||
Загрузить и получить ссылку
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen flex flex-col">
|
||||
<header class="border-b bg-white">
|
||||
<div class="container mx-auto px-4 py-3 max-w-2xl flex justify-between items-center">
|
||||
<a href="/" class="font-semibold text-gray-800">Poker Planning</a>
|
||||
<a href="{{ route('files.index') }}" class="text-sm text-blue-600 hover:underline">Файлы</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="container mx-auto px-4 py-8 max-w-2xl flex-grow">
|
||||
@yield('content')
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user