Added pdf analyzer

Analyzer should be moved to ActiveStorage::Analyzer
First there are many bugs with ActiveStorage that needs to be fixed:
Files are not deleted if job is destroyed (dependent: :purge is set)
If a new file is uploaded the old file is not deleted
(has_one_attechment)
This commit is contained in:
2024-08-08 13:56:36 +02:00
parent 19cf60c9a9
commit 616bd0cbe7
7 changed files with 139 additions and 14 deletions

View File

@@ -5,13 +5,16 @@
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap"> <%= job.fullname %> </td>
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
<% if job.pdf.attached? %>
<%= job.pdf.filename %><span class="p-1.5 bg-gray-300 font-medium rounded-lg ml-2"><%=number_to_human_size job.pdf.blob.byte_size%></span>
<%#= link_to job.pdf.filename, rails_blob_path(job.pdf, disposition: "attachment") %>
<%= link_to job.pdf.filename, job.pdf, download:true %>
<span class="p-1.5 bg-gray-300 font-medium rounded-lg ml-2"><%=number_to_human_size job.pdf.blob.byte_size%></span>
<% end %>
</td>
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap"><span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg"><%= job.number_of_plans_a0 %></span></td>
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap"><span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg"><%= job.number_of_plans_a1 %></span></td>
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap"><span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg"><%= job.number_of_plans_a2 %></span></td>
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap"><span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg"><%= job.number_of_plans_a3 %></span></td>
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap"><span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg"><%= job.costum_qm_plan.round(2) %></span></td>
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 text-xs font-medium uppercase tracking-wider bg-opacity-50 text-status-<%= job.status.to_sym %> bg-status-<%= job.status %>-light rounded-lg"><%= job.status %></span>
</td>

View File

@@ -17,6 +17,7 @@
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A2 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A3 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> qm </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> Status </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> Actions </th>
</tr>