diff --git a/django/crashreport/processor/models.py b/django/crashreport/processor/models.py index 93b742d..81f94ff 100644 --- a/django/crashreport/processor/models.py +++ b/django/crashreport/processor/models.py @@ -193,6 +193,9 @@ class ProcessedCrash(models.Model): os_detail = models.CharField(max_length=100, default='') + os_detail_parsed = models.CharField(max_length=100, + default='') + # CPU info cpu_architecture = models.CharField(max_length=20) @@ -236,6 +239,15 @@ def set_view_os_name_to_model(self, view_os_name): else: logger.warning("could not determine the os: " + view_is_name) + def set_view_os_detail_parsed_to_model(self, view_os_detail): + if self.os_name == ProcessedCrash.LINUX: + self.os_detail_parsed = self.os_name + ' ' + \ + view_os_detail.split('Linux ')[1].split('-')[0] + elif self.os_name == ProcessedCrash.WINDOWS or self.os_name == ProcessedCrash.OSX: + self.os_detail_parsed = self.os_name + ' ' + view_os_detail + else: + self.os_detail_parsed = view_os_detail + def _convert_frames(self, frame_list): text = "" for frame in frame_list: diff --git a/django/crashreport/processor/processor.py b/django/crashreport/processor/processor.py index 1ac320a..e5fc954 100644 --- a/django/crashreport/processor/processor.py +++ b/django/crashreport/processor/processor.py @@ -84,6 +84,7 @@ def _parse_os(self, os_version): os_detail = parsed_line[2] self.processed_crash.os_detail = os_detail self.processed_crash.set_view_os_name_to_model(os_name) + self.processed_crash.set_view_os_detail_parsed_to_model(os_detail) def _parse_frames(self, frames): threads = {} diff --git a/django/crashreport/stats/static/stats/js/signature.js b/django/crashreport/stats/static/stats/js/signature.js index f9b5c00..a18f81e 100644 --- a/django/crashreport/stats/static/stats/js/signature.js +++ b/django/crashreport/stats/static/stats/js/signature.js @@ -1,8 +1,9 @@ -$(document).ready(function() -{ +$(document).ready(function() +{ $("#tabs").tabs(); $("#os_tab").tabs(); $("#cpu_tab").tabs(); + $("#os_detail_tab").tabs(); $("#version_tab").tabs(); -} -); +} +); diff --git a/django/crashreport/stats/templates/stats/signature.html b/django/crashreport/stats/templates/stats/signature.html index e636a2c..2a85e00 100644 --- a/django/crashreport/stats/templates/stats/signature.html +++ b/django/crashreport/stats/templates/stats/signature.html @@ -174,6 +174,30 @@

CPU architecture

+
+
+

Detailed Operating System

+
+
+ + + + + + + + + {% for os_detail, count in os_detail_info.items %} + + + + + {% endfor %} + +
DetailCount
{{os_detail}}{{count}}
+
+ +
{% endblock %} diff --git a/django/crashreport/stats/views.py b/django/crashreport/stats/views.py index 25e2c6a..897eb17 100644 --- a/django/crashreport/stats/views.py +++ b/django/crashreport/stats/views.py @@ -81,6 +81,14 @@ def get_os_info(crashes): return data +def get_os_detail_info(crashes): + detail_info = crashes.values('os_detail_parsed').annotate(Count('os_detail_parsed')) + data = {} + for detail in detail_info: + data[detail['os_detail_parsed']] = detail['os_detail_parsed__count'] + + return data + def get_cpu_architecture(crashes): cpu_architecture = crashes.values('cpu_architecture').annotate(Count('cpu_architecture')) @@ -111,6 +119,7 @@ def get_context_data(self, **kwargs): crashes = ProcessedCrash.objects.filter(signature = signature_object) context['os_info'] = get_os_info(crashes) + context['os_detail_info'] = get_os_detail_info(crashes) context['cpu_info'] = get_cpu_architecture(crashes) context['version_info'] = get_version_info(crashes) return context