Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7a61fb2f
authored
Oct 09, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: remove static data from virtual machines box in index view
parent
216c7a1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
circle/dashboard/templates/dashboard/index-vm.html
+6
-6
circle/dashboard/views.py
+6
-1
No files found.
circle/dashboard/templates/dashboard/index-vm.html
View file @
7a61fb2f
...
...
@@ -38,15 +38,15 @@
</div>
</div>
<div
class=
"panel-body"
id=
"vm-graph-view"
style=
"display: none"
>
<p
class=
"pull-right"
>
<input
class=
"knob"
data-fgColor=
"chartreuse"
data-thickness=
".4"
data-
width=
"100"
data-height=
"100"
data-readOnly=
"true"
value=
"22
"
></p>
<p><span
class=
"bigbig"
><big>
13
</big>
running
</span>
<p
class=
"pull-right"
>
<input
class=
"knob"
data-fgColor=
"chartreuse"
data-thickness=
".4"
data-
max=
"10"
data-width=
"100"
data-height=
"100"
data-readOnly=
"true"
value=
"{{ instances|length|add:more_instances }}
"
></p>
<p><span
class=
"bigbig"
><big>
{{ running_vm_num }}
</big>
running
</span>
<ul
class=
"list-inline"
>
<li
class=
"label label-success"
><i
class=
"icon-play-sign"
></i>
szilva
</li>
<li
class=
"label label-success"
><i
class=
"icon-play-sign"
></i>
korte
</li>
<li
class=
"label label-success"
><i
class=
"icon-play-sign"
></i>
cseresznye
</li>
{% for vm in running_vms %}
<li
class=
"label label-success"
><i
class=
"icon-play-sign"
></i>
{{ vm.name}}
</li>
{% endfor %}
</ul>
</p>
<p
class=
"big text-warning"
><big>
10
</big>
stopped
</p>
<p
class=
"big text-warning"
><big>
{{ stopped_vm_num }}
</big>
stopped
</p>
<p>
Total: $3000
</p>
<div
class=
"clearfix"
></div>
...
...
circle/dashboard/views.py
View file @
7a61fb2f
...
...
@@ -20,10 +20,15 @@ class IndexView(TemplateView):
context
=
super
(
IndexView
,
self
)
.
get_context_data
(
**
kwargs
)
context
.
update
({
'instances'
:
instances
[:
5
],
'more_instances'
:
instances
.
count
()
-
len
(
instances
[:
5
])
})
stopped_vm_states
=
[
'PAUSED'
,
'SHUTDOWN'
,
'SHUTOFF'
]
context
.
update
({
'more_instances'
:
instances
.
count
()
-
len
(
instances
[:
5
])
'running_vms'
:
instances
.
filter
(
state
=
'RUNNING'
),
'running_vm_num'
:
instances
.
filter
(
state
=
'RUNNING'
)
.
count
(),
'stopped_vm_num'
:
instances
.
filter
(
state__in
=
stopped_vm_states
)
.
count
()
})
return
context
...
...
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