// Aba Secrets do projeto; a condição de carregamento vai na chamada.
component {
resources {
// Estados vazios das abas Secrets e Jobs do projeto (`fallback` do <foreach>).
component(name = SemSecretsNoProjeto) {
text("{t('project_secrets.no_secret_in_this_project')}", class = u-muted)
}
}
scrollable(
direction = vertical,
class = u-fill-all,
if = @project_loading,
not_equals = true,
) {
column(class = env--flow) {
column(class = webhook) {
text(
"{t('project_secrets.sensitive_values_tokens_passwords_api_keys')}",
class = "u-muted u-fill",
)
text(
"{t('project_secrets.to_use_it_in_a_service')}",
class = "u-muted u-fill",
)
text(
"{t('project_secrets.the_real_value_is_only_decrypted')}",
class = "u-muted u-fill",
)
}
form(
name = secret_add,
on_submit = secret_add,
on_validation_error = secret_add_show_validation_errors,
class = "form form--gap-8",
) {
row(class = env__add) {
input(
class = env__input,
form_control = project_secret_new_name,
rules = required,
msg = "{t('common.enter_a_name')}",
placeholder = "{t('common.name')}",
)
}
text(
"@error_project_secret_new_name",
class = u-error,
if = @error_project_secret_new_name,
not_empty,
)
row(class = env__add) {
input(
class = env__input,
form_control = project_secret_new_value,
rules = required,
msg = "{t('project_secrets.enter_a_value')}",
placeholder = "{t('project_secrets.value_encrypted_on_save')}",
)
}
text(
"@error_project_secret_new_value",
class = u-error,
if = @error_project_secret_new_value,
not_empty,
)
row {
button(
type = submit,
disabled = @busy_secret_add,
class = "btn btn--primary",
text = "{t('project_secrets.save_secret')}",
)
}
}
hr
column(class = kv-list) {
each @project_secrets as s (fallback = SemSecretsNoProjeto) {
row(class = kv-list__row) {
button(
class = env__del,
on_click = secret_delete:@s.name,
disabled = @busy_secret_delete,
text = "✕",
)
text(class = env__sep)
text("@s.name_display", class = env__key)
text("{t('project_secrets.encrypted')}", class = "kv-list__val kv-list__val--compact")
}
}
}
}
}
}