-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display protocol bindings on server, channel, operation, message (
#176)
- Loading branch information
Showing
5 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{% macro displayProtocol(protocol, protocolVersion) %} | ||
{% if protocolVersion %} | ||
<span class="bg-teal-500 font-bold no-underline text-white uppercase rounded ml-2" | ||
style="height: 20px;font-size: 11px;padding: 3px;">{{ protocol }} | ||
{{ protocolVersion }}</span> | ||
{% else %} | ||
<span class="bg-teal-500 font-sans font-bold no-underline text-white uppercase rounded ml-2" | ||
style="height: 20px;font-size: 11px;padding: 3px;">{{ protocol }}</span> | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
|
||
{% macro bindings(propName, prop, odd=false, showProtocol=true) %} | ||
|
||
{% if prop.hasBindings() %} | ||
{% for protocol in prop.bindingProtocols() %} | ||
<div class="{% if open %}is-open{% endif %} mt-4"> | ||
<div class="js-prop cursor-pointer py-2 property"> | ||
<div class="pr-4" style="margin-top: -2px; min-width: 25%"> | ||
<div class="text-sm"> | ||
<span class="string-chunk">{{propName}} specific information</span> | ||
<svg | ||
class="expand inline align-baseline" | ||
version="1.1" | ||
viewBox="0 0 24 24" | ||
x="0" | ||
xmlns="http://www.w3.org/2000/svg" | ||
y="0" | ||
> | ||
<polygon | ||
points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 " | ||
></polygon> | ||
</svg> | ||
{% if showProtocol %} | ||
{{ displayProtocol(protocol) }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="children bg-gray-100 py-4 rounded"> | ||
{% for bindingName, bindingValue in prop.binding(protocol) %} | ||
<div class="{% if odd %}bg-gray-100{% else %}bg-gray-200{% endif %} pl-8 pr-8"> | ||
{% if bindingValue | isObject %} | ||
<div class="{% if open %}is-open{% endif %}"> | ||
<div class="js-prop cursor-pointer py-2 property"> | ||
<div class="pr-4" style="margin-top: -2px; min-width: 25%"> | ||
<span class="text-sm" style="word-break: break-word" | ||
>{{ bindingName }}</span | ||
> | ||
<svg | ||
class="expand inline align-baseline" | ||
version="1.1" | ||
viewBox="0 0 24 24" | ||
x="0" | ||
xmlns="http://www.w3.org/2000/svg" | ||
y="0" | ||
> | ||
<polygon | ||
points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 " | ||
></polygon> | ||
</svg> | ||
</div> | ||
</div> | ||
<div class="children"> | ||
<div | ||
class="{% if odd %}bg-gray-200{% else %}bg-gray-100{% endif %} {% if not root %}pl-8 pr-8{% endif %} rounded" | ||
> | ||
<pre class="text-sm">{{ bindingValue | dump(2) }}</pre> | ||
</div> | ||
</div> | ||
</div> | ||
{% else %} | ||
<div class="text-sm">{{ bindingName }}: {{ bindingValue }}</div> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters