ui - add force option when promoting a replication secondary (#5438)

This commit is contained in:
Matthew Irish 2018-10-01 15:58:43 -05:00 committed by GitHub
parent 03cf7958ad
commit 87ed1e4f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 2 deletions

View File

@ -10,6 +10,7 @@ const DEFAULTS = {
errors: [],
id: null,
replicationMode: null,
force: false,
};
export default Component.extend(ReplicationActions, DEFAULTS, {

View File

@ -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>
@ -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"
@ -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"