|
a/bitergiametrics/main.py |
|
b/bitergiametrics/main.py |
|
... |
|
... |
120 |
|
120 |
|
121 |
@expose('jinja:bitergiametrics:templates/metrics/bar.html')
|
121 |
@expose('jinja:bitergiametrics:templates/metrics/bar.html')
|
122 |
@with_trailing_slash
|
122 |
@with_trailing_slash
|
123 |
def bar(self, page=0, limit=10, **kw):
|
123 |
def bar(self, page=0, limit=10, **kw):
|
124 |
return dict()
|
124 |
return dict()
|
|
|
125 |
|
|
|
126 |
@expose('jinja:bitergiametrics:templates/metrics/tickets_swscopio.html')
|
|
|
127 |
@with_trailing_slash
|
|
|
128 |
def tickets_swscopio(self, page=0, limit=10, **kw):
|
125 |
|
129 |
|
|
|
130 |
# FIXME: SQL query to get the results
|
|
|
131 |
tickets_per_month = [
|
|
|
132 |
['23989','1999','1','Jan 1999','10','2','2','3'],
|
|
|
133 |
['23990','1999','2','Feb 1999','15','2','2','3'],
|
|
|
134 |
['23991','1999','3','Mar 1999','20','4','9','3'],
|
|
|
135 |
['24147','2012','3','Mar 2012','120','6','23','12'],
|
|
|
136 |
['24148','2012','4','Apr 2012','150','7','30','15'],
|
|
|
137 |
]
|
|
|
138 |
|
|
|
139 |
tickets_per_month_json = {}
|
|
|
140 |
tickets_per_month_json['id'] = []
|
|
|
141 |
tickets_per_month_json['year'] = []
|
|
|
142 |
tickets_per_month_json['month'] = []
|
|
|
143 |
tickets_per_month_json['date'] = []
|
|
|
144 |
tickets_per_month_json['live'] = []
|
|
|
145 |
tickets_per_month_json['people'] = []
|
|
|
146 |
tickets_per_month_json['open'] = []
|
|
|
147 |
tickets_per_month_json['close'] = []
|
|
|
148 |
|
|
|
149 |
for ticket in tickets_per_month:
|
|
|
150 |
tickets_per_month_json['id'].append(ticket[0])
|
|
|
151 |
tickets_per_month_json['year'].append(ticket[1])
|
|
|
152 |
tickets_per_month_json['month'].append(ticket[2])
|
|
|
153 |
tickets_per_month_json['date'].append(ticket[3])
|
|
|
154 |
tickets_per_month_json['live'].append(ticket[4])
|
|
|
155 |
tickets_per_month_json['people'].append(ticket[5])
|
|
|
156 |
tickets_per_month_json['open'].append(ticket[6])
|
|
|
157 |
tickets_per_month_json['close'].append(ticket[7])
|
|
|
158 |
# FIXME: Find better way to find the path to the file
|
|
|
159 |
f = open ("../BitergiaMetrics/bitergiametrics/nf/metrics/tickets_per_month_swscopio.json", 'w')
|
|
|
160 |
# f.write(tickets_per_month)
|
|
|
161 |
f.write(json.dumps(tickets_per_month_json))
|
|
|
162 |
f.close()
|
|
|
163 |
|
|
|
164 |
return dict()
|
|
|
165 |
|
|
|
166 |
|
|
|
167 |
@expose('jinja:bitergiametrics:templates/metrics/pie.html')
|
|
|
168 |
@with_trailing_slash
|
|
|
169 |
def pie(self, page=0, limit=10, **kw):
|
|
|
170 |
return dict()
|
126 |
|
171 |
|
127 |
@expose('jinja:bitergiametrics:templates/metrics/index.html')
|
172 |
@expose('jinja:bitergiametrics:templates/metrics/index.html')
|
128 |
@with_trailing_slash
|
173 |
@with_trailing_slash
|
129 |
def index(self, page=0, limit=10, **kw):
|
174 |
def index(self, page=0, limit=10, **kw):
|
130 |
query_filter = dict(app_config_id=c.app.config._id)
|
175 |
query_filter = dict(app_config_id=c.app.config._id)
|