Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show dynamic state glyph #8747

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ui/app/styles/components/replication-dashboard.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.replication-dashboard {
.documentation-link {
float: right;
}

.selectable-card {
line-height: normal;

Expand Down Expand Up @@ -66,4 +62,9 @@
}
}
}

// prevent double lines at the bottom of the dashboard
&.box {
padding-bottom: 0;
}
}
8 changes: 8 additions & 0 deletions ui/app/styles/components/replication-doc-link.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.documentation-link {
margin: $spacing-s 0 $spacing-l 0;
float: right;

.doc-link {
font-weight: normal;
}
}
1 change: 1 addition & 0 deletions ui/app/styles/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
@import './components/radial-progress';
@import './components/raft-join';
@import './components/replication-dashboard';
@import './components/replication-doc-link';
@import './components/replication-primary-card';
@import './components/replication-summary';
@import './components/role-item';
Expand Down
6 changes: 6 additions & 0 deletions ui/lib/core/addon/components/replication-doc-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Component from '@ember/component';
import layout from '../templates/components/replication-doc-link';

export default Component.extend({
layout,
});
16 changes: 4 additions & 12 deletions ui/lib/core/addon/templates/components/replication-dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,15 @@
{{/if}}

<div class="selectable-card-container has-top-margin-xl">
{{yield (hash
{{yield (hash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why my spaces are not getting removed. I used to have my ide setup to do that. I'll look into that.

card=(component componentToRender data=data)
)}}
</div>
{{yield (hash

{{yield (hash
isSyncing=isSyncing
rows=(component 'replication-table-rows' data=data)
)}}

<div class="documentation-link">
<p class="has-text-grey">We have additional timeseries telemetry that can be found
<LearnLink
@path="/vault/operations/monitor-replication#key-monitoring-metrics"
> in our documentation</LearnLink>
.
</p>
</div>

<ReplicationDocLink />
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="documentation-link">
<p class="has-text-grey">We have additional timeseries telemetry that can be found
<LearnLink @path="/vault/operations/monitor-replication#key-monitoring-metrics"> in our documentation</LearnLink>
.
</p>
</div>
1 change: 1 addition & 0 deletions ui/lib/core/app/components/learn-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'core/components/learn-link';
1 change: 1 addition & 0 deletions ui/lib/core/app/components/replication-doc-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'core/components/replication-doc-link';
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Component from '@ember/component';
* ```
* @param {string} [title=null] - The title to be displayed on the top left corner of the card.
* @param {string} [description=null] - Helper text to describe the metric on the card.
* @param {object} [glyph=null] - The glyph to display beside the metric.
* @param {string} metric=null - The main metric to highlight on the card.
*/

Expand All @@ -22,4 +23,5 @@ export default Component.extend({
title: null,
description: null,
metric: null,
glyph: null,
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
{{description}}
</span>
<h3 class="title is-3">
{{!-- TODO make this dynamic --}}
<Icon @glyph="check-circle-outline" class="has-text-success" />
{{metric}}
{{#if glyph}}
<Icon @glyph={{glyph}} class="has-text-success" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the state always be a positive/successful one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent eye! yes, we only ever show a glyph if the state is positive. you can see where we get the glyph from the cluster model here.

if the cluster is in a bad state will show an error alert banner, but it'll be above the state. i'm working on that in the next PR 👯

{{/if}}
</h3>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
<ReplicationPrimaryCard
@title='State'
@description='Updated every ten seconds.'
@glyph={{get cluster (concat replicationMode 'StateGlyph')}}
@metric={{replicationAttrs.state}}/>
<ReplicationPrimaryCard
@title='Last WAL entry'
Expand All @@ -357,6 +358,7 @@
<KnownSecondariesCard @cluster={{cluster}} @replicationAttrs={{replicationAttrs}} />
</div>
<ReplicationTableRows @data={{replicationAttrs}}/>
<ReplicationDocLink />
</div>
{{/if}}
{{/if}}