component {
scrollable(direction = vertical, class = u-fill-all) {
column(class = form-stack) {
column(class = "form-panel form-panel--grouped") {
column(class = form-panel__head) {
text("{t('settings_recover.title')}", class = u-label-cap)
text("{t('settings_recover.intro')}", class = u-muted)
}
column(
class = form-panel__body,
if = @recover_services_count,
equals = 0
) {
field(description = "{t('settings_recover.load_file_hint')}") {
row(class = form-panel__actions) {
button(
"{t('settings_recover.load_file')}",
class = "btn btn--ghost",
on_click = recover_load_kit,
disabled = @busy_recover_load_kit
)
}
}
text(
"@recover_message",
if = @recover_message,
not_equals = "",
class = u-muted
)
field(
label = "{t('settings_recover.repository')}",
label_class = u-label-cap
) {
input(
placeholder = "https://github.com/org/rustploy-estado.git",
class = "field__input u-mono",
form_control = recover_remote,
:value = recover_remote,
on_change = field:recover_remote,
)
}
field(
label = "{t('settings_recover.token')}",
label_class = u-label-cap
) {
input(
placeholder = "",
secure = true,
class = field__input,
form_control = recover_token,
:value = recover_token,
on_change = field:recover_token,
)
}
field(
label = "{t('settings_recover.branch')}",
label_class = u-label-cap
) {
input(
placeholder = "main",
class = field__input,
form_control = recover_branch,
:value = recover_branch,
on_change = field:recover_branch,
)
}
field(
label = "{t('settings_recover.key')}",
label_class = u-label-cap,
description = "{t('settings_recover.key_hint')}",
) {
input(
placeholder = "AGE-SECRET-KEY-1…",
secure = true,
class = "field__input u-mono",
form_control = recover_key,
:value = recover_key,
on_change = field:recover_key,
)
}
row(class = form-panel__actions) {
button(
"{t('settings_recover.restore_infra')}",
class = "btn btn--primary",
on_click = recover_start,
disabled = @busy_recover_start
)
}
}
column(spacing = 6, if = @recover_services_count, not_equals = 0) {
text(
"{t('settings_recover.found', recover_projects=recover_projects)}",
class = u-label-cap,
)
text(
"@recover_destination_error",
if = @recover_destination_error,
not_equals = "",
class = u-error
)
each @recover_services as r {
row(class = kv-list__row) {
text("@r.kind", class = env__key)
text("@r.who", class = kv-list__val)
text("@r.backup", class = u-muted)
text("@r.step", class = u-muted)
}
}
text(
"{t('settings_recover.ready_hint')}",
if = @recover_phase,
equals = ready,
class = u-muted
)
text(
"{t('settings_recover.running')}",
if = @recover_phase,
equals = running,
class = u-muted
)
text(
"{t('settings_recover.done')}",
if = @recover_phase,
equals = done,
class = u-muted
)
text(
"@recover_message",
if = @recover_message,
not_equals = "",
class = u-error
)
row(
class = form-panel__actions,
if = @recover_phase,
equals = ready
) {
button(
"{t('settings_recover.restore_data')}",
class = "btn btn--primary",
on_click = recover_run,
disabled = @busy_recover_run
)
button(
"{t('common.cancel')}",
class = "btn btn--ghost",
on_click = recover_cancel,
disabled = @busy_recover_cancel
)
}
}
}
}
}
}