open-vault/ui/lib/core/addon/helpers/cluster-states.js
Jordan Reimer c1df15e790
Incorporate Ember Flight Icons (#12976)
* adds ember-flight-icons dependecy

* adds inline-json-import babel plugin

* adds flight icon styling

* updates Icon component to support flight icons

* updates Icon component usages to new api and updates name values to flight icon set when available

* fixes tests

* updates icon story with flight mappings and fixes issue with flight icons not rendering in storybook

* adds changelog

* fixes typo in sign action glyph name in transit-key model

* adds comments to icon-map

* updates Icon component to use only supported flight icon sizes

* adds icon transform codemod

* updates icon transform formatting to handle edge case

* runs icon transform on templates

* updates Icon usage in toolbar-filter md and story

* updates tests
2021-12-07 10:05:14 -07:00

65 lines
1.3 KiB
JavaScript

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);