Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
circle/dashboard/static/dashboard/vm-details.js
+14
-0
No files found.
circle/dashboard/static/dashboard/vm-details.js
View file @
7e1d125c
...
...
@@ -328,6 +328,17 @@ function decideActivityRefresh() {
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
)
{
// set default only_status to false
only_status
=
typeof
only_status
!==
'undefined'
?
only_status
:
false
;
...
...
@@ -339,6 +350,9 @@ function checkNewActivity(only_status, runs) {
data
:
{
'only_status'
:
only_status
},
success
:
function
(
data
)
{
if
(
!
only_status
)
{
a
=
unescapeHTML
(
data
[
'activities'
]);
b
=
changeHTML
(
$
(
"#activity-timeline"
).
html
());
if
(
a
!=
b
)
$
(
"#activity-timeline"
).
html
(
data
[
'activities'
]);
$
(
"#ops"
).
html
(
data
[
'ops'
]);
$
(
"[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