Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vault
Commits
b64d2e94
Commit
b64d2e94
authored
5 years ago
by
Noelle Daley
Browse files
Options
Download
Email Patches
Plain Diff
show error in state card using the same state map in the cluster model
parent
3ddb24ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ui/lib/replication/addon/components/replication-primary-card.js
+5
-6
.../replication/addon/components/replication-primary-card.js
ui/lib/replication/addon/templates/components/replication-primary-card.hbs
+1
-1
...n/addon/templates/components/replication-primary-card.hbs
ui/lib/replication/addon/templates/components/replication-summary.hbs
+1
-0
...cation/addon/templates/components/replication-summary.hbs
with
7 additions
and
7 deletions
+7
-7
ui/lib/replication/addon/components/replication-primary-card.js
+
5
-
6
View file @
b64d2e94
...
...
@@ -15,7 +15,8 @@ import { computed } from '@ember/object';
* ```
* @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} [glyph=null] - The glyph to display beside the metric.
* @param {boolean} [hasOkState=true] - Whether or not the cluster is in an okay state. This comes from the cluster model.
* @param {string} metric=null - The main metric to highlight on the card.
*/
...
...
@@ -25,11 +26,9 @@ export default Component.extend({
description
:
null
,
metric
:
null
,
glyph
:
null
,
hasError
:
computed
(
'
title
'
,
'
metric
'
,
function
()
{
// TODO: can we make a map somewhere in the cluster that keeps track of all the good and bad states
// as well as their glyphs? this could replace the cluster StateDiplay and StateGlyph
// TODO: then add tests to ensure we show the correct error msg
return
this
.
title
===
'
State
'
&&
this
.
metric
!==
'
running
'
;
hasOkState
:
true
,
hasError
:
computed
(
'
hasOkState
'
,
'
title
'
,
'
metric
'
,
function
()
{
return
this
.
title
===
'
State
'
&&
!
this
.
hasOkState
;
}),
errorMessage
:
computed
(
'
hasError
'
,
function
()
{
// TODO figure out if we need another error message
...
...
This diff is collapsed.
Click to expand it.
ui/lib/replication/addon/templates/components/replication-primary-card.hbs
+
1
-
1
View file @
b64d2e94
...
...
@@ -9,7 +9,7 @@
</span>
<h3
class=
"title is-3"
>
{{
metric
}}
{{#if
glyph
}}
{{#if
(
and
glyph
(
not
hasError
))
}}
<Icon
@
glyph=
{{
glyph
}}
class=
"has-text-success"
/>
{{/if}}
</h3>
...
...
This diff is collapsed.
Click to expand it.
ui/lib/replication/addon/templates/components/replication-summary.hbs
+
1
-
0
View file @
b64d2e94
...
...
@@ -349,6 +349,7 @@
@
title=
'State'
@
description=
'Updated every ten seconds.'
@
glyph=
{{
get
cluster
(
concat
replicationMode
'StateGlyph'
)
}}
@
hasOkState=
{{
get
cluster
(
concat
replicationMode
'HasOkState'
)
}}
@
metric=
{{
replicationAttrs
.
state
}}
/>
<ReplicationPrimaryCard
@
title=
'Last WAL entry'
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help