ubicloud/views/inference/api_key/index.erb
Jeremy Evans 750ebdc055 Change from erb_formatter to herb/formatter
Currently, herb/formatter has at least 4 bugs the prevent us from
switching to it (https://github.com/marcoroth/herb/issues 476, 477,
478, and 479). This includes manual fixes for each issue.

herb/formatter also introduces a rubocop violation for the
Layout/AssignmentIndentation cop. This disables that cop.
2025-09-05 14:01:01 -07:00

50 lines
1.4 KiB
Text

<% @page_title = "Inference API Keys" %>
<%== render("components/free_quota") %>
<%== render("inference/tabbar") %>
<div>
<%== part(
"components/table_card",
headers: ["ID", "API Key", ""],
empty_state: {
icon: "hero-key",
title: "No inference API keys",
description: "Get started using the inference endpoint by creating an API key."
},
rows:
@inference_api_keys.map do |token|
[
[
token.ubid,
[token.key, { revealable: true, copyable: true }],
(
if has_project_permission("InferenceApiKey:delete")
[
"delete_button",
{
component: {
text: "Delete",
url: path(token),
confirmation: "delete api key"
},
extra_class: "flex justify-end"
}
]
end
)
],
{ id: "api-key-#{token.ubid}" }
]
end
) %>
<% if has_project_permission("InferenceApiKey:create") && @inference_api_keys.size < 10 %>
<div class="flex justify-end space-y-1 mt-6">
<% form(action: "#{@project.path}/inference-api-key", method: :post, role: :form, id: "create-inference-api-key") do %>
<%== part("components/form/submit_button", text: "Create API Key") %>
<% end %>
</div>
<% end %>
</div>