Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e00127f9
authored
Oct 27, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-319v2'
Conflicts: circle/dashboard/static/dashboard/node-details.js
parents
3d81d408
5eba485c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
27 deletions
+19
-27
circle/dashboard/static/dashboard/dashboard.js
+19
-4
circle/dashboard/static/dashboard/disk-list.js
+0
-23
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
e00127f9
...
...
@@ -428,7 +428,7 @@ function generateVmHTML(pk, name, host, icon, _status, fav, is_last) {
return
'<a href="/dashboard/vm/'
+
pk
+
'/" class="list-group-item'
+
(
is_last
?
' list-group-item-last'
:
''
)
+
'">'
+
'<span class="index-vm-list-name">'
+
'<i class="fa '
+
icon
+
'" title="'
+
_status
+
'"></i> '
+
name
+
'<i class="fa '
+
icon
+
'" title="'
+
_status
+
'"></i> '
+
safe_tags_replace
(
name
)
+
'</span>'
+
'<small class="text-muted"> '
+
host
+
'</small>'
+
'<div class="pull-right dashboard-vm-favourite" data-vm="'
+
pk
+
'">'
+
...
...
@@ -441,14 +441,14 @@ function generateVmHTML(pk, name, host, icon, _status, fav, is_last) {
function
generateGroupHTML
(
url
,
name
,
is_last
)
{
return
'<a href="'
+
url
+
'" class="list-group-item real-link'
+
(
is_last
?
" list-group-item-last"
:
""
)
+
'">'
+
'<i class="fa fa-users"></i> '
+
name
+
'<i class="fa fa-users"></i> '
+
safe_tags_replace
(
name
)
+
'</a>'
;
}
function
generateNodeHTML
(
name
,
icon
,
_status
,
url
,
is_last
)
{
return
'<a href="'
+
url
+
'" class="list-group-item real-link'
+
(
is_last
?
' list-group-item-last'
:
''
)
+
'">'
+
'<span class="index-node-list-name">'
+
'<i class="fa '
+
icon
+
'" title="'
+
_status
+
'"></i> '
+
name
+
'<i class="fa '
+
icon
+
'" title="'
+
_status
+
'"></i> '
+
safe_tags_replace
(
name
)
+
'</span>'
+
'<div style="clear: both;"></div>'
+
'</a>'
;
...
...
@@ -456,7 +456,7 @@ function generateNodeHTML(name, icon, _status, url, is_last) {
function
generateNodeTagHTML
(
name
,
icon
,
_status
,
label
,
url
)
{
return
'<a href="'
+
url
+
'" class="label '
+
label
+
'" >'
+
'<i class="fa '
+
icon
+
'" title="'
+
_status
+
'"></i> '
+
name
+
'<i class="fa '
+
icon
+
'" title="'
+
_status
+
'"></i> '
+
safe_tags_replace
(
name
)
+
'</a> '
;
}
...
...
@@ -678,3 +678,18 @@ function getParameterByName(name) {
results
=
regex
.
exec
(
location
.
search
);
return
results
==
null
?
""
:
decodeURIComponent
(
results
[
1
].
replace
(
/
\+
/g
,
" "
));
}
var
tagsToReplace
=
{
'&'
:
'&'
,
'<'
:
'<'
,
'>'
:
'>'
};
function
replaceTag
(
tag
)
{
return
tagsToReplace
[
tag
]
||
tag
;
}
function
safe_tags_replace
(
str
)
{
return
str
.
replace
(
/
[
&<>
]
/g
,
replaceTag
);
}
circle/dashboard/static/dashboard/disk-list.js
deleted
100644 → 0
View file @
3d81d408
$
(
function
()
{
$
(
".disk-list-disk-percentage"
).
each
(
function
()
{
var
disk
=
$
(
this
).
data
(
"disk-pk"
);
var
element
=
$
(
this
);
refreshDisk
(
disk
,
element
);
});
});
function
refreshDisk
(
disk
,
element
)
{
$
.
get
(
"/dashboard/disk/"
+
disk
+
"/status/"
,
function
(
result
)
{
if
(
result
.
percentage
==
null
||
result
.
failed
==
"True"
)
{
location
.
reload
();
}
else
{
var
diff
=
result
.
percentage
-
parseInt
(
element
.
html
());
var
refresh
=
5
-
diff
;
refresh
=
refresh
<
1
?
1
:
(
result
.
percentage
==
0
?
1
:
refresh
);
if
(
isNaN
(
refresh
))
refresh
=
2
;
// this should not happen
element
.
html
(
result
.
percentage
);
setTimeout
(
function
()
{
refreshDisk
(
disk
,
element
)},
refresh
*
1000
);
}
});
}
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