From 0255ae33db51b4ef697807ff33c7e0c38e29598c Mon Sep 17 00:00:00 2001 From: Alessandro Galli Date: Thu, 1 Sep 2016 15:58:11 +0200 Subject: [PATCH] [Profiler] - improved profiler panel layout - added options clickable info --- src/Resources/views/Collector/mongo.html.twig | 77 +++++++++++++------ 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/src/Resources/views/Collector/mongo.html.twig b/src/Resources/views/Collector/mongo.html.twig index b5a3e5d..633a62b 100644 --- a/src/Resources/views/Collector/mongo.html.twig +++ b/src/Resources/views/Collector/mongo.html.twig @@ -24,7 +24,7 @@
Query time - {{ "%.2f"|format(collector.time) }} ms + {{ "%.2f"|format(collector.time) }} ms
{% endset %} @@ -34,11 +34,14 @@ {% block head %} {{ parent() }} {% endblock %} @@ -105,12 +112,10 @@ - - - - - - + + + + @@ -118,15 +123,39 @@ {# q \Facile\MongoDbBundle\Models\LogEvent #} - - - + - - {% else %} @@ -162,9 +191,9 @@ var elements = document.getElementsByClassName('query-data'); for (var i = 0; i < elements.length; i++) { var el = elements[i]; - var spanContent = el.getElementsByTagName('span')[0].innerText; - if (spanContent.length > 60) { - el.getElementsByTagName('span')[0].innerText = spanContent.substring(0, 30) + "... }"; + var spanContent = el.getElementsByClassName('click-to-expand')[0].innerText; + if (spanContent.length > 120) { + el.getElementsByClassName('click-to-expand')[0].innerText = spanContent.substring(0, 100) + "... }"; } var json = JSON.stringify(JSON.parse(spanContent), undefined, 4); var pre = document.createElement('pre'); @@ -175,7 +204,7 @@ toggleDetails: function(element) { element.getElementsByTagName('pre')[0].classList.toggle('hidden'); - element.getElementsByTagName('span')[0].classList.toggle('hidden'); + element.getElementsByClassName('click-to-expand')[0].classList.toggle('hidden'); } };
#MethodCollectionFilters(click to expand)Query data (click to expand)Time#InfoDataTime
{{ loop.index }}{{ q.method }}{{ q.collection }} -
{{ q.filters|json_encode(128) }}
+
+
+
    +
  • Method:
  • +
  • {{ q.method }}
  • +
  • Collection:
  • +
  • {{ q.collection }}
  • +
+
+
+ {% if q.filters | length > 0 %} +
+ Filters:
+ {{ q.filters|json_encode(128) }} +
+ {% endif %} + {% if q.data | length > 0 %} +
+ Data:
+ {{ q.data|json_encode(128) }} +
+ {% endif %} + {% if q.options | length > 0 %} +
+ Options:
+ {{ q.options|json_encode(128) }} +
+ {% endif %}
-
{{ q.data|json_encode(128) }}
+
+ {{ "%.2f"|format(q.executionTime * 1000) }} ms {{ "%.2f"|format(q.executionTime * 1000) }} ms