mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-12-24 22:37:19 +00:00
UI ember engines (#6718)
Adds replication engine and core in-repo addon
This commit is contained in:
27
ui/lib/replication/addon/routes/mode/secondaries/add.js
Normal file
27
ui/lib/replication/addon/routes/mode/secondaries/add.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { hash } from 'rsvp';
|
||||
import Base from '../../replication-base';
|
||||
|
||||
export default Base.extend({
|
||||
model() {
|
||||
return hash({
|
||||
cluster: this.modelFor('mode.secondaries'),
|
||||
mounts: this.fetchMounts(),
|
||||
});
|
||||
},
|
||||
|
||||
redirect(model) {
|
||||
const replicationMode = this.paramsFor('mode').replication_mode;
|
||||
if (!model.cluster.get(`${replicationMode}.isPrimary`) || !model.cluster.get('canAddSecondary')) {
|
||||
return this.transitionTo('mode', replicationMode);
|
||||
}
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
controller.set('model', model.cluster);
|
||||
controller.set('mounts', model.mounts);
|
||||
},
|
||||
|
||||
resetController(controller) {
|
||||
controller.reset();
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user