Skip to content

Commit

Permalink
Add a serf warning notice to healthcheck listings when serf is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cowen committed May 7, 2021
1 parent 40fd280 commit dd9cf90
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
27 changes: 24 additions & 3 deletions ui/packages/consul-ui/app/templates/dc/nodes/show/healthchecks.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,26 @@ as |route|>
@filter={{filters}}
/>
{{/if}}
{{#let (find-by "Type" "serf" items) as |serf|}}
{{#if (and serf (eq serf.Status "critical"))}}
<Notice
data-test-critical-serf-notice
@type="warning"
as |notice|>
<notice.Header>
<h2>
{{t "routes.dc.nodes.show.healthchecks.critical-serf-notice.header"}}
</h2>
</notice.Header>
<notice.Body>
{{t
"routes.dc.nodes.show.healthchecks.critical-serf-notice.body"
htmlSafe=true
}}
</notice.Body>
</Notice>
{{/if}}
{{/let}}
<DataCollection
@type="health-check"
@sort={{sort.value}}
Expand All @@ -62,9 +82,10 @@ as |route|>
<collection.Empty>
<EmptyState>
<BlockSlot @name="body">
<p>
This node has no health checks{{#if (gt items.length 0)}} matching that search{{/if}}.
</p>
{{t "routes.dc.nodes.show.healthchecks.empty"
items=items.length
htmlSafe=true
}}
</BlockSlot>
</EmptyState>
</collection.Empty>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ as |route|>
/>
{{/if}}

{{#let (find-by "Type" "serf" items) as |serf|}}
{{#if (and serf (eq serf.Status "critical"))}}
<Notice
data-test-critical-serf-notice
@type="warning"
as |notice|>
<notice.Header>
<h2>
{{t "routes.dc.services.instance.healthchecks.critical-serf-notice.header"}}
</h2>
</notice.Header>
<notice.Body>
{{t
"routes.dc.services.instance.healthchecks.critical-serf-notice.body"
htmlSafe=true
}}
</notice.Body>
</Notice>
{{/if}}
{{/let}}
<DataCollection
@type="health-check"
@sort={{sort.value}}
Expand All @@ -59,9 +79,10 @@ as |route|>
<collection.Empty>
<EmptyState>
<BlockSlot @name="body">
<p>
This instance has no health checks{{#if (gt items.length 0)}} matching that search{{/if}}.
</p>
{{t "routes.dc.services.instance.healthchecks.empty"
items=items.length
htmlSafe=true
}}
</BlockSlot>
</EmptyState>
</collection.Empty>
Expand Down

0 comments on commit dd9cf90

Please sign in to comment.