Files
eminuxandCursor b88f44ab1c Completa i18n IT/EN/FR/DE/ES su sito pubblico, area autenticata e admin.
Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 00:38:50 +02:00

90 lines
3.5 KiB
ERB

<% content_for :body_class, "admin-body" %>
<section class="kpi-grid">
<div class="kpi-card <%= @summary[:open_critical].positive? ? 'kpi-card--danger' : 'kpi-card--accent' %>">
<div class="kpi-label"><%= t("admin.ops.kpi.critical") %></div>
<div class="kpi-value"><%= @summary[:open_critical] %></div>
</div>
<div class="kpi-card">
<div class="kpi-label"><%= t("admin.ops.kpi.warning") %></div>
<div class="kpi-value"><%= @summary[:open_warning] %></div>
</div>
<div class="kpi-card">
<div class="kpi-label"><%= t("admin.ops.kpi.total") %></div>
<div class="kpi-value"><%= @summary[:open_total] %></div>
</div>
</section>
<div class="panel" style="margin-bottom:1.5rem">
<h2><%= t("admin.ops.open.title") %></h2>
<% if @open_incidents.any? %>
<table class="admin-table">
<thead>
<tr>
<th><%= t("admin.ops.open.table.severity") %></th>
<th><%= t("admin.ops.open.table.kind") %></th>
<th><%= t("admin.ops.open.table.title") %></th>
<th><%= t("admin.ops.open.table.occurrences") %></th>
<th><%= t("admin.ops.open.table.last_seen") %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @open_incidents.each do |inc| %>
<tr>
<td><span class="badge badge--<%= inc.severity == 'critical' ? 'live' : 'paused' %>"><%= inc.severity %></span></td>
<td class="muted"><%= inc.kind %></td>
<td>
<strong><%= inc.title %></strong>
<% if inc.message.present? %>
<div class="muted" style="font-size:0.85rem;margin-top:0.25rem"><%= truncate(inc.message, length: 120) %></div>
<% end %>
</td>
<td><%= inc.occurrence_count %></td>
<td class="muted"><%= inc.last_seen_at&.strftime("%d/%m %H:%M") %></td>
<td class="admin-actions">
<% unless inc.status == 'acknowledged' %>
<%= button_to t("admin.ops.actions.acknowledge"), acknowledge_admin_op_path(inc), method: :post, class: "admin-btn admin-btn--sm" %>
<% end %>
<%= button_to t("admin.ops.actions.resolve"), resolve_admin_op_path(inc), method: :post, class: "admin-btn admin-btn--sm" %>
<%= button_to t("admin.ops.actions.mute"), mute_admin_op_path(inc), method: :post, class: "admin-btn admin-btn--sm admin-btn--outline" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="empty"><%= t("admin.ops.open.none") %></p>
<% end %>
</div>
<div class="panel">
<h2><%= t("admin.ops.resolved.title") %></h2>
<% if @resolved_incidents.any? %>
<table class="admin-table">
<thead>
<tr>
<th><%= t("admin.ops.open.table.severity") %></th>
<th><%= t("admin.ops.open.table.kind") %></th>
<th><%= t("admin.ops.open.table.title") %></th>
<th><%= t("admin.ops.open.table.occurrences") %></th>
<th><%= t("admin.ops.resolved.table.resolved_at") %></th>
</tr>
</thead>
<tbody>
<% @resolved_incidents.each do |inc| %>
<tr>
<td><span class="badge badge--connecting"><%= inc.severity %></span></td>
<td class="muted"><%= inc.kind %></td>
<td><%= inc.title %></td>
<td><%= inc.occurrence_count %></td>
<td class="muted"><%= inc.updated_at.strftime("%d/%m %H:%M") %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="empty"><%= t("admin.ops.resolved.none") %></p>
<% end %>
</div>