Merge pull request #351 from hongwei1/develop

refactor/display milliseconds instead of microseconds for metric page
This commit is contained in:
Simon Redfern 2023-12-13 13:10:17 +01:00 committed by GitHub
commit 5482acb258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@
<td>{{ metric.url }}</td>
<td>{{ metric.source_ip}}</td>
<td>{{ metric.target_ip }}</td>
<td>{{ metric.date|date:"Y-m-d H:i:s.u" }}</td>
<td>{{ metric.date}}</td>
<td>{{ metric.duration }}</td>
</tr>

View File

@ -115,7 +115,7 @@ class MetricsView(LoginRequiredMixin, TemplateView):
"""
for metric in metrics:
metric['date'] = datetime.datetime.strptime(
metric['date'], settings.API_DATE_FORMAT_WITH_SECONDS )
metric['date'], settings.API_DATE_FORMAT_WITH_MILLISECONDS).isoformat(timespec='milliseconds')
return metrics
def to_api(self, cleaned_data):