Commit 0107aa6d by Kálmán Viktor

dashboard: add graph time options

parent d3fb12c8
......@@ -123,9 +123,17 @@
</div>
<div class="col-md-8">
{% if graphite_enabled %}
<img src="{% url "dashboard.views.vm-graph" instance.pk "cpu" "6h" %}" style="width:100%"/>
<img src="{% url "dashboard.views.vm-graph" instance.pk "memory" "6h" %}" style="width:100%"/>
<img src="{% url "dashboard.views.vm-graph" instance.pk "network" "6h" %}" style="width:100%"/>
<div class="text-center">
{% for o in graph_time_options %}
<a class="btn btn-default btn-xs"
href="?graph_time={{ o.time }}">
{{ o.name }}
</a>
{% endfor %}
</div>
<img src="{% url "dashboard.views.vm-graph" instance.pk "cpu" graph_time %}" style="width:100%"/>
<img src="{% url "dashboard.views.vm-graph" instance.pk "memory" graph_time %}" style="width:100%"/>
<img src="{% url "dashboard.views.vm-graph" instance.pk "network" graph_time %}" style="width:100%"/>
{% endif %}
</div>
</div>
......@@ -52,7 +52,7 @@ from vm.models import (
)
from .util import (
CheckedDetailView, AjaxOperationMixin, OperationView, AclUpdateView,
FormOperationMixin, FilterMixin, search_user,
FormOperationMixin, FilterMixin, search_user, GraphMixin,
)
from ..forms import (
AclUserOrGroupAddForm, VmResourcesForm, TraitsForm, RawDataForm,
......@@ -89,7 +89,7 @@ class VmDetailVncTokenView(CheckedDetailView):
raise Http404()
class VmDetailView(CheckedDetailView):
class VmDetailView(GraphMixin, CheckedDetailView):
template_name = "dashboard/vm-detail.html"
model = Instance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment