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

Added dropdowns for the Request tab. #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions internal/resources/webform/webform-sample.css
Original file line number Diff line number Diff line change
Expand Up @@ -763,3 +763,42 @@ button#grpc-history-clear, button#grpc-history-save {
padding: 1em;
margin-bottom: 1em;
}

/* Style for the checkbox and label */
.toggle-label {
display: block;
cursor: pointer;
padding: 3px 5px 3px 5px;
}

/* Default state of the toggle-content (hidden) */
.toggle-content {
display: none;
padding: 5px 20px;
}

/* Style for the arrow */
.arrow {
float: left;
transition: transform 0.2s ease-in-out; /* Added transition */
}

/* Hide the checkbox */
.markdown-collapsible input[type="checkbox"] {
display: none;
}

/* Show content when checkbox is checked */
.markdown-collapsible input[type="checkbox"]:checked ~ .toggle-content {
display: block;
}

/* Rotate arrow for checked state */
.markdown-collapsible input[type="checkbox"]:checked + .toggle-label .arrow {
transform: rotate(90deg);
}

/* Rotate arrow for unchecked state */
.markdown-collapsible input[type="checkbox"]:not(:checked) + .toggle-label .arrow {
transform: rotate(0deg);
}
32 changes: 21 additions & 11 deletions internal/resources/webform/webform-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,30 @@ <h3>Examples</h3>
<li id="#grpc-history-tab-button"><a href="#grpc-history-tab">History</a></li>
</ul>
<div class="grpc-tabcontent" id="grpc-request-tab">
<h3>Request Metadata</h3>
<div id="grpc-request-metadata">
<table class="grpc-request-table" id="grpc-request-metadata-form">
<tr><th></th><th class="name">Name</th><th class="value">Value</th></tr>
<tr><td><button id="grpc-request-metadata-add-row" class="add">+</button></td><td colspan="2"><span class="add-row-label">Add item</span></td></tr>
</table>
<div class="markdown-collapsible">
<input type="checkbox" id="toggle" />
<label for="toggle" class="toggle-label"><span class="arrow">&#9658;</span><h3>Request Metadata</h3></label>
<div id="grpc-request-metadata" class="toggle-content">
<table class="grpc-request-table" id="grpc-request-metadata-form">
<tr><th></th><th class="name">Name</th><th class="value">Value</th></tr>
<tr><td><button id="grpc-request-metadata-add-row" class="add">+</button></td><td colspan="2"><span class="add-row-label">Add item</span></td></tr>
</table>
</div>
</div>

<h3>Request Data</h3>
<div id="grpc-request-form"></div>
<div class="markdown-collapsible">
<input type="checkbox" id="toggle-request-form" checked />
<label for="toggle-request-form" class="toggle-label"><span class="arrow">&#9658;</span><h3>Request Data</h3></label>
<div id="grpc-request-form" class="toggle-content">
</div>
</div>

<h3>Request Timeout</h3>
<div id="grpc-request-timeout">
<input/> seconds
<div class="markdown-collapsible">
<input type="checkbox" id="toggle-request-timeout" />
<label for="toggle-request-timeout" class="toggle-label"><span class="arrow">&#9658;</span><h3>Request Timeout</h3></label>
<div id="grpc-request-timeout" class="toggle-content">
<input/> seconds
</div>
</div>

<button class="grpc-invoke" disabled>Invoke</button>
Expand Down