mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
70 lines
1.3 KiB
JavaScript
70 lines
1.3 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
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: {
|
|
glyph: 'check-circle',
|
|
isOk: true,
|
|
isSyncing: false,
|
|
},
|
|
'stream-wals': {
|
|
glyph: 'check-circle',
|
|
isOk: true,
|
|
isSyncing: false,
|
|
},
|
|
'merkle-diff': {
|
|
glyph: 'sync-reverse',
|
|
isOk: true,
|
|
isSyncing: true,
|
|
},
|
|
connecting: {
|
|
glyph: 'sync-reverse',
|
|
isOk: true,
|
|
isSyncing: true,
|
|
},
|
|
'merkle-sync': {
|
|
glyph: 'sync-reverse',
|
|
isOk: true,
|
|
isSyncing: true,
|
|
},
|
|
idle: {
|
|
glyph: 'x-square',
|
|
isOk: false,
|
|
isSyncing: false,
|
|
},
|
|
transient_failure: {
|
|
glyph: 'x-circle',
|
|
isOk: false,
|
|
isSyncing: false,
|
|
},
|
|
shutdown: {
|
|
glyph: 'x-circle',
|
|
isOk: false,
|
|
isSyncing: false,
|
|
},
|
|
};
|
|
|
|
export function clusterStates([state]) {
|
|
const defaultDisplay = {
|
|
glyph: '',
|
|
isOk: null,
|
|
isSyncing: null,
|
|
};
|
|
return CLUSTER_STATES[state] || defaultDisplay;
|
|
}
|
|
|
|
export default buildHelper(clusterStates);
|