Skip to content

Commit

Permalink
ui - add force option when promoting a replication secondary (#5438)
Browse files Browse the repository at this point in the history
  • Loading branch information
meirish authored Oct 1, 2018
1 parent 25ee68d commit a863af5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions ui/app/components/replication-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const DEFAULTS = {
errors: [],
id: null,
replicationMode: null,
force: false,
};

export default Component.extend(ReplicationActions, DEFAULTS, {
Expand Down
37 changes: 35 additions & 2 deletions ui/app/templates/partials/replication/promote.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@
Overrides the cluster address that the primary gives to secondary nodes.
</p>
</div>

<div class="field">
<div class="b-checkbox">
<input type="checkbox"
id="forcePromote"
class="styled"
checked={{force}}
onchange={{action (mut force) value="target.checked"}}
/>
<label for="forcePromote" class="is-label">
Force promotion of this cluster
</label>
</div>
<p class="help has-text-grey">
Promote the cluster even if certain safety checks fail.
</p>
</div>
</div>
{{/if}}
</div>
Expand All @@ -40,7 +57,7 @@
<div class="control">
{{#confirm-action
buttonClasses="button is-primary"
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr))
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr force=force))
confirmMessage="Are you sure you want to promote this cluster?"
confirmButtonText="Promote cluster"
cancelButtonText="Cancel"
Expand Down Expand Up @@ -71,12 +88,28 @@
Overrides the cluster address that the primary gives to secondary nodes.
</p>
</div>
<div class="field">
<div class="b-checkbox">
<input type="checkbox"
id="forcePromote"
class="styled"
checked={{force}}
onchange={{action (mut force) value="target.checked"}}
/>
<label for="forcePromote" class="is-label">
Force promotion of this cluster
</label>
</div>
<p class="help has-text-grey">
Promote the cluster even if certain safety checks fail.
</p>
</div>
</div>
<div class="field">
<div class="control">
{{#confirm-action
buttonClasses="button is-primary"
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash primary_cluster_addr=primary_cluster_addr))
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash primary_cluster_addr=primary_cluster_addr force=force))
confirmMessage="Are you sure you want to promote this cluster?"
confirmButtonText="Promote cluster"
cancelButtonText="Cancel"
Expand Down

0 comments on commit a863af5

Please sign in to comment.