Skip to content

Commit 07817f0

Browse files
authored
Ui/replication merge cleanup 2 (#9212)
* replace with replicationModeForDisplay that is defined on the cluster * fix spelling on replication and confirmed with design for placeholder when Not defined * remove extra div with box class * change manage link to take you to the secondaries manage as it's within the known secondaries card * fix scroll always showing by adding auto, and decreasing the height. WIP * add empty state to known_primary_cluster_addrs * address pr comments
1 parent b0b9f20 commit 07817f0

File tree

10 files changed

+90
-80
lines changed

10 files changed

+90
-80
lines changed

ui/app/styles/components/replication-dashboard.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@
102102
.grid-item-third-row {
103103
grid-column: 1 / span 2;
104104
grid-row: 3/4;
105+
106+
.empty-state {
107+
padding: 0px 12px;
108+
box-shadow: none;
109+
}
105110
}
106111
.grid-item-bottom-row {
107112
grid-column: 1 / span 2;

ui/app/styles/components/selectable-card.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
}
7070

7171
.vlt-table {
72-
max-height: 240px;
73-
overflow-y: scroll;
72+
max-height: 200px;
73+
overflow-y: auto;
7474
}
7575
}
7676

ui/lib/core/addon/components/replication-table-rows.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default Component.extend({
2525
secondaryId: computed('replicationDetails.{secondaryId}', function() {
2626
return this.replicationDetails.secondaryId;
2727
}),
28-
primaryClusterAddr: computed('replcationDetails.{primaryClusterAddr}', function() {
29-
return this.replicationDetails.primaryClusterAddr;
28+
primaryClusterAddr: computed('replicationDetails.{primaryClusterAddr}', function() {
29+
return this.replicationDetails.primaryClusterAddr || 'Not defined';
3030
}),
3131
merkleRoot: computed('replicationDetails.{merkleRoot}', function() {
3232
return this.replicationDetails.merkleRoot || 'unknown';

ui/lib/core/addon/templates/components/confirmation-modal.hbs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,23 @@
66
@showCloseButton={{true}}
77
>
88
<section class="modal-card-body">
9-
<div class="box is-shadowless is-fullwidth is-sideless">
109

11-
{{yield}}
10+
{{yield}}
1211

13-
<div class="modal-confirm-section">
14-
<p class="has-text-weight-semibold is-size-6">
15-
Confirm
16-
</p>
17-
<p class="is-help">Type <strong>{{confirmText}}</strong> to confirm {{toConfirmMsg}}</p>
18-
{{input
19-
type="text"
20-
value=confirmationInput
21-
name="confirmationInput"
22-
class="input has-margin-top"
23-
autocomplete="off"
24-
spellcheck="false"
25-
data-test-confirmation-modal-input=testSelector
26-
}}
27-
</div>
12+
<div class="modal-confirm-section">
13+
<p class="has-text-weight-semibold is-size-6">
14+
Confirm
15+
</p>
16+
<p class="is-help">Type <strong>{{confirmText}}</strong> to confirm {{toConfirmMsg}}</p>
17+
{{input
18+
type="text"
19+
value=confirmationInput
20+
name="confirmationInput"
21+
class="input has-margin-top"
22+
autocomplete="off"
23+
spellcheck="false"
24+
data-test-confirmation-modal-input=testSelector
25+
}}
2826
</div>
2927
</section>
3028
<footer class="modal-card-foot modal-card-foot-outlined">

ui/lib/core/addon/templates/components/replication-action-demote.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Demote cluster
55
</h4>
66
<p>
7-
Demote this {{if (eq model.replicationMode "dr") "Disaster Recovery" "Performance"}} primary to a secondary.
7+
Demote this {{model.replicationModeForDisplay}} primary to a secondary.
88
</p>
99
</div>
1010
<div class="action-block-action">
@@ -23,7 +23,7 @@
2323
@onClose={{action (mut isModalActive) false}}
2424
@isActive={{isModalActive}}
2525
@buttonClass="is-primary"
26-
@confirmText={{if (eq replicationDisplayMode "DR") "Disaster Recovery" replicationDisplayMode}}
26+
@confirmText={{model.replicationModeForDisplay}}
2727
@toConfirmMsg="demoting this cluster"
2828
@onConfirm={{action "onSubmit" "demote" model.replicationAttrs.modeForUrl}}
2929
@testSelector="demote"
@@ -37,7 +37,7 @@
3737
This cluster is currently operating as a performance secondary. Demoting it will leave your replication setup <strong>without a performance primary cluster</strong> until a new cluster is promoted.
3838
</p>
3939
{{/if}}
40-
Demoting this {{replicationDisplayMode}} primary to a {{replicationDisplayMode}} secondary means that the resulting secondary cluster:
40+
Demoting this {{model.replicationModeForDisplay}} primary to a {{model.replicationModeForDisplay}} secondary means that the resulting secondary cluster:
4141
</p>
4242
<ul class="bullet has-bottom-margin-m">
4343
{{#if (and

ui/lib/core/addon/templates/components/replication-action-disable.hbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Disable Replication
55
</h4>
66
<p>
7-
Disable {{replicationDisplayMode}} Replication entirely on the cluster.
7+
Disable {{model.replicationModeForDisplay}} Replication entirely on the cluster.
88
</p>
99
</div>
1010

@@ -23,8 +23,8 @@
2323
@title="Disable Replication?"
2424
@onClose={{action (mut isModalActive) false}}
2525
@isActive={{isModalActive}}
26-
@confirmText={{if (eq replicationDisplayMode "DR") "Disaster Recovery" replicationDisplayMode}}
27-
@toConfirmMsg="disabling {{replicationDisplayMode}} Replication on this cluster"
26+
@confirmText={{model.replicationModeForDisplay}}
27+
@toConfirmMsg="disabling {{model.replicationModeForDisplay}} Replication on this cluster"
2828
@onConfirm={{action
2929
"onSubmit"
3030
"disable"
@@ -37,8 +37,8 @@
3737
@testSelector="disable"
3838
>
3939
<p class="has-bottom-margin-m">
40-
{{#if (and model.replicationAttrs.isPrimary (eq replicationDisplayMode "DR"))}}This cannot be undone. {{/if}}
41-
Disabling {{replicationDisplayMode}} Replication entirely on this {{if (eq model.replicationAttrs.isPrimary true) "primary" "secondary"}} cluster means that:
40+
{{#if (and model.replicationAttrs.isPrimary (eq model.replicationMode "dr"))}}This cannot be undone. {{/if}}
41+
Disabling {{model.replicationModeForDisplay}} Replication entirely on this {{if (eq model.replicationAttrs.isPrimary true) "primary" "secondary"}} cluster means that:
4242
</p>
4343
<ul class="bullet">
4444
{{#if model.replicationAttrs.isPrimary}}

ui/lib/core/addon/templates/components/replication-action-promote.hbs

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Promote cluster
55
</h4>
66
<p>
7-
Promote this cluster to a {{replicationDisplayMode}} primary
7+
Promote this cluster to a {{model.replicationModeForDisplay}} primary
88
</p>
99
</div>
1010

@@ -27,53 +27,51 @@
2727
@showCloseButton={{true}}
2828
>
2929
<section class="modal-card-body">
30-
<div class="box is-shadowless is-fullwidth is-sideless">
3130

32-
{{#if (eq replicationMode "dr")}}
33-
<p class="has-bottom-margin-m">
34-
To promote this DR Replication Secondary to a primary, enter the DR Operation token.
35-
</p>
36-
{{/if}}
37-
<p class="has-bottom-margin-m">
38-
Vault Replication is not designed for active-active usage. 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.
39-
</p>
31+
{{#if (eq replicationMode "dr")}}
32+
<p class="has-bottom-margin-m">
33+
To promote this DR Replication Secondary to a primary, enter the DR Operation token.
34+
</p>
35+
{{/if}}
36+
<p class="has-bottom-margin-m">
37+
Vault Replication is not designed for active-active usage. 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.
38+
</p>
4039

41-
<div data-test-promote-dr-inputs>
42-
{{#if (eq replicationMode "dr")}}
43-
<div class="field is-borderless">
44-
<label for="dr_operation_token" class="is-label is-size-6">
45-
DR Operation Token
46-
</label>
47-
<div class="control">
48-
{{input class="input" id="dr_operation_token" name="dr_operation_token" value=dr_operation_token}}
49-
</div>
40+
<div data-test-promote-dr-inputs>
41+
{{#if (eq replicationMode "dr")}}
42+
<div class="field is-borderless">
43+
<label for="dr_operation_token" class="is-label is-size-6">
44+
DR Operation Token
45+
</label>
46+
<div class="control">
47+
{{input class="input" id="dr_operation_token" name="dr_operation_token" value=dr_operation_token}}
5048
</div>
51-
{{/if}}
52-
<div class="field">
53-
<label for="primary_cluster_addr" class="is-label is-size-6">
54-
Primary cluster address <em class="is-optional">(optional)</em>
55-
</label>
56-
<div class="control">
57-
{{input class="input" id="primary_cluster_addr" name="primary_cluster_addr" value=primary_cluster_addr}}
58-
</div>
59-
<p class="help">
60-
Overrides the cluster address that the primary gives to secondary nodes.
61-
</p>
49+
</div>
50+
{{/if}}
51+
<div class="field">
52+
<label for="primary_cluster_addr" class="is-label is-size-6">
53+
Primary cluster address <em class="is-optional">(optional)</em>
54+
</label>
55+
<div class="control">
56+
{{input class="input" id="primary_cluster_addr" name="primary_cluster_addr" value=primary_cluster_addr}}
6257
</div>
58+
<p class="help">
59+
Overrides the cluster address that the primary gives to secondary nodes.
60+
</p>
61+
</div>
6362

64-
<div class="field">
65-
<div class="b-checkbox">
66-
<input type="checkbox"
67-
id="forcePromote"
68-
class="styled"
69-
checked={{force}}
70-
onchange={{action (mut force) value="target.checked"}}
71-
/>
72-
<label for="forcePromote" class="is-label is-size-6">
73-
Force promotion of this cluster
74-
</label>
75-
<p>Promote the cluster even if certain safety checks fail. This could result in data loss of data isn't fully replicated</p>
76-
</div>
63+
<div class="field">
64+
<div class="b-checkbox">
65+
<input type="checkbox"
66+
id="forcePromote"
67+
class="styled"
68+
checked={{force}}
69+
onchange={{action (mut force) value="target.checked"}}
70+
/>
71+
<label for="forcePromote" class="is-label is-size-6">
72+
Force promotion of this cluster
73+
</label>
74+
<p>Promote the cluster even if certain safety checks fail. This could result in data loss of data isn't fully replicated</p>
7775
</div>
7876
</div>
7977
</div>

ui/lib/core/addon/templates/components/replication-actions.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
onSubmit=(action "onSubmit")
1313
replicationMode=replicationMode
1414
model=model
15-
replicationDisplayMode=replicationDisplayMode
1615
}}
1716
</div>
1817
{{/each}}

ui/lib/core/addon/templates/components/replication-secondary-card.hbs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,25 @@
8686
known_primary_cluster_addr
8787
</h6>
8888
<p class="has-text-grey">
89-
A list of all the nodes in the primary's cluster. This is updated every ten seconds.
89+
A list of all the nodes in the primary's cluster. This value is updated every ten seconds.
9090
</p>
9191
</div>
9292
<div class="grid-item-third-row">
93-
<InfoTable
94-
@title="Known Primary Cluster Addrs"
95-
@header="cluster_addr"
96-
@items={{knownPrimaryClusterAddrs}}
97-
/>
93+
{{#if (is-empty knownPrimaryClusterAddrs)}}
94+
<EmptyState
95+
@title="No known_primary_cluster_addrs"
96+
@message="These addresses are used by the secondary to communicate with the primary cluster. Should always be non-zero in a functioning replication setup.">
97+
<LearnLink @path="/vault/operations/monitor-replication">
98+
Learn more
99+
</LearnLink>
100+
</EmptyState>
101+
{{else}}
102+
<InfoTable
103+
@title="Known Primary Cluster Addrs"
104+
@header="cluster_addr"
105+
@items={{knownPrimaryClusterAddrs}}
106+
/>
107+
{{/if}}
98108
</div>
99109
{{/if}}
100110
</div>

ui/lib/replication/addon/templates/components/known-secondaries-card.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="selectable-card is-rounded secondaries">
22
<div class="level">
33
<h3 class="card-title title is-5">Known Secondaries</h3>
4-
<ToolbarLink @params={{array "mode.manage" cluster.replicationMode}} data-test-manage-link>
4+
<ToolbarLink @params={{array "mode.secondaries" cluster.replicationMode}} data-test-manage-link>
55
Manage
66
</ToolbarLink>
77
</div>

0 commit comments

Comments
 (0)