Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

2.2 KB
Raw Blame
<%# The organisation's RESOLVED chat routing (Admin::AiRoutingSummary): which
    credential the org's AI calls actually reach, plus the model behind it.
    Shared by the table row and the detail card so both name the same thing —
    a second rendering is how the badge and the card start disagreeing. %>
<div>
  <% case summary.source %>
  <% when :package %>
    <span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-blue-100 text-blue-800 border border-blue-300">
      <%= t('.source_package') %>
    </span>
  <% when :byok %>
    <span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-purple-100 text-purple-800 border border-purple-300">
      <%= t('.source_byok') %>
    </span>
  <% when :system %>
    <span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300">
      <%= t('.source_system') %>
    </span>
  <% else %>
    <span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-red-100 text-red-800 border border-red-300">
      <i class="bi bi-exclamation-triangle mr-1"></i><%= t('.source_none') %>
    </span>
  <% end %>

  <% if summary.label.present? %>
    <div class="text-xs font-medium text-gray-800 mt-1">
      <%= summary.label %>
      <%# The credential is named but cannot serve chat (disabled, wrong purpose,
          no endpoint) — every call raises. Shown here because this is the only
          screen that lists the resolution at all. %>
      <% if summary.broken %>
        <span class="text-red-700" title="<%= t('.broken_hint') %>">
          <i class="bi bi-exclamation-triangle-fill"></i>
        </span>
      <% end %>
    </div>
  <% end %>

  <%# No model line without a resolution: "Standardmodell des Anbieters" under a
      "Kein Credential" badge would read as a working fallback that does not exist. %>
  <% unless summary.source == :none %>
    <div class="text-xs text-gray-500">
      <%= summary.model.presence || t('.model_default') %>
    </div>
  <% end %>

  <% if summary.package.present? %>
    <div class="text-xs text-gray-500">
      <%= summary.package.name %><%= " · #{summary.tier.label}" if summary.tier&.label.present? %>
    </div>
  <% end %>
</div>