Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
3e6ca4e7
authored
Apr 15, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add get to nodelist - blank text to icon/status
parent
c638d635
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
circle/dashboard/views.py
+16
-0
No files found.
circle/dashboard/views.py
View file @
3e6ca4e7
...
@@ -925,6 +925,22 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
...
@@ -925,6 +925,22 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
table_class
=
NodeListTable
table_class
=
NodeListTable
table_pagination
=
False
table_pagination
=
False
def
get
(
self
,
*
args
,
**
kwargs
):
if
self
.
request
.
is_ajax
():
nodes
=
Node
.
objects
.
all
()
nodes
=
[{
'pk'
:
i
.
pk
,
'name'
:
i
.
name
,
'icon'
:
''
,
'status'
:
''
}
for
i
in
nodes
]
return
HttpResponse
(
json
.
dumps
(
list
(
nodes
)),
# instances is ValuesQuerySet
content_type
=
"application/json"
,
)
else
:
return
super
(
NodeList
,
self
)
.
get
(
*
args
,
**
kwargs
)
def
get_queryset
(
self
):
def
get_queryset
(
self
):
return
Node
.
objects
.
annotate
(
return
Node
.
objects
.
annotate
(
number_of_VMs
=
Count
(
'instance_set'
))
.
select_related
(
'host'
)
number_of_VMs
=
Count
(
'instance_set'
))
.
select_related
(
'host'
)
...
...
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