// Domains (editável): lista de rotas HTTP (domínio → porta de container,
// TLS por rota), mais o form de adição e a porta TCP crua do host.
component {
resources {
component(name = SemDominios) {
text(class = u-muted, content = "Nenhum domínio configurado.")
}
}
column(class = form-panel) {
text(class = u-label-cap, content = "DOMÍNIOS (@service_domains_count)")
text(
class = u-muted,
content = """
Cada domínio pode apontar para uma porta de container diferente.
""",
)
scrollable(direction = vertical, class = u-fill-all) {
column(class = kv-list) {
each @service_domains as d (fallback = SemDominios) {
row(class = kv-list__row) {
button(
class = env__del,
on_click = domain_delete:@d.domain,
disabled = @busy_domain_delete,
text = "✕",
)
text(class = env__sep)
text(class = env__key, content = "@d.domain")
text(class = "kv-list__val kv-list__val--compact", content = "→ @d.port")
text(class = u-muted, content = "@d.tls_label")
}
}
}
}
text(class = u-label-cap, content = "ADICIONAR DOMÍNIO")
input(
class = field__input,
form_control = service_form_domain,
:value = service_form_domain,
on_change = field:service_form_domain,
placeholder = app.exemplo.com,
)
text(
if = @error_service_form_domain,
not_equals = "",
class = u-error,
content = "@error_service_form_domain",
)
text(class = u-label-cap, content = "PORTA DO CONTAINER (opcional)")
input(
class = field__input,
form_control = service_form_port,
:value = service_form_port,
on_change = field:service_form_port,
placeholder = "(padrão do serviço)",
)
text(
if = @error_service_form_port,
not_equals = "",
class = u-error,
content = "@error_service_form_port",
)
toggle(
:checked = service_form_tls,
on_toggle = field:service_form_tls,
label = " HTTPS / TLS",
)
row(class = env__add) {
button(
class = "btn btn--primary",
on_click = domain_add,
disabled = @busy_domain_add,
text = "Adicionar domínio",
)
text(class = u-muted, content = "@service_action_message")
}
text(
class = u-label-cap,
content = "PORTA TCP DO HOST (passthrough, opcional)",
)
input(
class = field__input,
form_control = service_form_host_port,
:value = service_form_host_port,
on_change = field:service_form_host_port,
placeholder = "(padrão do serviço)",
)
text(
if = @error_service_form_host_port,
not_equals = "",
class = u-error,
content = "@error_service_form_host_port",
)
row(class = env__add) {
button(
class = "btn btn--ghost",
on_click = domain_hostport_save,
disabled = @busy_domain_hostport_save,
text = "Salvar porta",
)
button(
class = "btn btn--ghost",
on_click = domain_hostport_auto,
disabled = @busy_domain_hostport_auto,
text = Automática,
)
}
text(
class = u-muted,
content = """
"Automática" aloca uma porta livre e a libera no firewall do host.
""",
)
}
}