mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 12:07:54 +00:00
move replication-actions into core addon so that secondary recovery works (#7226)
* move replication-actions component into core addon so that secondary recovery works * move the rest of replication action components
This commit is contained in:
52
ui/lib/core/addon/components/replication-actions.js
Normal file
52
ui/lib/core/addon/components/replication-actions.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import { alias } from '@ember/object/computed';
|
||||
import Component from '@ember/component';
|
||||
import { computed } from '@ember/object';
|
||||
import ReplicationActions from 'core/mixins/replication-actions';
|
||||
import layout from '../templates/components/replication-actions';
|
||||
|
||||
const DEFAULTS = {
|
||||
token: null,
|
||||
primary_api_addr: null,
|
||||
primary_cluster_addr: null,
|
||||
errors: [],
|
||||
id: null,
|
||||
replicationMode: null,
|
||||
force: false,
|
||||
};
|
||||
|
||||
export default Component.extend(ReplicationActions, DEFAULTS, {
|
||||
layout,
|
||||
replicationMode: null,
|
||||
model: null,
|
||||
cluster: alias('model'),
|
||||
|
||||
reset() {
|
||||
if (!this || this.isDestroyed || this.isDestroying) {
|
||||
return;
|
||||
}
|
||||
this.setProperties(DEFAULTS);
|
||||
},
|
||||
|
||||
replicationDisplayMode: computed('replicationMode', function() {
|
||||
const replicationMode = this.get('replicationMode');
|
||||
if (replicationMode === 'dr') {
|
||||
return 'DR';
|
||||
}
|
||||
if (replicationMode === 'performance') {
|
||||
return 'Performance';
|
||||
}
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onSubmit() {
|
||||
return this.submitHandler(...arguments);
|
||||
},
|
||||
clear() {
|
||||
this.reset();
|
||||
this.setProperties({
|
||||
token: null,
|
||||
id: null,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user