rustploy-gui 0.1.36

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Containers — um por serviço gerido pelo Rustploy (ligação com
// projeto/serviço é direta, já que o container nasce de um Service).
component {
  resources {
    component(name = SemContainersDocker) {
      text("{t('docker_containers.no_containers')}", class = u-muted)
    }
  }

  column(class = "panel panel--fill") {
    row(class = env__head) {
      text(
        "{t('docker_containers.container_s', docker_containers_count=docker_containers_count)}",
        class = "u-muted u-fill",
      )

      button(
        class = "btn btn--danger",
        on_click = docker_prune_containers,
        disabled = @busy_docker_prune_containers,
        text = "{t('docker_containers.clean_stopped')}",
      )
    }

    text(
      "@docker_message",
      if = @docker_message,
      not_equals = "",
      class = u-muted,
    )

    tableview(
      :items = docker_containers,
      :sort = docker_containers_sort,
      var = c,
      header_class = "table__head table__head-cell",
      row_class = "table__row table__cell table__row--divided",
      class = u-fill-all,
    ) {
      tablecolumn(key = name, label = "{t('common.name')}", class = table__col-svc) {
        text("@c.name", class = "table__cell table__cell--key")
      }

      tablecolumn(key = image, label = "{t('docker_containers.image')}", class = table__col-img)

      tablecolumn(key = owner, label = "{t('docker_containers.owner')}", class = table__col-state) {
        text("@c.owner", class = u-muted)
      }

      tablecolumn(key = state_label, label = "{t('common.state')}", class = table__col-state) {
        StateCell(kind = @c.state_kind, label = @c.state_label)
      }

      tablecolumn(label = "{t('common.action')}", class = table__col-act) {
        // Só o container órfão ("removido no git") que ainda roda: para-se aqui e depois remove-se.
        button(
          if = @c.can_stop,
          equals = 1,
          class = "btn btn--danger btn--xs",
          on_click = docker_stop_container:@c.id_full,
          disabled = @busy_docker_stop_container,
          text = "{t('docker_containers.stop')}",
        )

        button(
          if = @c.can_remove,
          equals = 1,
          class = "btn btn--danger btn--xs",
          on_click = docker_remove_container:@c.id_full,
          disabled = @busy_docker_remove_container,
          text = "{t('common.remove')}",
        )
      }

      // Sem linha nenhuma: o "carregando" do primeiro snapshot, ou o vazio.
      if @data_loading == "true" {
        LoadingRow
      } else {
        SemContainersDocker
      }
    }
  }
}