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
3ddb24ba
Commit
3ddb24ba
authored
5 years ago
by
Noelle Daley
Browse files
Options
Download
Email Patches
Plain Diff
move cluster states into a map; make status menu icon match cluster state
parent
0e39b9c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ui/app/models/cluster.js
+25
-14
ui/app/models/cluster.js
ui/lib/core/addon/templates/components/replication-mode-summary.hbs
+1
-1
...e/addon/templates/components/replication-mode-summary.hbs
with
26 additions
and
15 deletions
+26
-15
ui/app/models/cluster.js
+
25
-
14
View file @
3ddb24ba
...
...
@@ -5,6 +5,17 @@ import DS from 'ember-data';
import
{
fragment
}
from
'
ember-data-model-fragments/attributes
'
;
const
{
hasMany
,
attr
}
=
DS
;
const
STATES
=
{
running
:
{
glyph
:
'
check-circle-outline
'
,
isOk
:
true
},
'
stream-wals
'
:
{
glyph
:
'
android-sync
'
,
display
:
'
Streaming
'
,
isOk
:
true
},
'
merkle-diff
'
:
{
glyph
:
'
android-sync
'
,
display
:
'
Determining sync status
'
,
isOk
:
true
},
connecting
:
{
glyph
:
'
android-sync
'
,
display
:
'
Streaming
'
,
isOk
:
true
},
'
merkle-sync
'
:
{
glyph
:
'
android-sync
'
,
display
:
'
Syncing
'
,
isOk
:
true
},
idle
:
{
glyph
:
'
cancel-circle-fill
'
,
isOk
:
false
},
'
transient-failure
'
:
{
glyph
:
'
cancel-circle-fill
'
,
isOk
:
false
},
shutdown
:
{
glyph
:
'
cancel-circle-fill
'
,
isOk
:
false
},
};
export
default
DS
.
Model
.
extend
({
version
:
service
(),
...
...
@@ -54,13 +65,8 @@ export default DS.Model.extend({
return
null
;
}
const
defaultDisp
=
'
Synced
'
;
const
displays
=
{
'
stream-wals
'
:
'
Streaming
'
,
'
merkle-diff
'
:
'
Determining sync status
'
,
'
merkle-sync
'
:
'
Syncing
'
,
};
return
displays
[
state
]
||
defaultDisp
;
return
STATES
[
state
].
display
||
defaultDisp
;
},
drStateDisplay
:
computed
(
'
dr.state
'
,
function
()
{
...
...
@@ -73,14 +79,7 @@ export default DS.Model.extend({
stateGlyph
(
state
)
{
const
glyph
=
'
check-circle-outline
'
;
const
glyphs
=
{
'
stream-wals
'
:
'
android-sync
'
,
'
merkle-diff
'
:
'
android-sync
'
,
'
merkle-sync
'
:
null
,
};
return
glyphs
[
state
]
||
glyph
;
return
STATES
[
state
].
glyph
||
glyph
;
},
drStateGlyph
:
computed
(
'
dr.state
'
,
function
()
{
...
...
@@ -91,6 +90,18 @@ export default DS.Model.extend({
return
this
.
stateGlyph
(
this
.
get
(
'
performance.state
'
));
}),
hasOkState
(
state
)
{
return
STATES
[
state
].
isOk
||
false
;
},
drHasOkState
:
computed
(
'
dr.state
'
,
function
()
{
return
this
.
hasOkState
(
this
.
get
(
'
dr.state
'
));
}),
performanceHasOkState
:
computed
(
'
performance.state
'
,
function
()
{
return
this
.
hasOkState
(
this
.
get
(
'
performance.state
'
));
}),
dr
:
fragment
(
'
replication-attributes
'
),
performance
:
fragment
(
'
replication-attributes
'
),
// this service exposes what mode the UI is currently viewing
...
...
This diff is collapsed.
Click to expand it.
ui/lib/core/addon/templates/components/replication-mode-summary.hbs
+
1
-
1
View file @
3ddb24ba
...
...
@@ -32,7 +32,7 @@
<div
class=
"level-right"
>
{{#if
replicationEnabled
}}
{{#if
(
get
cluster
(
concat
mode
'StateGlyph'
))
}}
<span
class=
"
has-text-success
"
>
<span
class=
"
{{
if
(
get
cluster
(
concat
mode
'HasOkState'
))
"has-text-success"
"has-text-danger"
}}
"
>
<Icon
aria-hidden=
"true"
@
glyph=
{{
get
cluster
(
concat
mode
'StateGlyph'
)
}}
...
...
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