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
98118b72
authored
Apr 03, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add instance quotas to dashboard
parent
484ed29e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
.idea/workspace.xml
+0
-0
circle/dashboard/templates/dashboard/index-vm.html
+1
-1
circle/dashboard/views/index.py
+3
-1
No files found.
.idea/workspace.xml
View file @
98118b72
This diff is collapsed.
Click to expand it.
circle/dashboard/templates/dashboard/index-vm.html
View file @
98118b72
...
...
@@ -89,7 +89,7 @@
</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-max=
"
#TODO
"
data-width=
"100"
data-height=
"100"
data-readOnly=
"true"
value=
"{{ instances|length|add:more_instances }}"
>
<input
class=
"knob"
data-fgColor=
"chartreuse"
data-thickness=
".4"
data-max=
"
{{ max_instances }}
"
data-width=
"100"
data-height=
"100"
data-readOnly=
"true"
value=
"{{ instances|length|add:more_instances }}"
>
</p>
<span
class=
"bigbig"
>
{% blocktrans with count=running_vm_num %}
<span
class=
"big-tag"
>
{{ count }}
</span>
running{% endblocktrans %}
</span>
<ul
class=
"list-inline"
style=
"max-height: 95px; overflow: hidden;"
>
...
...
circle/dashboard/views/index.py
View file @
98118b72
...
...
@@ -42,10 +42,12 @@ class IndexView(LoginRequiredMixin, TemplateView):
context
=
super
(
IndexView
,
self
)
.
get_context_data
(
**
kwargs
)
instances
=
openstack_api
.
nova
.
server_list
(
self
.
request
)[
0
]
#TODO: flatten?
quotas
=
openstack_api
.
nova
.
tenant_quota_get
(
self
.
request
,
user
.
project_id
)
context
.
update
({
'instances'
:
instances
[:
5
],
'more_instances'
:
len
(
instances
)
-
len
(
instances
[:
5
])
'more_instances'
:
len
(
instances
)
-
len
(
instances
[:
5
]),
'max_instances'
:
quotas
.
get
(
"instances"
)
.
limit
})
# instances
...
...
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