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
5d467f01
Commit
5d467f01
authored
Oct 06, 2018
by
Gabriel Mazetto
Committed by
Douglas Barbosa Alexandre
Oct 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Add a Geo Status Widget to Admin > Projects
parent
6dba97cf
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
38 deletions
+111
-38
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+2
-0
ee/app/assets/stylesheets/pages/geo_nodes.scss
ee/app/assets/stylesheets/pages/geo_nodes.scss
+2
-1
ee/app/views/admin/geo/projects/_registry_failed.html.haml
ee/app/views/admin/geo/projects/_registry_failed.html.haml
+18
-16
ee/app/views/admin/geo/projects/_registry_never.html.haml
ee/app/views/admin/geo/projects/_registry_never.html.haml
+18
-16
ee/app/views/admin/geo/projects/_registry_pending.html.haml
ee/app/views/admin/geo/projects/_registry_pending.html.haml
+0
-1
ee/app/views/admin/geo/projects/_registry_synced.html.haml
ee/app/views/admin/geo/projects/_registry_synced.html.haml
+0
-1
ee/app/views/admin/projects/_geo_status_widget.html.haml
ee/app/views/admin/projects/_geo_status_widget.html.haml
+10
-0
ee/changelogs/unreleased/7126-admin-projects-geo-status.yml
ee/changelogs/unreleased/7126-admin-projects-geo-status.yml
+5
-0
ee/spec/controllers/admin/projects_controller_spec.rb
ee/spec/controllers/admin/projects_controller_spec.rb
+42
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-3
spec/controllers/admin/projects_controller_spec.rb
spec/controllers/admin/projects_controller_spec.rb
+11
-0
No files found.
app/views/admin/projects/show.html.haml
View file @
5d467f01
...
...
@@ -114,6 +114,8 @@
=
visibility_level_icon
(
@project
.
visibility_level
)
=
visibility_level_label
(
@project
.
visibility_level
)
=
render_if_exists
'admin/projects/geo_status_widget'
,
locals:
{
project:
@project
}
.card
.card-header
Transfer project
...
...
ee/app/assets/stylesheets/pages/geo_nodes.scss
View file @
5d467f01
...
...
@@ -177,7 +177,8 @@
}
}
.geo-admin-projects
{
.geo-admin-projects
,
.admin-projects
{
.card-header
{
.header-text-primary
,
.header-text-secondary
{
...
...
ee/app/views/admin/geo/projects/_registry_failed.html.haml
View file @
5d467f01
...
...
@@ -21,11 +21,6 @@
=
time_ago_with_tooltip
(
project_registry
.
last_repository_synced_at
,
placement:
'bottom'
)
-
else
=
s_
(
'Geo|Waiting for scheduler'
)
.col-sm.project-status-container
.project-status-title.text-muted
=
s_
(
'Geo|Retry count'
)
.project-status-content
=
project_registry
.
repository_retry_count
.
nil?
?
0
:
project_registry
.
repository_retry_count
.project-card-errors
.card-header.bg-transparent.border-bottom-0.border-top
...
...
@@ -41,6 +36,8 @@
'aria-labelledby'
=>
"project-#{project_registry.project_id}-header"
}
.card-body
.container.project-container
.row
.col-sm-8.project-status-container
%ul
.unstyled-list.errors-list
-
if
project_registry
.
last_repository_sync_failure
%li
.p-0.d-flex
...
...
@@ -52,3 +49,8 @@
=
sprite_icon
(
'warning'
,
size:
18
,
css_class:
'error-icon'
)
%span
.error-text.prepend-left-5
=
s_
(
'Geo|Verification failed - %{error}'
)
%
{
error:
project_registry
.
last_repository_verification_failure
}
.col-sm-4.project-status-container
.project-status-title.text-muted
=
s_
(
'Geo|Retry count'
)
.project-status-content
=
project_registry
.
repository_retry_count
.
nil?
?
0
:
project_registry
.
repository_retry_count
ee/app/views/admin/geo/projects/_registry_never.html.haml
View file @
5d467f01
...
...
@@ -21,11 +21,6 @@
=
time_ago_with_tooltip
(
project_registry
.
last_repository_synced_at
,
placement:
'bottom'
)
-
else
=
s_
(
'Geo|Waiting for scheduler'
)
.col-sm.project-status-container
.project-status-title.text-muted
=
s_
(
'Geo|Retry counts'
)
.project-status-content
=
project_registry
.
repository_retry_count
.
nil?
?
0
:
project_registry
.
repository_retry_count
-
if
project_registry
.
last_repository_sync_failure
||
project_registry
.
last_repository_verification_failure
.project-card-errors
...
...
@@ -42,6 +37,8 @@
'aria-labelledby'
=>
"project-#{project_registry.project_id}-header"
}
.card-body
.container.project-container
.row
.col-sm-8.project-status-container
%ul
.unstyled-list.errors-list
-
if
project_registry
.
last_repository_sync_failure
%li
.p-0.d-flex
...
...
@@ -53,3 +50,8 @@
=
sprite_icon
(
'warning'
,
size:
18
,
css_class:
'error-icon'
)
%span
.error-text.prepend-left-5
=
s_
(
'Geo|Verification failed - %{error}'
)
%
{
error:
project_registry
.
last_repository_verification_failure
}
.col-sm-4.project-status-container
.project-status-title.text-muted
=
s_
(
'Geo|Retry count'
)
.project-status-content
=
project_registry
.
repository_retry_count
.
nil?
?
0
:
project_registry
.
repository_retry_count
ee/app/views/admin/geo/projects/_registry_pending.html.haml
View file @
5d467f01
...
...
@@ -21,4 +21,3 @@
=
time_ago_with_tooltip
(
project_registry
.
last_repository_synced_at
,
placement:
'bottom'
)
-
else
=
s_
(
'Geo|Never'
)
.col-sm.d-sm-none.d-md-block
ee/app/views/admin/geo/projects/_registry_synced.html.haml
View file @
5d467f01
...
...
@@ -21,4 +21,3 @@
=
time_ago_with_tooltip
(
project_registry
.
last_repository_check_at
,
placement:
'bottom'
)
-
else
=
s_
(
'Geo|Never'
)
.col-sm.d-sm-none.d-md-block
ee/app/views/admin/projects/_geo_status_widget.html.haml
0 → 100644
View file @
5d467f01
-
if
Gitlab
::
Geo
.
secondary?
&&
@project
.
project_registry
.card
.card-header
=
s_
(
'Geo|Geo Status'
)
.float-right
=
link_to
(
recheck_admin_geo_project_path
(
@project
.
project_registry
),
method: :post
,
class:
'btn btn-default btn-sm mr-2'
)
do
=
s_
(
'Geo|Recheck'
)
=
link_to
(
resync_admin_geo_project_path
(
@project
.
project_registry
),
method: :post
,
class:
'btn btn-default-primary btn-sm'
)
do
=
s_
(
'Geo|Resync'
)
=
render
partial:
"admin/geo/projects/registry_
#{
@project
.
project_registry
.
synchronization_state
}
"
,
locals:
{
project_registry:
@project
.
project_registry
}
ee/changelogs/unreleased/7126-admin-projects-geo-status.yml
0 → 100644
View file @
5d467f01
---
title
:
'
Geo:
Add
a
Geo
Status
Widget
to
Admin
>
Projects'
merge_request
:
7789
author
:
type
:
added
ee/spec/controllers/admin/projects_controller_spec.rb
0 → 100644
View file @
5d467f01
# frozen_string_literal: true
require
'spec_helper'
describe
Admin
::
ProjectsController
do
include
EE
::
GeoHelpers
let!
(
:project_registry
)
{
create
(
:geo_project_registry
)
}
let
(
:project
)
{
project_registry
.
project
}
before
do
sign_in
(
create
(
:admin
))
end
describe
'GET /projects/:id'
do
subject
{
get
:show
,
namespace_id:
project
.
namespace
.
path
,
id:
project
.
path
}
render_views
it
'includes Geo Status widget partial'
do
expect
(
subject
).
to
have_gitlab_http_status
(
200
)
expect
(
subject
.
body
).
to
match
(
project
.
name
)
expect
(
subject
).
to
render_template
(
partial:
'admin/projects/_geo_status_widget'
)
end
context
'when Geo is enabled and is a secondary node'
do
before
do
stub_current_geo_node
(
create
(
:geo_node
))
end
it
'renders Geo Status widget'
do
expect
(
subject
.
body
).
to
match
(
'Geo Status'
)
end
end
context
'without Geo enabled'
do
it
'doesnt render Geo Status widget'
do
expect
(
subject
.
body
).
not_to
match
(
'Geo Status'
)
end
end
end
end
locale/gitlab.pot
View file @
5d467f01
...
...
@@ -3658,6 +3658,9 @@ msgstr ""
msgid "Geo|File sync capacity"
msgstr ""
msgid "Geo|Geo Status"
msgstr ""
msgid "Geo|Groups to synchronize"
msgstr ""
...
...
@@ -3718,9 +3721,6 @@ msgstr ""
msgid "Geo|Retry count"
msgstr ""
msgid "Geo|Retry counts"
msgstr ""
msgid "Geo|Select groups to replicate."
msgstr ""
...
...
spec/controllers/admin/projects_controller_spec.rb
View file @
5d467f01
...
...
@@ -42,4 +42,15 @@ describe Admin::ProjectsController do
expect
{
get
:index
}.
not_to
exceed_query_limit
(
control_count
)
end
end
describe
'GET /projects/:id'
do
render_views
it
'renders show page'
do
get
:show
,
namespace_id:
project
.
namespace
.
path
,
id:
project
.
path
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
.
body
).
to
match
(
project
.
name
)
end
end
end
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