Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
Commit
e9f05037
authored
Feb 23, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add NodeGraphView
fixes #82
parent
5f1cd2ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
circle/dashboard/templates/dashboard/node-detail/home.html
+5
-4
circle/dashboard/urls.py
+5
-1
circle/dashboard/views.py
+15
-0
No files found.
circle/dashboard/templates/dashboard/node-detail/home.html
View file @
e9f05037
...
...
@@ -8,9 +8,10 @@
</dl>
</div>
<div
class=
"col-md-8"
>
<img
src=
"/static/grafikon.png"
style=
"width:45%"
/>
<img
src=
"/static/grafikon.png"
style=
"width:45%"
/>
<img
src=
"/static/grafikon.png"
style=
"width:45%"
/>
<img
src=
"/static/grafikon.png"
style=
"width:45%"
/>
{% if graphite_enabled %}
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
cpu
"
"
6h
"
%}"
style=
"width:100%"
/>
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
memory
"
"
6h
"
%}"
style=
"width:100%"
/>
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
network
"
"
6h
"
%}"
style=
"width:100%"
/>
{% endif %}
</div>
</div>
circle/dashboard/urls.py
View file @
e9f05037
...
...
@@ -8,7 +8,7 @@ from .views import (
TemplateList
,
LeaseDetail
,
NodeCreate
,
LeaseCreate
,
TemplateCreate
,
FavouriteView
,
NodeStatus
,
GroupList
,
TemplateDelete
,
LeaseDelete
,
VmGraphView
,
TemplateAclUpdateView
,
GroupDetailView
,
GroupDelete
,
GroupAclUpdateView
,
GroupUserDelete
,
GroupAclUpdateView
,
GroupUserDelete
,
NodeGraphView
)
urlpatterns
=
patterns
(
...
...
@@ -71,6 +71,10 @@ urlpatterns = patterns(
r'(?P<time>[0-9]{1,2}[hdwy])$'
),
VmGraphView
.
as_view
(),
name
=
'dashboard.views.vm-graph'
),
url
((
r'^node/(?P<pk>\d+)/graph/(?P<metric>cpu|memory|network)/'
r'(?P<time>[0-9]{1,2}[hdwy])$'
),
NodeGraphView
.
as_view
(),
name
=
'dashboard.views.node-graph'
),
url
(
r'^group/(?P<pk>\d+)/$'
,
GroupDetailView
.
as_view
(),
name
=
'dashboard.views.group-detail'
),
url
(
r'^group/(?P<pk>\d+)/acl/$'
,
GroupAclUpdateView
.
as_view
(),
...
...
circle/dashboard/views.py
View file @
e9f05037
...
...
@@ -449,6 +449,8 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
node
=
self
.
object
,
parent
=
None
)
.
order_by
(
'-started'
)
.
select_related
()
context
[
'activities'
]
=
na
context
[
'graphite_enabled'
]
=
(
NodeGraphView
.
get_graphite_url
()
is
not
None
)
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
@@ -1637,3 +1639,16 @@ class VmGraphView(GraphViewBase):
def
get_title
(
self
,
instance
,
metric
):
return
'
%
s (
%
s) -
%
s'
%
(
instance
.
name
,
instance
.
vm_name
,
metric
)
class
NodeGraphView
(
SuperuserRequiredMixin
,
GraphViewBase
):
model
=
Node
def
get_prefix
(
self
,
instance
):
return
'circle.
%
s'
%
instance
.
name
def
get_title
(
self
,
instance
,
metric
):
return
'
%
s -
%
s'
%
(
instance
.
name
,
metric
)
def
get_object
(
self
,
request
,
pk
):
return
self
.
model
.
objects
.
get
(
id
=
pk
)
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