ubicloud/views/inference/api_key/index.erb
Jeremy Evans c1b0a1e982 Remove role="form" attribute on form tags
It is redundant. role="form" should be set on non-form tags that
operate as forms, and if a form tag is used that doesn't operate as a
form, you could potentially use a different role, but the assumption
is that a form tag has a form role, so there is no benefit to being
explicit about it.
2025-09-09 02:36:02 +09:00

48 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, id: "create-inference-api-key") do %>
<%== part("components/form/submit_button", text: "Create API Key") %>
<% end %>
</div>
<% end %>
</div>