Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7e1d125c
authored
Jun 25, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: only update activity feed if something has changed
parent
7451f913
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
+15
-1
circle/dashboard/static/dashboard/vm-details.js
+15
-1
No files found.
circle/dashboard/static/dashboard/vm-details.js
View file @
7e1d125c
...
@@ -328,6 +328,17 @@ function decideActivityRefresh() {
...
@@ -328,6 +328,17 @@ function decideActivityRefresh() {
return
check
;
return
check
;
}
}
/* unescapes html got via the request, also removes whitespaces and replaces all ' with " */
function
unescapeHTML
(
html
)
{
return
html
.
replace
(
/</g
,
'<'
).
replace
(
/>/g
,
'>'
).
replace
(
/&/g
,
'&'
).
replace
(
/–/g
,
"–"
).
replace
(
/
\/
/g
,
""
).
replace
(
/'/g
,
'"'
).
replace
(
/ /g
,
''
);
}
/* the html page contains some tags that were modified via js (titles for example), we delete these
also some html tags are closed with / */
function
changeHTML
(
html
)
{
return
html
.
replace
(
/data-original-title/g
,
"title"
).
replace
(
/title=""/g
,
""
).
replace
(
/
\/
/g
,
''
).
replace
(
/ /g
,
''
);
}
function
checkNewActivity
(
only_status
,
runs
)
{
function
checkNewActivity
(
only_status
,
runs
)
{
// set default only_status to false
// set default only_status to false
only_status
=
typeof
only_status
!==
'undefined'
?
only_status
:
false
;
only_status
=
typeof
only_status
!==
'undefined'
?
only_status
:
false
;
...
@@ -339,7 +350,10 @@ function checkNewActivity(only_status, runs) {
...
@@ -339,7 +350,10 @@ function checkNewActivity(only_status, runs) {
data
:
{
'only_status'
:
only_status
},
data
:
{
'only_status'
:
only_status
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
!
only_status
)
{
if
(
!
only_status
)
{
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
a
=
unescapeHTML
(
data
[
'activities'
]);
b
=
changeHTML
(
$
(
"#activity-timeline"
).
html
());
if
(
a
!=
b
)
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
$
(
"#ops"
).
html
(
data
[
'ops'
]);
$
(
"#ops"
).
html
(
data
[
'ops'
]);
$
(
"[title]"
).
tooltip
();
$
(
"[title]"
).
tooltip
();
}
}
...
...
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