rustploy-gui 0.1.21

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
component {
  scrollable(
    direction = vertical,
    class = u-fill-all,
  ) {
    column(class = service__main) {
      form(name = advanced, on_submit = advanced_save, class = form-panel) {
        text(class = u-label-cap, content = "REPLICAS")

        spinbox(
          field_class = field__spin,
          form_control = service_form_replicas,
          :value = service_form_replicas,
          min = 1,
          max = 20,
          width = 90,
          placeholder = 1,
        )

        text(class = u-label-cap, content = "RUN COMMAND")

        input(
          class = field__input,
          form_control = service_form_run_command,
          :value = service_form_run_command,
          on_change = field:service_form_run_command,
          placeholder = "(padrão da imagem)",
        )

        text(class = u-muted, content = "Run args atuais: @service_run_args")

        row(class = env__add) {
          button(class = "btn btn--primary", on_click = advanced_save, disabled = @busy_advanced_save, text = "Save")
          text(class = u-muted, content = "@service_action_message")
        }
      }

      column(class = form-panel) {
        text(
          class = u-label-cap,
          content = "FILA DE PRÉ-DEPLOY (@pre_deploy_checks_count)",
        )

        text(
          class = u-muted,
          content = """
            Roda esses Jobs em ORDEM antes do deploy (manual ou webhook),
            um de cada vez. Se o exit code de algum for diferente de 0, a
            fila para e o deploy não acontece — os checks seguintes não
            rodam. Arraste pelo ⋮ para reordenar. Cadastre jobs em
            Schedules.
          """,
        )

        scrollable(direction = vertical, class = u-fill-all) {
          column(class = kv-list, height = shrink) {
            template(
              :for-each = pre_deploy_checks,
              foreach_fallback = SemChecks,
              var = c,
              on_reorder = pre_deploy_check_reorder,
              reorder_key = id,
            ) {
              if @c.__dragging == "true" {
                row(class = "kv-list__row kv-list__row--dragging") {
                  text(
                    class = "env__drag-handle env__drag-handle--dragging",
                    drag_handle = true,
                    content = "⋮",
                  )

                  button(
                    class = env__del,
                    on_click = pre_deploy_check_delete:@c.id,
                    disabled = @busy_pre_deploy_check_delete,
                    text = "✕",
                  )

                  text(class = env__sep)
                  text(class = env__key, content = "@c.index.")
                  text(class = "kv-list__val kv-list__val--compact", content = "@c.name")
                }
              } else {
                row(class = kv-list__row) {
                  text(
                    class = env__drag-handle,
                    drag_handle = true,
                    content = "⋮",
                  )

                  button(
                    class = env__del,
                    on_click = pre_deploy_check_delete:@c.id,
                    disabled = @busy_pre_deploy_check_delete,
                    text = "✕",
                  )

                  text(class = env__sep)
                  text(class = env__key, content = "@c.index.")
                  text(class = "kv-list__val kv-list__val--compact", content = "@c.name")
                }
              }
            }
          }
        }

        text(class = u-label-cap, content = "ADICIONAR À FILA")

        select(
          class = form-select,
          :options = pre_deploy_available_jobs,
          :value = service_form_pre_deploy_check_add_job_id,
          on_change = field:service_form_pre_deploy_check_add_job_id,
          placeholder = "escolher job...",
          labelField = name,
          valueField = id,
        )

        row(class = env__add) {
          button(
            class = "btn btn--primary",
            on_click = pre_deploy_check_add,
            disabled = @busy_pre_deploy_check_add,
            text = "Adicionar à fila",
          )
        }
      }
    }
  }
}