mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Admin setting for the maximum upload size
- Admin -> Settings: maximum upload size per file (1-1024 MB, default 50), stored in a new settings table and read on each use, so a change applies to every process at once - Enforced by attachment validation and the direct-upload endpoint; upload forms, bulk upload and Admin -> About show the current limit - .sam.zip import accepts files up to 1 GB to match Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f548f3874
commit
ef7cd2efba
16 files changed
+186
-13
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<% content_for :title, "Settings" %>
|
||||
<h1 class="mb-4 text-2xl font-bold">Settings</h1>
|
||||
<%= form_with url: admin_settings_path, method: :patch, class: "card card-body max-w-xl space-y-4" do |f| %>
|
||||
<% if @errors.present? %>
|
||||
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert">
|
||||
<ul class="list-disc pl-5"><% @errors.each do |e| %><li><%= e %></li><% end %></ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h2 class="card-title">Uploads</h2>
|
||||
<% upload = Setting::INTEGERS["max_upload_mb"] %>
|
||||
<div>
|
||||
<%= label_tag "settings[max_upload_mb]", upload[:label], class: "label" %>
|
||||
<%= number_field_tag "settings[max_upload_mb]", @values["max_upload_mb"], id: "settings_max_upload_mb",
|
||||
min: upload[:in].min, max: upload[:in].max, step: 1, required: true, class: "input w-32" %>
|
||||
<p class="hint">
|
||||
The largest single file anyone can upload: documents, squawk photos and bulk uploads. Default <%= upload[:default] %> MB, up to <%= upload[:in].max %> MB.
|
||||
</p>
|
||||
<p class="hint">
|
||||
A proxy in front of the app can have its own, smaller limit. Cloudflare's proxy stops at 100 MB on its free plan; nginx needs <code>client_max_body_size</code>.
|
||||
Logbook transcription with Claude reads PDFs up to <%= LogbookTranscriber::MAX_PDF_BYTES / 1.megabyte %> MB and images up to <%= LogbookTranscriber::MAX_IMAGE_BYTES / 1.megabyte %> MB, whatever this is set to.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2"><%= f.submit "Save Settings", class: "btn-primary" %><%= link_to "Cancel", admin_about_path, class: "btn-secondary" %></div>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user