// Environment
component {
resources {
component(name = SemVariaveisDoServico) {
text("{t('common.no_variables')}", class = u-muted)
}
}
column(class = env) {
row(class = env__head) {
text("{t('environment.variable_s', service_env_count=service_env_count)}", class = "u-muted u-fill")
button(class = "btn btn--ghost btn--wide", on_click = env_export, disabled = @busy_env_export, text = "{t('common.export')}")
text(" ")
if @env_text_open == "true" {
button(
class = "btn btn--blue btn--wide",
on_click = env_text_toggle,
disabled = @busy_env_text_toggle,
text = "{t('common.close')}",
)
} else {
button(class = tabs__tab, on_click = env_text_toggle, disabled = @busy_env_text_toggle, text = "{t('common.env')}")
}
}
form(
name = env_add,
on_submit = env_add,
on_validation_error = env_show_validation_errors,
class = "form form--gap-8",
) {
row(class = env__add) {
input(
class = env__input,
form_control = env_new_key,
rules = required,
msg = "{t('common.enter_the_key')}",
placeholder = "{t('common.key')}",
)
}
row(class = env__add) {
input(
class = env__input,
form_control = env_new_value,
placeholder = "{t('common.value')}",
)
}
row(class = env__add) {
button(type = submit, disabled = @busy_env_add, class = "btn btn--primary", text = "{t('common.add')}")
}
}
text(
"{t('environment.for_a_sensitive_value_use_a')}",
class = "u-muted u-fill",
)
text(
"@error_env_new_key",
if = @error_env_new_key,
not_equals = "",
class = u-error,
)
scrollable(direction = vertical, class = u-fill-all) {
column(class = kv-list) {
template(
:for-each = service_env,
var = e,
on_reorder = env_reorder,
reorder_key = key,
foreach_fallback = SemVariaveisDoServico,
) {
if @e.__dragging == "true" {
row(class = "kv-list__row kv-list__row--dragging", if = @e.kind, equals = comment) {
text(
"⋮ ",
class = "env__drag-handle env__drag-handle--dragging",
drag_handle = true,
)
text("@e.value", class = u-muted)
}
row(class = "kv-list__row kv-list__row--dragging", else) {
text(
"⋮ ",
class = "env__drag-handle env__drag-handle--dragging",
drag_handle = true,
)
button(
class = env__del,
on_click = env_delete:@e.key,
disabled = @busy_env_delete,
text = "✕",
)
text(class = env__sep)
text("@e.key_display", class = env__key)
text("@e.value", class = "kv-list__val kv-list__val--compact")
}
} else {
row(class = kv-list__row, if = @e.kind, equals = comment) {
text(
"⋮ ",
class = env__drag-handle,
drag_handle = true,
)
text("@e.value", class = u-muted)
}
row(class = kv-list__row, else) {
text(
"⋮ ",
class = env__drag-handle,
drag_handle = true,
)
button(
class = env__del,
on_click = env_delete:@e.key,
disabled = @busy_env_delete,
text = "✕",
)
text(class = env__sep)
text("@e.key_display", class = env__key)
text("@e.value", class = "kv-list__val kv-list__val--compact")
}
}
}
if @env_text_open == "true" {
text(
"{t('common.paste_edit_in_the_key')}",
class = u-muted,
)
textarea(
class = env__editor,
font = mono,
:value = service_env_text,
placeholder = "{t('common.key_value_comment')}",
)
row(class = env__add) {
button(
class = "btn btn--primary",
on_click = env_import,
disabled = @busy_env_import,
text = "{t('common.save')}",
)
button(
class = "btn btn--ghost",
on_click = env_text_cancel,
disabled = @busy_env_text_cancel,
text = "{t('common.cancel')}",
)
}
}
}
}
}
}