import { helper as buildHelper } from '@ember/component/helper';
// A hash of cluster states to ensure that the status menu and replication dashboards
// display states and glyphs consistently
// this includes states for the primary vault cluster and the connection_state
export const CLUSTER_STATES = {
running: {
glyph: 'check-circle',
isOk: true,
isSyncing: false,
},
ready: {
'stream-wals': {
'merkle-diff': {
glyph: 'sync-reverse',
isSyncing: true,
connecting: {
'merkle-sync': {
idle: {
glyph: 'x-square',
isOk: false,
transient_failure: {
glyph: 'x-circle',
shutdown: {
};
export function clusterStates([state]) {
const defaultDisplay = {
glyph: '',
isOk: null,
isSyncing: null,
return CLUSTER_STATES[state] || defaultDisplay;
}
export default buildHelper(clusterStates);