Skip to content

Commit

Permalink
Merge pull request #299 from sowbiba/profiler-dot-client
Browse files Browse the repository at this point in the history
Profiler dot client
  • Loading branch information
dbu committed Jan 3, 2019
2 parents 852f7f9 + 9dd2636 commit f94de3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
### Fixed

- Fix deprecated notice when using symfony/config > 4.2
- Profiler does not display stack when client name contains dots

## 1.13.1 - 2018-11-28

Expand Down
8 changes: 8 additions & 0 deletions Collector/Stack.php
Expand Up @@ -340,4 +340,12 @@ public function setCurlCommand($curlCommand)
{
$this->curlCommand = $curlCommand;
}

/**
* @return string
*/
public function getClientSlug()
{
return preg_replace('/[^a-zA-Z0-9_-]/u', '_', $this->client);
}
}
10 changes: 5 additions & 5 deletions Resources/views/stack.html.twig
@@ -1,4 +1,4 @@
<div class="httplug-stack-header httplug-toggle" data-toggle="#httplug-{{ client }}-{{ id }}-details">
<div class="httplug-stack-header httplug-toggle" data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-details">
<div>
{% if stack.failed %}
<span class="httplug-stack-failed">✘</span>
Expand All @@ -23,14 +23,14 @@
{% endif %}
</div>
</div>
<div id="httplug-{{ client }}-{{ id }}-details" class="httplug-hidden">
<div id="httplug-{{ stack.clientSlug }}-{{ id }}-details" class="httplug-hidden">
<div class="httplug-toolbar">
<div class="httplug-copy-as-curl">
<input readonly="readonly" type="text" value="{{ stack.curlCommand }}" />
<button class="btn tooltip-toggle" aria-label="Copy to clipboard">Copy to clipboard</button>
</div>
<button data-toggle="#httplug-{{ client }}-{{ id }}-stack" class="httplug-toggle btn" >Toggle plugin stack</button>
<button data-toggle="#httplug-{{ client }}-{{ id }}-details .httplug-http-body" class="httplug-toggle btn">Toggle body</button>
<button data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-stack" class="httplug-toggle btn" >Toggle plugin stack</button>
<button data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-details .httplug-http-body" class="httplug-toggle btn">Toggle body</button>
</div>
<div class="httplug-messages">
<div class="httplug-message card">
Expand All @@ -43,7 +43,7 @@
</div>
</div>
{% if stack.profiles %}
<div id="httplug-{{ client }}-{{ id }}-stack" class="httplug-hidden card">
<div id="httplug-{{ stack.clientSlug }}-{{ id }}-stack" class="httplug-hidden card">
{% for profile in stack.profiles %}
<h3 class="httplug-plugin-name">{{ profile.plugin }}</h3>
<div class="httplug-messages">
Expand Down

0 comments on commit f94de3b

Please sign in to comment.