rustploy-gui 0.1.0

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
component {
  scrollable(
    direction = vertical,
    class = scroll_fill,
  ) {
    column(class = svc_main) {
      form(name = advanced, on_submit = adv_save, class = form_panel) {
        text(class = label_cap, content = "REPLICAS")

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

        text(class = label_cap, content = "RUN COMMAND")

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

        text(class = muted, content = "Run args atuais: @svc_run_args")

        row(class = env_add) {
          button(class = btn_primary, on_click = adv_save, text = "Save")
          text(class = muted, content = "@svc_action_msg")
        }
      }

      column(class = form_panel) {
        text(
          class = label_cap,
          content = "FILA DE PRÉ-DEPLOY (@pre_deploy_checks_count)",
        )

        text(
          class = 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 = env_list_scroll) {
          column(class = kv_list, height = shrink) {
            template(
              :for-each = pre_deploy_checks,
              foreach_fallback = SemChecks,
              var = c,
              on_reorder = pdc_reorder,
              reorder_key = id,
            ) {
              if @c.__dragging == "true" {
                row(class = kv_row_drag) {
                  text(
                    class = "env_drag_handle env_dragging",
                    drag_handle = true,
                    content = "⋮",
                  )

                  button(
                    class = env_del,
                    on_click = pdc_del:@c.id,
                    text = "✕",
                  )

                  text(class = env_sep)
                  text(class = env_key, content = "@c.index.")
                  text(class = kv_val_fill, content = "@c.name")
                }
              } else {
                row(class = kv_row) {
                  text(
                    class = env_drag_handle,
                    drag_handle = true,
                    content = "⋮",
                  )

                  button(
                    class = env_del,
                    on_click = pdc_del:@c.id,
                    text = "✕",
                  )

                  text(class = env_sep)
                  text(class = env_key, content = "@c.index.")
                  text(class = kv_val_fill, content = "@c.name")
                }
              }
            }
          }
        }

        text(class = label_cap, content = "ADICIONAR À FILA")

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

        row(class = env_add) {
          button(
            class = btn_primary,
            on_click = pdc_add,
            text = "Adicionar à fila",
          )
        }
      }
    }
  }
}