rustploy-gui 0.1.54

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("{t('docker_images.no_images')}", class = u-muted)
    }
  }

  column(class = "panel panel--fill") {
    row(class = env__toolbar) {
      text(
        "{t('docker_images.image_s', docker_images_count=docker_images_count)}",
        class = "u-muted u-fill"
      )

      // 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 = "{t('common.in_use_only')}",
      )

      checkbox(
        :checked = docker_prune_all_images,
        on_toggle = field:docker_prune_all_images,
        label = "{t('docker_images.a_clean_everything_not_just')}",
      )

      button(
        class = "btn btn--danger",
        on_click = docker_prune_images,
        disabled = @busy_docker_prune_images,
        text = "{t('common.clean_unused')}",
      )
    }

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

    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 = "{t('common.tags')}",
        class = table__col-svc
      ) {
        text(
          "@i.tags",
          class = "table__cell table__cell--key"
        )
      }

      tablecolumn(
        key = owner,
        label = "{t('docker_images.project_service')}",
        class = table__col-proj
      )

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

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

      tablecolumn(
        key = in_use_label,
        label = "{t('common.usage')}",
        class = table__col-state
      ) {
        StateCell(
          kind = @i.in_use_kind,
          label = @i.in_use_label
        )
      }

      tablecolumn(label = "{t('common.action')}", 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 = "{t('common.remove')}",
        )
      }

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