2018-04-03 14:16:57 +00:00
{{ # if ( and ( eq replicationMode 'dr' ) ( eq model .replicationAttrs .modeForUrl 'secondary' ) ) }}
<div class="box is-marginless is-shadowless">
2018-06-26 21:35:47 +00:00
<p>
2018-04-03 14:16:57 +00:00
This cluster is currently running as a DR Replication Secondary.
Promote the cluster to a primary by entering DR Operation Token.
</p>
<div class="field">
<label for="dr_operation_token" class="is-label">
DR Operation Token
</label>
<div class="control">
{{ in put class = "input" id = "dr_operation_token" name = "dr_operation_token" value = dr_operation_token }}
</div>
</div>
2018-06-26 21:35:47 +00:00
<ToggleButton
@class="is-block"
@toggleAttr="showOptions"
@toggleTarget= {{ this }}
@openLabel="Hide Options"
@closedLabel="Options"
/>
{{ # if showOptions }}
<div class="box is-marginless">
<div class="field">
<label for="primary_cluster_addr" class="is-label">
Primary cluster address <em class="is-optional">(optional)</em>
</label>
<div class="control">
{{ in put class = "input" id = "primary_cluster_addr" name = "primary_cluster_addr" value = primary_cluster_addr }}
</div>
<p class="help">
Overrides the cluster address that the primary gives to secondary nodes.
</p>
</div>
2018-10-01 20:58:43 +00:00
<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>
2018-11-02 16:02:45 +00:00
<AlertInline
2018-11-27 22:40:33 +00:00
@class="has-top"
2018-11-02 16:02:45 +00:00
@type="warning"
@message="Forcing promotion could result in data loss if data isn't fully replicated. Force promotion
promotes the cluster even if certain safety checks fail."
/>
2018-10-01 20:58:43 +00:00
</div>
2018-04-03 14:16:57 +00:00
</div>
2018-06-26 21:35:47 +00:00
{{ / if }}
2018-04-03 14:16:57 +00:00
</div>
2018-06-26 21:35:47 +00:00
<div class="box is-marginless is-shadowless">
2018-04-03 14:16:57 +00:00
<div class="field">
<div class="control">
{{ # confirm-action
buttonClasses="button is-primary"
2018-10-01 20:58:43 +00:00
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr force=force))
2018-04-03 14:16:57 +00:00
confirmMessage="Are you sure you want to promote this cluster?"
confirmButtonText="Promote cluster"
cancelButtonText="Cancel"
}}
Promote cluster
{{ / confirm-action }}
</div>
</div>
</div>
{{ else }}
<h4 class="title is-5 is-marginless">
Promote cluster
</h4>
<div class="content">
<p>Promote the cluster to primary.</p>
2018-11-02 16:02:45 +00:00
<AlertInline
@type="warning"
@message="Vault replication is not designed for active-active usage and enabling two primaries should never be done, as it can lead to data loss if they or their secondaries are ever reconnected.
If the cluster has a primary, be sure to demote it before promoting a secondary."
/>
2018-04-03 14:16:57 +00:00
<div class="field">
<label for="primary_cluster_addr" class="is-label">
Primary cluster address <em class="is-optional">(optional)</em>
</label>
<div class="control">
{{ in put class = "input" id = "primary_cluster_addr" name = "primary_cluster_addr" value = primary_cluster_addr }}
</div>
<p class="help has-text-grey">
Overrides the cluster address that the primary gives to secondary nodes.
</p>
</div>
2018-10-01 20:58:43 +00:00
<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>
2018-11-02 16:02:45 +00:00
<AlertInline
2018-11-27 22:40:33 +00:00
@class="has-top"
2018-11-02 16:02:45 +00:00
@type="warning"
@message="Forcing promotion could result in data loss if data isn't fully replicated. Force promotion
promotes the cluster even if certain safety checks fail."
/>
2018-10-01 20:58:43 +00:00
</div>
2018-04-03 14:16:57 +00:00
</div>
<div class="field">
<div class="control">
{{ # confirm-action
buttonClasses="button is-primary"
2018-10-01 20:58:43 +00:00
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash primary_cluster_addr=primary_cluster_addr force=force))
2018-04-03 14:16:57 +00:00
confirmMessage="Are you sure you want to promote this cluster?"
confirmButtonText="Promote cluster"
cancelButtonText="Cancel"
}}
Promote cluster
{{ / confirm-action }}
</div>
</div>
{{ / if }}