John Cowen 04bd576179
ui: Serf Health Check warning notice (#10194)
When the Consul serf health check is failing, this means that the health checks registered with the agent may no longer be correct. Therefore we show a notice to the user when we detect that the serf health check is failing both for the health check listing for nodes and for service instances.

There were a few little things we fixed up whilst we were here:

- We use our @replace decorator to replace an empty Type with serf in the model.
- We noticed that ServiceTags can be null, so we replace that with an empty array.
- We added docs for both our Notice component and the Consul::HealthCheck::List component. Notice now defaults to @type=info.
2021-05-13 11:36:51 +01:00

36 lines
1.1 KiB
JavaScript

export default function(
visitable,
alias,
attribute,
present,
collection,
text,
tabs,
upstreams,
healthChecks
) {
const page = {
visit: visitable('/:dc/services/:service/instances/:node/:id'),
externalSource: attribute('data-test-external-source', '[data-test-external-source]', {
scope: '.title',
}),
tabs: tabs('tab', ['health-checks', 'upstreams', 'exposed-paths', 'addresses', 'tags-&-meta']),
checks: alias('healthChecks.item'),
healthChecks: healthChecks(),
upstreams: alias('upstreamInstances.item'),
upstreamInstances: upstreams(),
exposedPaths: collection('[data-test-proxy-exposed-paths] > tbody tr', {
combinedAddress: text('[data-test-combined-address]'),
}),
addresses: collection('.consul-tagged-addresses [data-test-tabular-row]', {
address: text('[data-test-address]'),
}),
metadata: collection('.metadata [data-test-tabular-row]', {}),
};
page.tabs.healthChecksTab = {
criticalSerfNotice: present('[data-test-critical-serf-notice]'),
healthChecks: healthChecks(),
};
return page;
}