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
fc1447b0
Commit
fc1447b0
authored
Nov 09, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eslint issues with app/assets/javascripts/geo_nodes.js
parent
e3c1885b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
70 deletions
+70
-70
app/assets/javascripts/geo_nodes.js
app/assets/javascripts/geo_nodes.js
+70
-70
No files found.
app/assets/javascripts/geo_nodes.js
View file @
fc1447b0
...
@@ -82,76 +82,76 @@ class GeoNodeStatus {
...
@@ -82,76 +82,76 @@ class GeoNodeStatus {
this
.
setHealthStatus
(
status
.
healthy
);
this
.
setHealthStatus
(
status
.
healthy
);
// Replication lag can be nil if the secondary isn't actually streaming
// Replication lag can be nil if the secondary isn't actually streaming
if
(
status
.
db_replication_lag_seconds
!==
null
&&
status
.
db_replication_lag_seconds
>=
0
)
{
if
(
status
.
db_replication_lag_seconds
!==
null
&&
status
.
db_replication_lag_seconds
>=
0
)
{
const
parsedTime
=
parseSeconds
(
status
.
db_replication_lag_seconds
,
{
const
parsedTime
=
parseSeconds
(
status
.
db_replication_lag_seconds
,
{
hoursPerDay
:
24
,
hoursPerDay
:
24
,
daysPerWeek
:
7
,
daysPerWeek
:
7
,
});
});
this
.
$dbReplicationLag
.
text
(
stringifyTime
(
parsedTime
));
this
.
$dbReplicationLag
.
text
(
stringifyTime
(
parsedTime
));
}
else
{
}
else
{
this
.
$dbReplicationLag
.
text
(
'
UNKNOWN
'
);
this
.
$dbReplicationLag
.
text
(
'
UNKNOWN
'
);
}
}
const
repoText
=
GeoNodeStatus
.
formatCountAndPercentage
(
const
repoText
=
GeoNodeStatus
.
formatCountAndPercentage
(
status
.
repositories_synced_count
,
status
.
repositories_synced_count
,
status
.
repositories_count
,
status
.
repositories_count
,
status
.
repositories_synced_in_percentage
);
status
.
repositories_synced_in_percentage
);
const
repoFailedText
=
GeoNodeStatus
.
formatCount
(
status
.
repositories_failed_count
);
const
repoFailedText
=
GeoNodeStatus
.
formatCount
(
status
.
repositories_failed_count
);
const
lfsText
=
GeoNodeStatus
.
formatCountAndPercentage
(
const
lfsText
=
GeoNodeStatus
.
formatCountAndPercentage
(
status
.
lfs_objects_synced_count
,
status
.
lfs_objects_synced_count
,
status
.
lfs_objects_count
,
status
.
lfs_objects_count
,
status
.
lfs_objects_synced_in_percentage
);
status
.
lfs_objects_synced_in_percentage
);
const
lfsFailedText
=
GeoNodeStatus
.
formatCount
(
status
.
lfs_objects_failed_count
);
const
lfsFailedText
=
GeoNodeStatus
.
formatCount
(
status
.
lfs_objects_failed_count
);
const
attachmentText
=
GeoNodeStatus
.
formatCountAndPercentage
(
const
attachmentText
=
GeoNodeStatus
.
formatCountAndPercentage
(
status
.
attachments_synced_count
,
status
.
attachments_synced_count
,
status
.
attachments_count
,
status
.
attachments_count
,
status
.
attachments_synced_in_percentage
);
status
.
attachments_synced_in_percentage
);
const
attachmentFailedText
=
GeoNodeStatus
.
formatCount
(
status
.
attachments_failed_count
);
const
attachmentFailedText
=
GeoNodeStatus
.
formatCount
(
status
.
attachments_failed_count
);
this
.
$repositoriesSynced
.
text
(
repoText
);
this
.
$repositoriesSynced
.
text
(
repoText
);
this
.
$repositoriesFailed
.
text
(
repoFailedText
);
this
.
$repositoriesFailed
.
text
(
repoFailedText
);
this
.
$lfsObjectsSynced
.
text
(
lfsText
);
this
.
$lfsObjectsSynced
.
text
(
lfsText
);
this
.
$lfsObjectsFailed
.
text
(
lfsFailedText
);
this
.
$lfsObjectsFailed
.
text
(
lfsFailedText
);
this
.
$attachmentsSynced
.
text
(
attachmentText
);
this
.
$attachmentsSynced
.
text
(
attachmentText
);
this
.
$attachmentsFailed
.
text
(
attachmentFailedText
);
this
.
$attachmentsFailed
.
text
(
attachmentFailedText
);
let
eventDate
=
notAvailable
;
let
eventDate
=
notAvailable
;
let
cursorDate
=
notAvailable
;
let
cursorDate
=
notAvailable
;
let
lastEventSeen
=
notAvailable
;
let
lastEventSeen
=
notAvailable
;
let
lastCursorEvent
=
notAvailable
;
let
lastCursorEvent
=
notAvailable
;
if
(
status
.
last_event_timestamp
!==
null
&&
status
.
last_event_timestamp
>
0
)
{
if
(
status
.
last_event_timestamp
!==
null
&&
status
.
last_event_timestamp
>
0
)
{
eventDate
=
gl
.
utils
.
formatDate
(
new
Date
(
status
.
last_event_timestamp
*
1000
));
eventDate
=
gl
.
utils
.
formatDate
(
new
Date
(
status
.
last_event_timestamp
*
1000
));
}
}
if
(
status
.
cursor_last_event_timestamp
!==
null
&&
status
.
cursor_last_event_timestamp
>
0
)
{
if
(
status
.
cursor_last_event_timestamp
!==
null
&&
status
.
cursor_last_event_timestamp
>
0
)
{
cursorDate
=
gl
.
utils
.
formatDate
(
new
Date
(
status
.
cursor_last_event_timestamp
*
1000
));
cursorDate
=
gl
.
utils
.
formatDate
(
new
Date
(
status
.
cursor_last_event_timestamp
*
1000
));
}
}
if
(
status
.
last_event_id
!==
null
)
{
if
(
status
.
last_event_id
!==
null
)
{
lastEventSeen
=
`
${
status
.
last_event_id
}
(
${
eventDate
}
)`
;
lastEventSeen
=
`
${
status
.
last_event_id
}
(
${
eventDate
}
)`
;
}
}
if
(
status
.
cursor_last_event_id
!==
null
)
{
if
(
status
.
cursor_last_event_id
!==
null
)
{
lastCursorEvent
=
`
${
status
.
cursor_last_event_id
}
(
${
cursorDate
}
)`
;
lastCursorEvent
=
`
${
status
.
cursor_last_event_id
}
(
${
cursorDate
}
)`
;
}
}
this
.
$lastEventSeen
.
text
(
lastEventSeen
);
this
.
$lastEventSeen
.
text
(
lastEventSeen
);
this
.
$lastCursorEvent
.
text
(
lastCursorEvent
);
this
.
$lastCursorEvent
.
text
(
lastCursorEvent
);
if
(
status
.
health
===
'
Healthy
'
)
{
if
(
status
.
health
===
'
Healthy
'
)
{
this
.
$health
.
text
(
''
);
this
.
$health
.
text
(
''
);
}
else
{
}
else
{
const
strippedData
=
$
(
'
<div>
'
).
html
(
`
${
status
.
health
}
`
).
text
();
const
strippedData
=
$
(
'
<div>
'
).
html
(
`
${
status
.
health
}
`
).
text
();
this
.
$health
.
html
(
`<code class="geo-health">
${
strippedData
}
</code>`
);
this
.
$health
.
html
(
`<code class="geo-health">
${
strippedData
}
</code>`
);
}
}
this
.
$status
.
show
();
this
.
$status
.
show
();
}
}
handleError
(
err
)
{
handleError
(
err
)
{
...
...
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