rustploy-gui 0.1.21

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Deployments
component {
  resources {
    component(name = SemDeploysDoServico) {
      text(class = u-muted, content = "Nenhum deploy ainda.")
    }
  }

  column(class = deployments__wrap) {
    // Webhook de deploy: servido pelo MESMO listener da API (base
    // derivada de [api] domain/port). Compose não tem webhook.
    column(
      if = @service_webhook_supported,
      equals = true,
      class = form-panel,
    ) {
      text(class = u-label-cap, content = "WEBHOOK DE DEPLOY")

      column(if = @service_webhook_url, not_equals = "", class = webhook) {
        text(
          class = webhook__url,
          tooltip = @service_webhook_url,
          content = "@service_webhook_url_short",
        )

        row(class = webhook__actions) {
          button(
            class = "btn btn--ghost btn--xs",
            on_click = copy_ctx:service_webhook_url,
            text = Copiar,
          )

          button(
            class = "btn btn--danger btn--xs",
            on_click = regenerate_webhook,
            disabled = @busy_regenerate_webhook,
            text = Regenerar,
          )
        }
      }

      text(
        if = @service_webhook_url,
        equals = "",
        class = u-muted,
        content = """
          O token nasce no primeiro deploy deste serviço — rode um deploy
          para a URL aparecer.
        """,
      )

      text(
        class = u-muted,
        content = """
          Um POST nesta URL dispara um deploy. O corpo é ignorado: o token
          na própria URL é a autenticação. Regenerar invalida a URL
          anterior.
        """,
      )
    }

    text(class = u-muted, content = "@service_deployments_count deployments")

    scrollable(direction = vertical, class = deployments__list-scroll) {
      column(class = u-fill) {
        each @service_deployments as d (fallback = SemDeploysDoServico) {
          column(class = u-fill) {
            row(class = table__row) {
              text(class = "table__cell table__cell--key table__col-dep-id", content = "@d.id")
              StateCell(kind = @d.state_kind, label = @d.state_label)
              text(class = "table__cell table__col-dur", content = "@d.duration")
              text(class = "u-muted table__col-dep-start", content = "@d.start")

              row(class = deployments__actions) {
                button(
                  class = "btn btn--ghost btn--xs",
                  on_click = deployment_logs:@d.id_full,
                  disabled = @busy_deployment_logs,
                  text = "≡",
                  tooltip = "Ver build log",
                )

                button(
                  if = @d.can_delete,
                  equals = 1,
                  class = "btn btn--danger btn--xs",
                  on_click = delete_deployment:@d.id_full,
                  disabled = @busy_delete_deployment,
                  text = "✕",
                  tooltip = "Remover deployment",
                )
              }
            }

            text(class = deployments__image, content = "@d.image")
            hr
          }
        }
      }
    }
  }
}