Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
769b85a9
Commit
769b85a9
authored
Jun 29, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show loading icon when retrieving Geo node status
Closes #1977
parent
530166fc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
app/assets/javascripts/geo_nodes.js
app/assets/javascripts/geo_nodes.js
+7
-1
app/assets/stylesheets/pages/geo_nodes.scss
app/assets/stylesheets/pages/geo_nodes.scss
+4
-0
app/helpers/ee/geo_helper.rb
app/helpers/ee/geo_helper.rb
+5
-1
app/views/admin/geo_nodes/index.html.haml
app/views/admin/geo_nodes/index.html.haml
+1
-0
No files found.
app/assets/javascripts/geo_nodes.js
View file @
769b85a9
...
@@ -3,13 +3,16 @@ import './smart_interval';
...
@@ -3,13 +3,16 @@ import './smart_interval';
const
healthyClass
=
'
geo-node-healthy
'
;
const
healthyClass
=
'
geo-node-healthy
'
;
const
unhealthyClass
=
'
geo-node-unhealthy
'
;
const
unhealthyClass
=
'
geo-node-unhealthy
'
;
const
unknownClass
=
'
geo-node-unknown
'
;
const
healthyIcon
=
'
fa-check
'
;
const
healthyIcon
=
'
fa-check
'
;
const
unhealthyIcon
=
'
fa-close
'
;
const
unhealthyIcon
=
'
fa-times
'
;
const
unknownIcon
=
'
fa-times
'
;
class
GeoNodeStatus
{
class
GeoNodeStatus
{
constructor
(
el
)
{
constructor
(
el
)
{
this
.
$el
=
$
(
el
);
this
.
$el
=
$
(
el
);
this
.
$icon
=
$
(
'
.js-geo-node-icon
'
,
this
.
$el
);
this
.
$icon
=
$
(
'
.js-geo-node-icon
'
,
this
.
$el
);
this
.
$loadingIcon
=
$
(
'
.js-geo-node-loading
'
,
this
.
$el
);
this
.
$healthStatus
=
$
(
'
.js-health-status
'
,
this
.
$el
);
this
.
$healthStatus
=
$
(
'
.js-health-status
'
,
this
.
$el
);
this
.
$status
=
$
(
'
.js-geo-node-status
'
,
this
.
$el
);
this
.
$status
=
$
(
'
.js-geo-node-status
'
,
this
.
$el
);
this
.
$repositoriesSynced
=
$
(
'
.js-repositories-synced
'
,
this
.
$status
);
this
.
$repositoriesSynced
=
$
(
'
.js-repositories-synced
'
,
this
.
$status
);
...
@@ -48,6 +51,9 @@ class GeoNodeStatus {
...
@@ -48,6 +51,9 @@ class GeoNodeStatus {
}
}
setStatusIcon
(
healthy
)
{
setStatusIcon
(
healthy
)
{
this
.
$loadingIcon
.
hide
();
this
.
$icon
.
removeClass
(
`
${
unknownClass
}
${
unknownIcon
}
`
);
if
(
healthy
)
{
if
(
healthy
)
{
this
.
$icon
.
removeClass
(
`
${
unhealthyClass
}
${
unhealthyIcon
}
`
)
this
.
$icon
.
removeClass
(
`
${
unhealthyClass
}
${
unhealthyIcon
}
`
)
.
addClass
(
`
${
healthyClass
}
${
healthyIcon
}
`
)
.
addClass
(
`
${
healthyClass
}
${
healthyIcon
}
`
)
...
...
app/assets/stylesheets/pages/geo_nodes.scss
View file @
769b85a9
...
@@ -10,6 +10,10 @@
...
@@ -10,6 +10,10 @@
color
:
$gray-darkest
;
color
:
$gray-darkest
;
}
}
.geo-node-unknown
{
color
:
$gray-darkest
;
}
.well-list.geo-nodes
{
.well-list.geo-nodes
{
li
{
li
{
position
:
relative
;
position
:
relative
;
...
...
app/helpers/ee/geo_helper.rb
View file @
769b85a9
...
@@ -2,7 +2,7 @@ module EE
...
@@ -2,7 +2,7 @@ module EE
module
GeoHelper
module
GeoHelper
def
node_status_icon
(
node
)
def
node_status_icon
(
node
)
unless
node
.
primary?
unless
node
.
primary?
status
=
node
.
enabled?
?
'
healthy
'
:
'disabled'
status
=
node
.
enabled?
?
'
unknown
'
:
'disabled'
icon
=
status
==
'healthy'
?
'check'
:
'times'
icon
=
status
==
'healthy'
?
'check'
:
'times'
icon
"
#{
icon
}
fw"
,
icon
"
#{
icon
}
fw"
,
...
@@ -11,6 +11,10 @@ module EE
...
@@ -11,6 +11,10 @@ module EE
end
end
end
end
def
status_loading_icon
icon
"spinner spin fw"
,
class:
'js-geo-node-loading'
end
def
node_class
(
node
)
def
node_class
(
node
)
klass
=
[]
klass
=
[]
klass
<<
'js-geo-secondary-node'
if
node
.
secondary?
klass
<<
'js-geo-secondary-node'
if
node
.
secondary?
...
...
app/views/admin/geo_nodes/index.html.haml
View file @
769b85a9
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
.node-badge.primary-node
Primary
.node-badge.primary-node
Primary
%span
.help-block
Primary node
%span
.help-block
Primary node
-
else
-
else
=
status_loading_icon
.js-geo-node-status
{
style:
'display: none'
}
.js-geo-node-status
{
style:
'display: none'
}
-
if
node
.
enabled?
-
if
node
.
enabled?
%p
%p
...
...
Write
Preview
Markdown
is supported
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