Permette di scegliere 12 ore, 24 ore o la settimana nello storico invii.
CI / scan_ruby (push) Failing after 12m32s
CI / scan_js (push) Successful in 13m28s
CI / lint (push) Failing after 13m58s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-07 13:00:09 +02:00
co-authored by Cursor
parent 1c6b4bbabe
commit 353ace4d99
5 changed files with 138 additions and 26 deletions
+16 -5
View File
@@ -42,16 +42,27 @@
</div>
</div>
<div class="<%= card_class %> p-4">
<div class="text-xs uppercase tracking-wide text-zinc-500">Storico invio</div>
<div class="mt-2 flex items-end gap-0.5" style="height: 2.5rem" role="img" aria-label="Invii confermati nelle ultime 12 ore">
<% @hourly_throughput.hourly_history.each do |bucket| %>
<div class="flex items-center justify-between gap-1">
<div class="text-xs uppercase tracking-wide text-zinc-500">Storico invio</div>
<div class="inline-flex items-center gap-1">
<% Mailings::HourlyThroughput::RANGES.each do |key, config| %>
<% if @hourly_throughput.range_key == key %>
<span class="rounded-md bg-zinc-900 px-1.5 py-0.5 text-[10px] font-medium leading-none text-white dark:bg-zinc-100 dark:text-zinc-900"><%= config[:short] %></span>
<% else %>
<%= link_to config[:short], dashboard_mailings_path(history: key), class: "rounded-md px-1.5 py-0.5 text-[10px] font-medium leading-none text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800" %>
<% end %>
<% end %>
</div>
</div>
<div class="mt-2 flex items-end gap-0.5" style="height: 2.5rem" role="img" aria-label="Invii confermati, <%= @hourly_throughput.range[:label] %>">
<% @hourly_throughput.history.each do |bucket| %>
<% pct = (bucket[:count].to_f / @hourly_throughput.history_max * 100).round %>
<div class="flex-1 rounded <%= bucket[:count].positive? ? "bg-emerald-500" : "bg-zinc-200 dark:bg-zinc-700" %>"
style="height: <%= bucket[:count].positive? ? [pct, 12].max : 8 %>%"
title="<%= bucket[:at].strftime("%H:%M") %>: <%= bucket[:count] %>"></div>
title="<%= bucket[:label] %>: <%= bucket[:count] %>"></div>
<% end %>
</div>
<div class="mt-1 text-xs text-zinc-500"><%= @hourly_throughput.history_total %> inviate · ultime 12 ore</div>
<div class="mt-1 text-xs text-zinc-500"><%= @hourly_throughput.history_total %> inviate · <%= @hourly_throughput.range[:label] %></div>
</div>
<div class="<%= card_class %> p-4">
<div class="text-xs uppercase tracking-wide text-zinc-500">In pausa (fascia)</div>