rustploy-gui 0.1.1

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 = muted, content = "Nenhuma network.")
    }
  }

  column(class = panel_fill) {
    row(class = env_head) {
      text(
        class = muted_fill,
        content = "@docker_networks_count network(s)",
      )

      checkbox(
        :checked = docker_networks_only_used,
        on_toggle = field:docker_networks_only_used,
        label = "Somente em uso",
      )

      button(
        class = btn_danger,
        on_click = docker_prune_networks,
        text = "Limpar sem uso",
      )
    }

    text(
      if = @docker_msg,
      not_equals = "",
      class = muted,
      content = "@docker_msg",
    )

    row(class = thead) {
      text(class = "th col_svc", content = "NOME")
      text(class = "th col_proj", content = "PROJETO")
      text(class = "th col_dur", content = "DRIVER")
      text(class = "th col_dur", content = "CONTAINERS")
      text(class = "th col_state", content = "USO")
      text(class = "th col_act", content = "AÇÃO")
    }

    if @data_loading == "true" {
      LoadingRow
    }

    scrollable(
      if = @data_loading,
      not_equals = true,
      direction = vertical,
      class = scroll_fill,
    ) {
      column(class = table_body) {
        if @docker_networks_only_used == "true" {
          template(
            :for-each = docker_networks,
            var = n,
            foreach_fallback = SemNetworks,
          ) {
            column(
              class = row_wrap,
              if = @n.in_use_label,
              equals = "EM USO",
            ) {
              row(class = trow) {
                text(class = "td_key col_svc", content = "@n.name")
                text(class = "td col_proj", content = "@n.project")
                text(class = "muted col_dur", content = "@n.driver")
                text(class = "muted col_dur", content = "@n.containers")
                StateCell(kind = @n.in_use_kind, label = @n.in_use_label)

                row(class = col_act) {
                  button(
                    if = @n.in_use_label,
                    equals = "SEM USO",
                    class = dk_rm,
                    on_click = docker_rm_network:@n.id_full,
                    text = Remover,
                  )
                }
              }

              hr
            }
          }
        } else {
          template(
            :for-each = docker_networks,
            var = n,
            foreach_fallback = SemNetworks,
          ) {
            column(class = row_wrap) {
              row(class = trow) {
                text(class = "td_key col_svc", content = "@n.name")
                text(class = "td col_proj", content = "@n.project")
                text(class = "muted col_dur", content = "@n.driver")
                text(class = "muted col_dur", content = "@n.containers")
                StateCell(kind = @n.in_use_kind, label = @n.in_use_label)

                row(class = col_act) {
                  button(
                    if = @n.in_use_label,
                    equals = "SEM USO",
                    class = dk_rm,
                    on_click = docker_rm_network:@n.id_full,
                    text = Remover,
                  )
                }
              }

              hr
            }
          }
        }
      }
    }
  }
}