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
82941cf8
Commit
82941cf8
authored
May 01, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve UX of geo page
parent
d368100f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
27 deletions
+77
-27
app/assets/stylesheets/pages/geo_nodes.scss
app/assets/stylesheets/pages/geo_nodes.scss
+47
-3
app/helpers/ee/geo_helper.rb
app/helpers/ee/geo_helper.rb
+15
-9
app/views/admin/geo_nodes/index.html.haml
app/views/admin/geo_nodes/index.html.haml
+15
-15
No files found.
app/assets/stylesheets/pages/geo_nodes.scss
View file @
82941cf8
.geo-node-
icon-
healthy
{
.geo-node-healthy
{
color
:
$gl-success
;
color
:
$gl-success
;
}
}
.geo-node-
icon-
unhealthy
{
.geo-node-unhealthy
{
color
:
$gl-danger
;
color
:
$gl-danger
;
}
}
.geo-node-
icon-
disabled
{
.geo-node-disabled
{
color
:
$gray-darkest
;
color
:
$gray-darkest
;
}
}
.well-list.geo-nodes
{
li
{
position
:
relative
;
&
:hover
{
background
:
$white-light
;
}
}
}
.node-info
{
font-weight
:
bold
;
color
:
$gl-text-color
;
}
.geo-health
{
display
:
inline-block
;
margin-top
:
5px
;
}
.primary-node-badge
{
color
:
$white-light
;
background-color
:
$blue-300
;
display
:
inline-block
;
margin-left
:
5px
;
padding
:
0
5px
;
border-radius
:
3px
;
}
.node-actions
{
position
:
absolute
;
right
:
15px
;
top
:
10px
;
@media
(
max-width
:
$screen-xs-max
)
{
position
:
initial
;
margin-top
:
10px
;
}
.btn
:not
(
:first-of-type
)
{
margin-left
:
10px
;
}
}
app/helpers/ee/geo_helper.rb
View file @
82941cf8
module
EE
module
EE
module
GeoHelper
module
GeoHelper
def
node_status_icon
(
node
)
def
node_status_icon
(
node
)
if
node
.
primary?
unless
node
.
primary?
icon
'star fw'
,
class:
'has-tooltip'
,
title:
'Primary node'
else
status
=
node
.
enabled?
?
'healthy'
:
'disabled'
status
=
node
.
enabled?
?
'healthy'
:
'disabled'
icon
'
globe
fw'
,
icon
'
check
fw'
,
class:
"js-geo-node-icon geo-node-
icon-
#{
status
}
has-tooltip"
,
class:
"js-geo-node-icon geo-node-
#{
status
}
has-tooltip"
,
title:
status
.
capitalize
title:
status
.
capitalize
end
end
end
end
def
node_status
(
node
)
status
=
node
.
enabled?
?
'healthy'
:
'disabled'
content_tag
:span
,
class:
"geo-node-
#{
status
}
"
do
status
.
capitalize
end
end
def
toggle_node_button
(
node
)
def
toggle_node_button
(
node
)
btn_class
,
title
,
data
=
btn_class
,
title
,
data
=
if
node
.
enabled?
if
node
.
enabled?
[
'warning'
,
'Disable
node
'
,
{
confirm:
'Disabling a node stops the sync process. Are you sure?'
}]
[
'warning'
,
'Disable'
,
{
confirm:
'Disabling a node stops the sync process. Are you sure?'
}]
else
else
[
'success'
,
'Enable
node
'
]
[
'success'
,
'Enable'
]
end
end
link_to
icon
(
'power-off fw'
,
text:
title
)
,
link_to
title
,
toggle_admin_geo_node_path
(
node
),
toggle_admin_geo_node_path
(
node
),
method: :post
,
method: :post
,
class:
"btn btn-sm btn-
#{
btn_class
}
prepend-left-10 has-tooltip
"
,
class:
"btn btn-sm btn-
#{
btn_class
}
"
,
title:
title
,
title:
title
,
data:
data
data:
data
end
end
...
...
app/views/admin/geo_nodes/index.html.haml
View file @
82941cf8
...
@@ -17,41 +17,41 @@
...
@@ -17,41 +17,41 @@
%ul
.well-list.geo-nodes
%ul
.well-list.geo-nodes
-
@nodes
.
each
do
|
node
|
-
@nodes
.
each
do
|
node
|
%li
{
id:
dom_id
(
node
),
class:
(
'js-geo-secondary-node'
if
node
.
secondary?
),
data:
{
status_url:
status_admin_geo_node_path
(
node
)
}
}
%li
{
id:
dom_id
(
node
),
class:
(
'js-geo-secondary-node'
if
node
.
secondary?
),
data:
{
status_url:
status_admin_geo_node_path
(
node
)
}
}
.list-item-name
.node-block
%span
=
node_status_icon
(
node
)
=
node_status_icon
(
node
)
%strong
=
node
.
url
%strong
=
node
.
url
-
if
node
.
primary?
-
if
node
.
primary?
.primary-node-badge
Primary
%span
.help-block
Primary node
%span
.help-block
Primary node
-
else
-
else
.js-geo-node-status
{
style:
'display: none'
}
.js-geo-node-status
{
style:
'display: none'
}
%p
%span
.help-block
Health Status:
%span
=
node_status
(
node
)
%p
%p
%span
.help-block
%span
.help-block
Repositories synced:
Repositories synced:
%span
.js-repositories-synced
%span
.
node-info.
js-repositories-synced
%p
%p
%span
.help-block
%span
.help-block
Repositories failed:
Repositories failed:
%span
.js-repositories-failed
%span
.
node-info.
js-repositories-failed
%p
%p
%span
.help-block
%span
.help-block
LFS objects synced:
LFS objects synced:
%span
.js-lfs-objects-synced
%span
.
node-info.
js-lfs-objects-synced
%p
%p
%span
.help-block
%span
.help-block
Attachments synced:
Attachments synced:
%span
.js-attachments-synced
%span
.
node-info.
js-attachments-synced
%p
%p
%
span
.help-block
.js-health
%
code
.geo-health
.js-health
.
pull-right
.
node-actions
-
if
Gitlab
::
Geo
.
license_allows?
-
if
Gitlab
::
Geo
.
license_allows?
-
if
node
.
missing_oauth_application?
-
if
node
.
missing_oauth_application?
=
link_to
repair_admin_geo_node_path
(
node
),
method: :post
,
title:
'OAuth application is missing'
,
class:
'btn btn-default btn-sm prepend-left-10'
do
=
link_to
"Repair authentication"
,
repair_admin_geo_node_path
(
node
),
method: :post
,
title:
'OAuth application is missing'
,
class:
'btn btn-default btn-sm'
=
icon
(
'exclamation-triangle fw'
)
Repair authentication
-
if
node
.
secondary?
-
if
node
.
secondary?
=
toggle_node_button
(
node
)
=
toggle_node_button
(
node
)
=
link_to
admin_geo_node_path
(
node
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
'btn btn-remove btn-sm prepend-left-10'
do
=
link_to
"Remove"
,
admin_geo_node_path
(
node
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
'btn btn-remove btn-sm'
=
icon
'trash'
Remove
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