Commit 0107aa6d by Kálmán Viktor

dashboard: add graph time options

parent d3fb12c8
...@@ -123,9 +123,17 @@ ...@@ -123,9 +123,17 @@
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
{% if graphite_enabled %} {% if graphite_enabled %}
<img src="{% url "dashboard.views.vm-graph" instance.pk "cpu" "6h" %}" style="width:100%"/> <div class="text-center">
<img src="{% url "dashboard.views.vm-graph" instance.pk "memory" "6h" %}" style="width:100%"/> {% for o in graph_time_options %}
<img src="{% url "dashboard.views.vm-graph" instance.pk "network" "6h" %}" style="width:100%"/> <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 %} {% endif %}
</div> </div>
</div> </div>
...@@ -52,7 +52,7 @@ from vm.models import ( ...@@ -52,7 +52,7 @@ from vm.models import (
) )
from .util import ( from .util import (
CheckedDetailView, AjaxOperationMixin, OperationView, AclUpdateView, CheckedDetailView, AjaxOperationMixin, OperationView, AclUpdateView,
FormOperationMixin, FilterMixin, search_user, FormOperationMixin, FilterMixin, search_user, GraphMixin,
) )
from ..forms import ( from ..forms import (
AclUserOrGroupAddForm, VmResourcesForm, TraitsForm, RawDataForm, AclUserOrGroupAddForm, VmResourcesForm, TraitsForm, RawDataForm,
...@@ -89,7 +89,7 @@ class VmDetailVncTokenView(CheckedDetailView): ...@@ -89,7 +89,7 @@ class VmDetailVncTokenView(CheckedDetailView):
raise Http404() raise Http404()
class VmDetailView(CheckedDetailView): class VmDetailView(GraphMixin, CheckedDetailView):
template_name = "dashboard/vm-detail.html" template_name = "dashboard/vm-detail.html"
model = Instance 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