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
f4adb36a
Commit
f4adb36a
authored
Feb 22, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show information for each secondary node on Geo Nodes page
[ci skip]
parent
8419ebfb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
7 deletions
+53
-7
app/assets/stylesheets/pages/geo_nodes.scss
app/assets/stylesheets/pages/geo_nodes.scss
+6
-2
app/controllers/admin/geo_nodes_controller.rb
app/controllers/admin/geo_nodes_controller.rb
+1
-1
app/helpers/ee/geo_helper.rb
app/helpers/ee/geo_helper.rb
+7
-2
app/models/geo_node.rb
app/models/geo_node.rb
+2
-0
app/presenters/geo_node_presenter.rb
app/presenters/geo_node_presenter.rb
+28
-0
app/views/admin/geo_nodes/index.html.haml
app/views/admin/geo_nodes/index.html.haml
+9
-2
No files found.
app/assets/stylesheets/pages/geo_nodes.scss
View file @
f4adb36a
.geo-node-icon-
enabled
{
.geo-node-icon-
healthy
{
color
:
$gl-success
;
}
.geo-node-icon-
disabled
{
.geo-node-icon-
unhealthy
{
color
:
$gl-danger
;
}
.geo-node-icon-disabled
{
color
:
$gray-darkest
;
}
app/controllers/admin/geo_nodes_controller.rb
View file @
f4adb36a
...
...
@@ -3,7 +3,7 @@ class Admin::GeoNodesController < Admin::ApplicationController
before_action
:load_node
,
only:
[
:destroy
,
:repair
,
:toggle
]
def
index
@nodes
=
GeoNode
.
all
@nodes
=
GeoNode
.
all
.
map
(
&
:present
)
@node
=
GeoNode
.
new
unless
Gitlab
::
Geo
.
license_allows?
...
...
app/helpers/ee/geo_helper.rb
View file @
f4adb36a
...
...
@@ -2,9 +2,14 @@ module EE
module
GeoHelper
def
node_status_icon
(
node
)
if
node
.
primary?
icon
'star fw'
icon
'star fw'
,
class:
'has-tooltip'
,
title:
'Primary node'
else
status
=
node
.
enabled?
?
'enabled'
:
'disabled'
status
=
if
node
.
enabled?
node
.
healthy?
?
'healthy'
:
'unhealthy'
else
'disabled'
end
icon
'globe fw'
,
class:
"geo-node-icon-
#{
status
}
has-tooltip"
,
...
...
app/models/geo_node.rb
View file @
f4adb36a
class
GeoNode
<
ActiveRecord
::
Base
include
Presentable
Status
=
Struct
.
new
(
:health
,
:repositories
,
:repositories_synced
,
:repositories_failed
)
belongs_to
:geo_node_key
,
dependent: :destroy
...
...
app/presenters/geo_node_presenter.rb
0 → 100644
View file @
f4adb36a
class
GeoNodePresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
presents
:geo_node
def
healthy?
health
.
blank?
end
def
health
status
.
health
end
def
repositories_synced
(
status
.
repositories_synced
.
to_f
/
status
.
repositories
.
to_f
)
*
100.0
end
def
repositories_failed
status
.
repositories_failed
end
private
def
status
@status
||=
begin
_
,
status
=
Geo
::
NodeStatusService
.
new
.
call
(
status_url
)
status
end
end
end
app/views/admin/geo_nodes/index.html.haml
View file @
f4adb36a
...
...
@@ -21,8 +21,15 @@
%span
=
node_status_icon
(
node
)
%strong
=
node
.
url
%p
%span
.help-block
=
node
.
primary
?
'Primary node'
:
'Secondary node'
-
if
node
.
primary?
%span
.help-block
Primary node
-
else
%p
%span
.help-block
=
"Repositorie synced:
#{
number_to_percentage
(
node
.
repositories_synced
,
precision:
0
)
}
"
%p
%span
.help-block
=
"Repositorie failed:
#{
node
.
repositories_failed
}
"
%p
%span
.help-block
=
node
.
healthy?
?
'No Health Problems Detected'
:
node
.
health
.pull-right
-
if
Gitlab
::
Geo
.
license_allows?
...
...
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