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
2568fa6d
Commit
2568fa6d
authored
Aug 30, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for taggling advanced status in Geo
parent
642fc9cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
7 deletions
+48
-7
app/assets/javascripts/geo_nodes.js
app/assets/javascripts/geo_nodes.js
+9
-0
app/assets/stylesheets/pages/geo_nodes.scss
app/assets/stylesheets/pages/geo_nodes.scss
+18
-0
app/models/geo_node_status.rb
app/models/geo_node_status.rb
+9
-1
app/views/admin/geo_nodes/index.html.haml
app/views/admin/geo_nodes/index.html.haml
+12
-6
No files found.
app/assets/javascripts/geo_nodes.js
View file @
2568fa6d
...
@@ -25,6 +25,8 @@ class GeoNodeStatus {
...
@@ -25,6 +25,8 @@ class GeoNodeStatus {
this
.
$lastCursorEvent
=
$
(
'
.js-last-cursor-event
'
,
this
.
$status
);
this
.
$lastCursorEvent
=
$
(
'
.js-last-cursor-event
'
,
this
.
$status
);
this
.
$health
=
$
(
'
.js-health
'
,
this
.
$status
);
this
.
$health
=
$
(
'
.js-health
'
,
this
.
$status
);
this
.
endpoint
=
this
.
$el
.
data
(
'
status-url
'
);
this
.
endpoint
=
this
.
$el
.
data
(
'
status-url
'
);
this
.
$advancedStatus
=
$
(
'
.js-advanced-geo-node-status-toggler
'
,
this
.
$status
)
this
.
$advancedStatus
.
on
(
'
click
'
,
this
.
toggleShowAdvancedStatus
);
this
.
statusInterval
=
new
gl
.
SmartInterval
({
this
.
statusInterval
=
new
gl
.
SmartInterval
({
callback
:
this
.
getStatus
.
bind
(
this
),
callback
:
this
.
getStatus
.
bind
(
this
),
...
@@ -36,6 +38,13 @@ class GeoNodeStatus {
...
@@ -36,6 +38,13 @@ class GeoNodeStatus {
});
});
}
}
toggleShowAdvancedStatus
(
e
)
{
const
element
=
$
(
e
.
currentTarget
);
const
closestStatus
=
element
.
siblings
().
next
(
'
.advanced-status
'
)
element
.
find
(
'
.fa
'
).
toggleClass
(
'
fa-angle-down
'
).
toggleClass
(
'
fa-angle-up
'
);
closestStatus
.
toggleClass
(
'
hide-status
'
);
}
getStatus
()
{
getStatus
()
{
$
.
getJSON
(
this
.
endpoint
,
(
status
)
=>
{
$
.
getJSON
(
this
.
endpoint
,
(
status
)
=>
{
this
.
setStatusIcon
(
status
.
healthy
);
this
.
setStatusIcon
(
status
.
healthy
);
...
...
app/assets/stylesheets/pages/geo_nodes.scss
View file @
2568fa6d
...
@@ -29,6 +29,24 @@
...
@@ -29,6 +29,24 @@
}
}
}
}
.js-advanced-geo-node-status-toggler
{
color
:
$gl-link-color
;
padding
:
10px
0
0
;
cursor
:
pointer
;
position
:
relative
;
z-index
:
2
;
&
:hover
span
{
color
:
$gl-link-color
;
text-decoration
:
underline
;
}
}
.hide-status
{
display
:
none
;
background
:
transparent
;
}
.node-info
{
.node-info
{
color
:
$gl-text-color
;
color
:
$gl-text-color
;
}
}
...
...
app/models/geo_node_status.rb
View file @
2568fa6d
...
@@ -21,7 +21,7 @@ class GeoNodeStatus
...
@@ -21,7 +21,7 @@ class GeoNodeStatus
def
db_replication_lag
=
(
value
)
def
db_replication_lag
=
(
value
)
@db_replication_lag
=
value
@db_replication_lag
=
value
end
end
def
last_event_id
def
last_event_id
@last_event_id
||=
latest_event
&
.
id
@last_event_id
||=
latest_event
&
.
id
end
end
...
@@ -58,6 +58,14 @@ class GeoNodeStatus
...
@@ -58,6 +58,14 @@ class GeoNodeStatus
@cursor_last_event_date
=
value
@cursor_last_event_date
=
value
end
end
def
db_replication_lag
@db_replication_lag
||=
Gitlab
::
Geo
::
HealthCheck
.
db_replication_lag
end
def
db_replication_lag
=
(
value
)
@db_replication_lag
=
value
end
def
repositories_count
def
repositories_count
@repositories_count
||=
repositories
.
count
@repositories_count
||=
repositories
.
count
end
end
...
...
app/views/admin/geo_nodes/index.html.haml
View file @
2568fa6d
...
@@ -66,12 +66,18 @@
...
@@ -66,12 +66,18 @@
Attachments synced:
Attachments synced:
%strong
.node-info.js-attachments-synced
%strong
.node-info.js-attachments-synced
%p
%p
%span
.help-block
.js-advanced-geo-node-status-toggler
Last event ID seen from primary:
%i
.fa.fa-angle-down
%strong
.node-info.js-last-event-seen
%span
%span
.help-block
Advanced
Last event ID processed by cursor:
%p
%strong
.node-info.js-last-cursor-event
.advanced-status.hide-status
%span
.help-block
Last event ID seen from primary:
%strong
.node-info.js-last-event-seen
%span
.help-block
Last event ID processed by cursor:
%strong
.node-info.js-last-cursor-event
%p
%p
.js-health
.js-health
...
...
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