open-consul/ui/packages/consul-ui/app/components/consul/instance-checks
John Cowen d3e5d6edc4
ui: Ensure proxy instance health is taken into account in Service Instance Listings (#12279)
We noticed that the Service Instance listing on both Node and Service views where not taking into account proxy instance health. This fixes that up so that the small health check information in each Service Instance row includes the proxy instances health checks when displaying Service Instance health (afterall if the proxy instance is unhealthy then so is the service instance that it should be proxying)

* Refactor Consul::InstanceChecks with docs

* Add to-hash helper, which will return an object keyed by a prop

* Stop using/relying on ember-data type things, just use a hash lookup

* For the moment add an equivalent "just give me proxies" model prop

* Start stitching things together, this one requires an extra HTTP request

..previously we weren't even requesting proxies instances here

* Finish up the stitching

* Document Consul::ServiceInstance::List while I'm here

* Fix up navigation mocks Name > Service
2022-02-10 15:28:26 +00:00
..
README.mdx ui: Ensure proxy instance health is taken into account in Service Instance Listings (#12279) 2022-02-10 15:28:26 +00:00
index.hbs ui: Ensure proxy instance health is taken into account in Service Instance Listings (#12279) 2022-02-10 15:28:26 +00:00
index.scss ui: Ensure proxy instance health is taken into account in Service Instance Listings (#12279) 2022-02-10 15:28:26 +00:00

README.mdx

# Consul::InstanceChecks

A presentational component to show an overview/summary of service or node
health.

```hbs preview-template
<figure>
  <figcaption>With no checks</figcaption>
  <Consul::InstanceChecks
    @type="service"
    @items={{array}}
  />
</figure>
<figure>
  <figcaption>With all passing check</figcaption>
  <Consul::InstanceChecks
    @type="service"
    @items={{array
      (hash
        Status="passing"
      )
    }}
  />
</figure>
<figure>
  <figcaption>With a warning check</figcaption>
  <Consul::InstanceChecks
    @type="service"
    @items={{array
      (hash
        Status="passing"
      )
      (hash
        Status="passing"
      )
      (hash
        Status="warning"
      )
    }}
  />
</figure>
<figure>
  <figcaption>With a critical check</figcaption>
  <Consul::InstanceChecks
    @type="service"
    @items={{array
      (hash
        Status="passing"
      )
      (hash
        Status="warning"
      )
      (hash
        Status="warning"
      )
      (hash
        Status="critical"
      )
    }}
  />
</figure>
<figure>
  <figcaption>Nodes with a critical check</figcaption>
  <Consul::InstanceChecks
    @type="node"
    @items={{array
      (hash
        Status="passing"
      )
      (hash
        Status="warning"
      )
      (hash
        Status="warning"
      )
      (hash
        Status="critical"
      )
    }}
  />
</figure>
```

## Arguments

| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `(service | node )` | | A simple string to use for labelling |
| `items` | `Array` | | An array of Consul healthchecks |


## See

- [Template Source Code](./index.hbs)

---