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
39b34734
authored
Sep 01, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: don't show in progress icon in vm list for a long list
Too many SQL queries
parent
e52cd2ff
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
2 deletions
+13
-2
circle/dashboard/static/dashboard/dashboard.js
+8
-0
circle/dashboard/static/dashboard/vm-list.js
+3
-1
circle/dashboard/templates/dashboard/vm-list.html
+1
-1
circle/dashboard/views.py
+1
-0
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
39b34734
...
...
@@ -617,3 +617,11 @@ function noJS() {
$
(
'.no-js-hidden'
).
show
();
$
(
'.js-hidden'
).
hide
();
}
function
getParameterByName
(
name
)
{
name
=
name
.
replace
(
/
[\[]
/
,
"\\["
).
replace
(
/
[\]]
/
,
"\\]"
);
var
regex
=
new
RegExp
(
"[\\?&]"
+
name
+
"=([^&#]*)"
),
results
=
regex
.
exec
(
location
.
search
);
return
results
==
null
?
""
:
decodeURIComponent
(
results
[
1
].
replace
(
/
\+
/g
,
" "
));
}
circle/dashboard/static/dashboard/vm-list.js
View file @
39b34734
...
...
@@ -163,7 +163,7 @@ $(function() {
$
(
this
).
find
(
'input[type="radio"]'
).
prop
(
"checked"
,
true
);
});
if
(
checkStatusUpdate
())
{
if
(
checkStatusUpdate
()
||
$
(
"#vm-list-table tbody tr"
).
length
>=
100
)
{
updateStatuses
(
1
);
}
...
...
@@ -187,6 +187,7 @@ function checkStatusUpdate() {
function
updateStatuses
(
runs
)
{
var
include_deleted
=
getParameterByName
(
"include_deleted"
);
$
.
get
(
"/dashboard/vm/list/?compact"
,
function
(
result
)
{
$
(
"#vm-list-table tbody tr"
).
each
(
function
()
{
vm
=
$
(
this
).
data
(
"vm-pk"
);
...
...
@@ -212,6 +213,7 @@ function updateStatuses(runs) {
$
(
this
).
find
(
".node"
).
text
(
result
[
vm
].
node
);
}
}
else
{
if
(
!
include_deleted
)
$
(
this
).
remove
();
}
});
...
...
circle/dashboard/templates/dashboard/vm-list.html
View file @
39b34734
...
...
@@ -79,7 +79,7 @@
<td
class=
"name"
><a
class=
"real-link"
href=
"{% url "
dashboard
.
views
.
detail
"
i
.
pk
%}"
>
{{ i.name }}
</a>
</td>
<td
class=
"state"
>
<i
class=
"fa fa-fw
{% if i.is_in_status_change %}
{% if
show_acts_in_progress and
i.is_in_status_change %}
fa-spin fa-spinner
{% else %}
{{ i.get_status_icon }}{% endif %}"
></i>
...
...
circle/dashboard/views.py
View file @
39b34734
...
...
@@ -1792,6 +1792,7 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
else
:
context
[
'ops'
]
.
append
(
v
)
context
[
'search_form'
]
=
self
.
search_form
context
[
'show_acts_in_progress'
]
=
self
.
object_list
.
count
()
<
100
return
context
def
get
(
self
,
*
args
,
**
kwargs
):
...
...
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