Commit 26742917 by Kálmán Viktor

dashboard: graph fixes

- change default button to simply represent a time
- add max-width 100% for graphs
parent 9ffd1dbd
...@@ -991,3 +991,7 @@ textarea[name="new_members"] { ...@@ -991,3 +991,7 @@ textarea[name="new_members"] {
.node-list-table-monitor { .node-list-table-monitor {
width: 250px; width: 250px;
} }
.graph-images img {
max-width: 100%;
}
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="text-center graph-buttons"> <div class="text-center graph-buttons">
{% include "dashboard/_graph-time-buttons.html" %} {% include "dashboard/_graph-time-buttons.html" %}
</div> </div>
<div class="graph-images"> <div class="graph-images text-center">
<img src="{% url "dashboard.views.node-graph" node.pk "cpu" graph_time %}"/> <img src="{% url "dashboard.views.node-graph" node.pk "cpu" graph_time %}"/>
<img src="{% url "dashboard.views.node-graph" node.pk "memory" graph_time %}"/> <img src="{% url "dashboard.views.node-graph" node.pk "memory" graph_time %}"/>
<img src="{% url "dashboard.views.node-graph" node.pk "network" graph_time %}"/> <img src="{% url "dashboard.views.node-graph" node.pk "network" graph_time %}"/>
...@@ -48,7 +48,4 @@ ...@@ -48,7 +48,4 @@
.form-group { .form-group {
margin: 0px; margin: 0px;
} }
.graph-images img {
width: 100%;
}
</style> </style>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<div class="text-center graph-buttons"> <div class="text-center graph-buttons">
{% include "dashboard/_graph-time-buttons.html" %} {% include "dashboard/_graph-time-buttons.html" %}
</div> </div>
<div class="graph-images"> <div class="graph-images text-center">
<img src="{% url "dashboard.views.vm-graph" instance.pk "cpu" graph_time %}"/> <img src="{% url "dashboard.views.vm-graph" instance.pk "cpu" graph_time %}"/>
<img src="{% url "dashboard.views.vm-graph" instance.pk "memory" graph_time %}"/> <img src="{% url "dashboard.views.vm-graph" instance.pk "memory" graph_time %}"/>
<img src="{% url "dashboard.views.vm-graph" instance.pk "network" graph_time %}"/> <img src="{% url "dashboard.views.vm-graph" instance.pk "network" graph_time %}"/>
......
...@@ -538,6 +538,7 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin): ...@@ -538,6 +538,7 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin):
class GraphMixin(object): class GraphMixin(object):
graph_time_options = [ graph_time_options = [
{'time': "1h", 'name': _("1 hour")}, {'time': "1h", 'name': _("1 hour")},
{'time': "6h", 'name': _("6 hours")},
{'time': "1d", 'name': _("1 day")}, {'time': "1d", 'name': _("1 day")},
{'time': "1w", 'name': _("1 week")}, {'time': "1w", 'name': _("1 week")},
{'time': "30d", 'name': _("1 month")}, {'time': "30d", 'name': _("1 month")},
...@@ -555,10 +556,6 @@ class GraphMixin(object): ...@@ -555,10 +556,6 @@ class GraphMixin(object):
"h, d, w, and y.")) "h, d, w, and y."))
graph_time = self.default_graph_time graph_time = self.default_graph_time
context['graph_time'] = graph_time context['graph_time'] = graph_time
self.graph_time_options = (
self.graph_time_options +
[{'time': self.default_graph_time, 'name': _("default")}]
)
context['graph_time_options'] = self.graph_time_options context['graph_time_options'] = self.graph_time_options
return context return context
......
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