open-vault/ui/app/helpers/replication-action-for-mode.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

21 lines
693 B
JavaScript

import { helper as buildHelper } from '@ember/component/helper';
import { get } from '@ember/object';
const ACTIONS = {
performance: {
primary: ['disable', 'demote', 'recover', 'reindex'],
secondary: ['disable', 'promote', 'update-primary', 'recover', 'reindex'],
bootstrapping: ['disable', 'recover', 'reindex'],
},
dr: {
primary: ['disable', 'recover', 'reindex', 'demote'],
secondary: ['promote'],
bootstrapping: ['disable', 'recover', 'reindex'],
},
};
export function replicationActionForMode([replicationMode, clusterMode] /*, hash*/) {
return get(ACTIONS, `${replicationMode}.${clusterMode}`);
}
export default buildHelper(replicationActionForMode);