Initial commit

This commit is contained in:
2025-11-20 23:21:05 +08:00
commit 13bc6db529
378 changed files with 54527 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
<x-app-layout>
<x-slot name="header">
<h2 class="text-xl font-semibold leading-tight text-gray-800">
系統設定 - 安全性與限制
</h2>
</x-slot>
<div class="py-12">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="grid grid-cols-1 gap-6 lg:grid-cols-4">
<!-- Sidebar -->
<div class="lg:col-span-1">
@include('admin.settings._sidebar')
</div>
<!-- Main Content -->
<div class="lg:col-span-3">
@if (session('status'))
<div class="mb-6 rounded-md bg-green-50 p-4">
<p class="text-sm font-medium text-green-800">{{ session('status') }}</p>
</div>
@endif
<div class="bg-white shadow sm:rounded-lg">
<div class="px-6 py-5 border-b border-gray-200">
<h3 class="text-lg font-medium text-gray-900">安全性與限制設定</h3>
<p class="mt-1 text-sm text-gray-600">配置下載速率限制和文件上傳限制</p>
</div>
<form action="{{ route('admin.settings.security.update') }}" method="POST" class="px-6 py-6 space-y-6">
@csrf
<!-- Rate Limit - Authenticated Users -->
<div>
<label for="rate_limit_authenticated" class="block text-sm font-medium text-gray-700">
已登入用戶下載限制(每小時)
</label>
<input type="number" name="rate_limit_authenticated" id="rate_limit_authenticated"
value="{{ old('rate_limit_authenticated', $settings['rate_limit_authenticated']) }}"
min="1" max="1000"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
required>
<p class="mt-1 text-sm text-gray-500">已登入用戶每小時可下載的文件次數</p>
@error('rate_limit_authenticated')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Rate Limit - Guest Users -->
<div>
<label for="rate_limit_guest" class="block text-sm font-medium text-gray-700">
訪客下載限制(每小時)
</label>
<input type="number" name="rate_limit_guest" id="rate_limit_guest"
value="{{ old('rate_limit_guest', $settings['rate_limit_guest']) }}"
min="1" max="1000"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
required>
<p class="mt-1 text-sm text-gray-500">未登入訪客每小時可下載的文件次數</p>
@error('rate_limit_guest')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Max File Size -->
<div>
<label for="max_file_size_mb" class="block text-sm font-medium text-gray-700">
檔案大小上限MB
</label>
<input type="number" name="max_file_size_mb" id="max_file_size_mb"
value="{{ old('max_file_size_mb', $settings['max_file_size_mb']) }}"
min="1" max="100"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
required>
<p class="mt-1 text-sm text-gray-500">單一文件上傳的最大檔案大小</p>
@error('max_file_size_mb')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Allowed File Types -->
<div>
<label for="allowed_file_types" class="block text-sm font-medium text-gray-700">
允許的檔案類型
</label>
<input type="text" name="allowed_file_types" id="allowed_file_types"
value="{{ old('allowed_file_types', implode(', ', $settings['allowed_file_types'])) }}"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
placeholder="pdf, doc, docx, xls, xlsx">
<p class="mt-1 text-sm text-gray-500">允許上傳的檔案副檔名,以逗號分隔</p>
@error('allowed_file_types')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Submit Button -->
<div class="flex items-center justify-end pt-4 border-t">
<button type="submit"
class="inline-flex justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
儲存變更
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>