From bfc9b28ec9aef52800dbfc9ec1b26b16610a32ea Mon Sep 17 00:00:00 2001 From: Benjamin Walker Date: Fri, 13 Sep 2024 16:56:42 +1000 Subject: [PATCH] Only attempt to load graphs when data is available --- templates/flamegraph.mustache | 13 +++++++++++-- templates/memoryusagegraph.mustache | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/templates/flamegraph.mustache b/templates/flamegraph.mustache index cb733f4..65524be 100644 --- a/templates/flamegraph.mustache +++ b/templates/flamegraph.mustache @@ -28,23 +28,31 @@ Context variables required for this template: * id - The id of the profile * locale - Language setting (a BCP 47 language tag) + * flamedatad3 - Flame data, only used to determine if a graph can be displayed. Example context (json): { "id" : 3, - "locale" : "en" + "locale" : "en", + "flamedatad3": "true" } }}

Profile Flame Graph

- Loading... + {{#flamedatad3}} + Loading... + {{/flamedatad3}} + {{^flamedatad3}} + No profile flame data is available. + {{/flamedatad3}}
+{{#flamedatad3}} +{{/flamedatad3}} diff --git a/templates/memoryusagegraph.mustache b/templates/memoryusagegraph.mustache index 8eb2894..6464d2d 100644 --- a/templates/memoryusagegraph.mustache +++ b/templates/memoryusagegraph.mustache @@ -28,23 +28,31 @@ Context variables required for this template: * id - The id of the profile * locale - Language setting (a BCP 47 language tag) + * memoryusagedatad3 - Memory usage data, only used to determine if a graph can be displayed. Example context (json): { "id" : 3, - "locale": "en" + "locale": "en", + "memoryusagedatad3": "true" } }}

Memory Usage

- Loading... + {{#memoryusagedatad3}} + Loading... + {{/memoryusagedatad3}} + {{^memoryusagedatad3}} + No memory usage data is available. + {{/memoryusagedatad3}}
+{{#memoryusagedatad3}} \ No newline at end of file + +{{/memoryusagedatad3}}