rustploy-gui 0.1.21

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// General (source / build, editável)
component {
  resources {
    link(rel = import, href = "general_compose.gvb", as = GeneralCompose)
    link(rel = import, href = "general_git.gvb", as = GeneralGit)
    link(rel = import, href = "general_zip.gvb", as = GeneralZip)
    link(rel = import, href = "general_gitea.gvb", as = GeneralGitea)
  }

  scrollable(
    direction = vertical,
    class = u-fill-all,
  ) {
    // O scrollable só renderiza o PRIMEIRO filho: os forms ficam numa coluna.
    column(width = fill, spacing = 12) {
      column(class = form-panel, if = @service_loading, equals = true) {
        if @service_loading == "true" {
          LoadingRow(note = "Carregando dados do serviço…")
        }
      }

      form(
        class = form-panel,
        if = @service_loading,
        not_equals = true,
        name = service_rename,
        on_submit = save_service_name,
        on_validation_error = service_rename_show_validation_errors,
        spacing = 6,
      ) {
        text(class = u-label-cap, content = "NOME DO SERVIÇO")

        row(class = env__add) {
          input(
            class = field__input,
            form_control = edit_service_name,
            rules = required,
            msg = "informe um nome",
            placeholder = "Nome do serviço",
          )

          button(type = submit, disabled = @busy_save_service_name, class = "btn btn--primary", text = Renomear)
        }

        text(
          class = u-error,
          if = @error_edit_service_name,
          not_empty,
          content = "@error_edit_service_name",
        )

        text(class = u-muted, content = "@service_rename_note")
      }

      form(
        class = form-panel,
        if = @service_loading,
        not_equals = true,
        name = general,
        on_submit = general_save,
      ) {
        // Serviços Compose (bancos/brokers) editam o YAML direto; não têm
        // provider Git/Registry.
        if @service_source_kind == "Compose" {
          GeneralCompose
        }

        // Provider Git/conta-conectada/Zip — apenas para serviços não-Compose.
        if @service_source_kind != "Compose" {
          text(class = u-label-cap, content = "PROVIDER")

          scroll(class = tabs__scroll, direction = horizontal) {
            row(class = tabs__main) {
              TabButton(
                label = Git,
                current = @provider_tab,
                target = git,
                action = select_provider_tab:git,
              )

              template(if = @gitea_providers, not_empty) {
                TabButton(
                  label = "Gitea/GitHub",
                  current = @provider_tab,
                  target = gitea,
                  action = select_provider_tab:gitea,
                )
              }

              TabButton(
                label = Zip,
                current = @provider_tab,
                target = zip,
                action = select_provider_tab:zip,
              )
            }
          }

          hr

          // ── Sub-aba Git: form de URL/imagem crua ───────────────
          if @provider_tab == "git" {
            GeneralGit
          }

          // ── Sub-aba Zip: upload de arquivo local com Dockerfile na raiz ─
          if @provider_tab == "zip" {
            GeneralZip
          }

          // ── Sub-aba conta conectada (Gitea/GitHub): picker conta/repo/branch ─
          if @provider_tab == "gitea" {
            GeneralGitea
          }
        }
      }
    }
  }
}