rustploy-gui 0.1.22

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Images — projeto/serviço é melhor esforço (inferido pela tag; imagens
// manuais/de terceiros ficam com "—").
component {
  resources {
    component(name = SemImagens) {
      text(class = u-muted, content = "Nenhuma imagem.")
    }
  }

  column(class = "panel panel--fill") {
    row(class = env__head) {
      text(class = "u-muted u-fill", content = "@docker_images_count imagem(ns)")

      // O filtro mora em format.docker_images (a tableview desenha toda linha
      // que recebe): o toggle grava a chave e remonta a lista.
      checkbox(
        :checked = docker_images_only_used,
        on_toggle = docker_only_used:docker_images_only_used,
        label = "Somente em uso",
      )

      checkbox(
        :checked = docker_prune_all_images,
        on_toggle = field:docker_prune_all_images,
        label = "-a (limpar tudo, não só dangling)",
      )

      button(
        class = "btn btn--danger",
        on_click = docker_prune_images,
        disabled = @busy_docker_prune_images,
        text = "Limpar sem uso",
      )
    }

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

    tableview(
      :items = docker_images,
      :sort = docker_images_sort,
      var = i,
      header_class = "table__head table__head-cell",
      row_class = "table__row table__cell table__row--divided",
      class = u-fill-all,
    ) {
      tablecolumn(key = tags, label = TAGS, class = table__col-svc) {
        text(class = "table__cell table__cell--key", content = "@i.tags")
      }

      tablecolumn(key = owner, label = "PROJETO / SERVIÇO", class = table__col-proj)

      tablecolumn(
        key = size,
        sort_key = size_bytes,
        label = TAMANHO,
        class = table__col-dur,
      ) {
        text(class = u-muted, content = "@i.size")
      }

      tablecolumn(
        key = created,
        sort_key = created_iso,
        label = CRIADA,
        class = table__col-dur,
      ) {
        text(class = u-muted, content = "@i.created")
      }

      tablecolumn(key = in_use_label, label = USO, class = table__col-state) {
        StateCell(kind = @i.in_use_kind, label = @i.in_use_label)
      }

      tablecolumn(label = "AÇÃO", class = table__col-act) {
        button(
          if = @i.in_use_label,
          equals = "SEM USO",
          class = "btn btn--danger btn--xs",
          on_click = docker_remove_image:@i.id_full,
          disabled = @busy_docker_remove_image,
          text = Remover,
        )
      }

      if @data_loading == "true" {
        LoadingRow
      } else {
        SemImagens
      }
    }
  }
}