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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
41aea907
authored
Feb 10, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix vm search
parent
566e74c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
circle/dashboard/views.py
+8
-4
No files found.
circle/dashboard/views.py
View file @
41aea907
...
@@ -96,7 +96,8 @@ class IndexView(LoginRequiredMixin, TemplateView):
...
@@ -96,7 +96,8 @@ class IndexView(LoginRequiredMixin, TemplateView):
})
})
running
=
[
i
for
i
in
instances
if
i
.
state
==
'RUNNING'
]
running
=
[
i
for
i
in
instances
if
i
.
state
==
'RUNNING'
]
stopped
=
[
i
for
i
in
instances
if
i
.
state
not
in
[
'RUNNING'
,
'NOSTATE'
]]
stopped
=
[
i
for
i
in
instances
if
i
.
state
not
in
[
'RUNNING'
,
'NOSTATE'
]]
context
.
update
({
context
.
update
({
'running_vms'
:
running
,
'running_vms'
:
running
,
'running_vm_num'
:
len
(
running
),
'running_vm_num'
:
len
(
running
),
...
@@ -666,9 +667,12 @@ class VmList(LoginRequiredMixin, SingleTableView):
...
@@ -666,9 +667,12 @@ class VmList(LoginRequiredMixin, SingleTableView):
favourite__user
=
self
.
request
.
user
)
.
values_list
(
'pk'
,
flat
=
True
)
favourite__user
=
self
.
request
.
user
)
.
values_list
(
'pk'
,
flat
=
True
)
instances
=
Instance
.
get_objects_with_level
(
instances
=
Instance
.
get_objects_with_level
(
'user'
,
self
.
request
.
user
)
.
filter
(
'user'
,
self
.
request
.
user
)
.
filter
(
destroyed
=
None
)
.
values
(
'pk'
,
'name'
,
'state'
)
destroyed
=
None
)
.
all
()
for
i
in
instances
:
instances
=
[{
i
[
'fav'
]
=
True
if
i
[
'pk'
]
in
favs
else
False
'pk'
:
i
.
pk
,
'name'
:
i
.
name
,
'state'
:
i
.
state
,
'fav'
:
i
.
pk
in
favs
}
for
i
in
instances
]
return
HttpResponse
(
return
HttpResponse
(
json
.
dumps
(
list
(
instances
)),
# instances is ValuesQuerySet
json
.
dumps
(
list
(
instances
)),
# instances is ValuesQuerySet
content_type
=
"application/json"
,
content_type
=
"application/json"
,
...
...
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