Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler dot client #299

Merged
merged 2 commits into from Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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