rustploy-gui 0.1.13

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Aba "Executando" do Deploy Engine; importada por deploy_engine.gvb.
component {
  resources {
    component(name = SemDeployAtivo) {
      text(class = empty-state, content = "Nenhum deploy em andamento.")
    }
  }

  column(class = u-fill) {
    column(class = section) {
      row(class = section__head) {
        text(
          class = section__title,
          content = "EXECUTANDO AGORA (@deploy_engine_active_count)",
        )
      }

      column(class = section__body) {
        row(class = table__head, if = @deploy_engine_active, not_empty) {
          text(class = "table__head-cell table__col-svc", content = "SERVIÇO")
          text(class = "table__head-cell table__col-proj", content = "PROJETO")
          text(class = "table__head-cell table__col-state", content = "ESTADO")
          text(class = "table__head-cell table__col-dur", content = "TOTAL")
          text(class = "table__head-cell table__col-start", content = "FASE")
          text(class = "table__head-cell table__col-act")
        }

        if @data_loading == "true" {
          LoadingRow
        }

        column(if = @data_loading, not_equals = true, class = u-fill) {
          each @deploy_engine_active as a (fallback = SemDeployAtivo) {
            column(class = u-fill) {
              row(class = table__row) {
                text(class = "table__cell table__cell--key table__col-svc", content = "@a.service")
                text(class = "table__cell table__col-proj", content = "@a.project")
                StateCell(kind = @a.state_kind, label = @a.state_label)

                text(class = "u-muted table__col-dur", content = "@a.total")
                text(class = "u-muted table__col-start", content = "@a.phase")

                button(
                  class = "btn btn--ghost btn--xs",
                  on_click = deploy_engine_open_detail:@a.service_id,
                  disabled = @busy_deploy_engine_open_detail,
                  text = Detalhes,
                )

                // Mata o deploy em andamento na hora (DeployAbort): derruba o
                // build e marca o deployment como Failed.
                button(
                  class = env__del,
                  on_click = queue_cancel:@a.deployment_id,
                  disabled = @busy_queue_cancel,
                  text = "■",
                  tooltip = "Abortar deploy",
                )
              }

              row(class = stepper) {
                each @a.steps as st {
                  text(class = "stepper__step stepper__step--@st.status", content = "@st.text")
                }
              }

              hr
            }
          }
        }
      }
    }

    popup(value = deploy_engine_detail_open, trigger = none, onClose = deploy_engine_close_detail) {
      column(class = "panel panel--round detail") {
        row(class = detail__head) {
          text(class = detail__title, content = "Deploy · @deploy_engine_detail_title")

          button(class = "btn btn--ghost btn--xs", on_click = deploy_engine_close_detail, disabled = @busy_deploy_engine_close_detail, text = Fechar)
        }

        row(class = stepper) {
          each @deploy_engine_detail_steps as st {
            text(class = "stepper__step stepper__step--@st.status", content = "@st.text")
          }
        }

        // Sem `sort`: as etapas ficam na ordem em que aconteceram.
        tableview(
          :items = deploy_engine_detail_rows,
          var = d,
          header_class = "table__head table__head-cell",
          row_class = "table__row table__cell table__row--divided",
          class = u-fill-all,
        ) {
          tablecolumn(label = ESTADO, class = table__col-state) {
            row(class = "state-cell state-cell--@d.kind") {
              text(class = state-cell__label, content = "@d.label")
            }
          }

          tablecolumn(label = "DURAÇÃO", class = table__col-dur) {
            text(class = u-muted, content = "@d.dur")
          }

          tablecolumn(label = MENSAGEM, class = table__col-start) {
            text(class = u-muted, content = "@d.msg")
          }
        }
      }
    }
  }
}