mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-02 12:13:54 +01:00
Some corrections before releasing.
This commit is contained in:
@@ -84,7 +84,7 @@ class Grapher(object):
|
||||
*params)
|
||||
|
||||
def make_defaults(self, target, tpl=traffic_avg_template):
|
||||
end = "now"
|
||||
end = "%d" % int(time.mktime(time.localtime()))
|
||||
self.process(target, "day", "-1day", end, tpl)
|
||||
self.process(target, "week", "-1week", end, tpl)
|
||||
self.process(target, "month", "-1month", end, tpl)
|
||||
|
||||
@@ -103,6 +103,7 @@ class LogParser(object):
|
||||
'--start', str(m),
|
||||
'--step', str(rrdstep),
|
||||
*params)
|
||||
sys.exit(1)
|
||||
return m
|
||||
|
||||
def update_rrd(self, dom, t):
|
||||
|
||||
@@ -91,9 +91,9 @@ def adminindex(request):
|
||||
domains = Domain.objects.all()
|
||||
return _render(request, 'stats/adminindex.html', {
|
||||
"domains" : domains, "domain" : domain,
|
||||
"graphs" : {"traffic" : _("Average normal traffic"),
|
||||
"badtraffic" : _("Average bad traffic"),
|
||||
"size" : _("Average normal traffic size")},
|
||||
"graphs" : [{"name" : "traffic", "label" : _("Average normal traffic")},
|
||||
{"name" : "badtraffic", "label" : _("Average bad traffic")},
|
||||
{"name" : "size", "label" : _("Average normal traffic size")}],
|
||||
"periods" : ["day", "week", "month", "year"],
|
||||
"period" : period
|
||||
})
|
||||
@@ -109,9 +109,9 @@ def index(request, dom_id=None):
|
||||
|
||||
return _render(request, 'stats/index.html', {
|
||||
"domain" : domain,
|
||||
"graphs" : {"traffic" : _("Average normal traffic"),
|
||||
"badtraffic" : _("Average bad traffic"),
|
||||
"size" : _("Average normal traffic size")},
|
||||
"graphs" : [{"name" : "traffic", "label" : _("Average normal traffic")},
|
||||
{"name" : "badtraffic", "label" : _("Average bad traffic")},
|
||||
{"name" : "size", "label" : _("Average normal traffic size")}],
|
||||
"periods" : ["day", "week", "month", "year"],
|
||||
"period" : period
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% for g, title in graphs.items %}
|
||||
<h3>{{ title }}</h3>
|
||||
<p><img src="/static/graphs/{{ g }}_{{ domain }}_AVERAGE_{{ period }}.png"
|
||||
{% for elems in graphs %}
|
||||
<h3>{{ elems.label }}</h3>
|
||||
<p><img src="/static/graphs/{{ elems.name }}_{{ domain }}_AVERAGE_{{ period }}.png"
|
||||
alt="{% trans 'No statistics available' %}" /></p>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user