ubicloud/views/project/token.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

51 lines
1.7 KiB
Text

<% @page_title = "#{@project.name} - Personal Access Tokens" %>
<%== part(
"components/page_header",
title: "Personal Access Tokens",
breadcrumbs: [%w[Projects /project], [@project.name, @project.path], ["Personal Access Tokens", "#"]],
right_items: [form(nil, {action: "#{@project.path}/token", method: :post, id: "create-pat"}, emit: false) do |f|
f << part("components/form/submit_button", text: "Create Token")
end]
) %>
<div class="grid gap-6">
<div class="md:flex md:items-center md:justify-between pb-1 lg:pb-2">
<div class="min-w-0 flex-1">
Personal access tokens are both account-specific and project-specific. You can use a separate access control
entries for each token, but be aware that regardless of the access permissions of the token, requests made using
the token cannot exceed the access permissions of your account.
</div>
</div>
<%== part(
"components/table_card",
headers: ["ID", "Token", ""],
empty_state: {
icon: "hero-key",
title: "No personal access token",
description: "Get started with the API by creating a personal access token."
},
rows:
@tokens.map do |token|
[
[
[token.ubid, { link: path(token) }],
["pat-#{token.ubid}-#{token.key}", { revealable: true, copyable: true }],
[
"delete_button",
{
component: {
text: "Remove",
url: "#{@project.path}/token/#{token.ubid}",
confirmation: "delete token"
},
extra_class: "flex justify-end"
}
]
],
{ id: "token-#{token.ubid}" }
]
end
) %>
</div>