rustploy-gui 0.1.19

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Networks — projeto reconhecido pela convenção rp_net_<id curto>.
component {
  resources {
    component(name = SemNetworks) {
      text(class = u-muted, content = "Nenhuma network.")
    }
  }

  column(class = "panel panel--fill") {
    row(class = env__head) {
      text(
        class = "u-muted u-fill",
        content = "@docker_networks_count network(s)",
      )

      // O filtro mora em format.docker_networks — ver images.gvb.
      checkbox(
        :checked = docker_networks_only_used,
        on_toggle = docker_only_used:docker_networks_only_used,
        label = "Somente em uso",
      )

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

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

    tableview(
      :items = docker_networks,
      :sort = docker_networks_sort,
      var = n,
      header_class = "table__head table__head-cell",
      row_class = "table__row table__cell table__row--divided",
      class = u-fill-all,
    ) {
      tablecolumn(key = name, label = NOME, class = table__col-svc) {
        text(class = "table__cell table__cell--key", content = "@n.name")
      }

      tablecolumn(key = project, label = PROJETO, class = table__col-proj)

      tablecolumn(key = driver, label = DRIVER, class = table__col-dur) {
        text(class = u-muted, content = "@n.driver")
      }

      tablecolumn(key = containers, label = CONTAINERS, class = table__col-dur) {
        text(class = u-muted, content = "@n.containers")
      }

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

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

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