Browse Source

Default theme: Sync auth value for query params

shalvah 2 years ago
parent
commit
1cc21301c0

+ 14 - 0
resources/css/theme-default.style.css

@@ -1079,3 +1079,17 @@ html {
 button {
     border: none;
 }
+
+* {
+    /* Foreground, Background */
+    scrollbar-color: #3c4c67 transparent);
+}
+*::-webkit-scrollbar { /* Background */
+    width: 7px;
+    height: 7px;
+    background: transparent;
+}
+
+*::-webkit-scrollbar-thumb { /* Foreground */
+    background: #626161;
+}

+ 10 - 4
resources/views/themes/default/endpoint.blade.php

@@ -36,8 +36,7 @@
             </summary>
             <pre><code class="language-http">@foreach($response->headers as $header => $value)
 {{ $header }}: {{ is_array($value) ? implode('; ', $value) : $value }}
-@endforeach </code></pre>
-        </details> @endif
+@endforeach </code></pre></details> @endif
         <pre>
 @if(is_string($response->content) && Str::startsWith($response->content, "<<binary>>"))
 <code>[Binary data] - {{ htmlentities(str_replace("<<binary>>", "", $response->content)) }}</code>
@@ -46,7 +45,7 @@
 @else
 @php($parsed = json_decode($response->content))
 {{-- If response is a JSON string, prettify it. Otherwise, just print it --}}
-<code class="language-json">{!! htmlentities($parsed != null ? json_encode($parsed, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : $response->content) !!}</code>
+<code class="language-json" style="max-height: 300px;">{!! htmlentities($parsed != null ? json_encode($parsed, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : $response->content) !!}</code>
 @endif </pre>
     @endforeach
 @endif
@@ -55,7 +54,7 @@
     <blockquote>Received response<span
                 id="execution-response-status-{{ $endpoint->endpointId() }}"></span>:
     </blockquote>
-    <pre class="json"><code id="execution-response-content-{{ $endpoint->endpointId() }}"></code></pre>
+    <pre class="json"><code id="execution-response-content-{{ $endpoint->endpointId() }}" style="max-height: 400px;"></code></pre>
 </span>
 <span id="execution-error-{{ $endpoint->endpointId() }}" hidden>
     <blockquote>Request failed with error:</blockquote>
@@ -139,6 +138,12 @@
     @if(count($endpoint->queryParameters))
         <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
         @foreach($endpoint->queryParameters as $attribute => $parameter)
+                <?php
+                $htmlOptions = [];
+                if ($endpoint->isAuthed() && $metadata['auth']['location'] == 'query' && $metadata['auth']['name'] == $attribute) {
+                    $htmlOptions = [ 'class' => 'auth-value', ];
+                }
+                ?>
             <p>
                 @component('scribe::components.field-details', [
                   'name' => $parameter->name,
@@ -149,6 +154,7 @@
                   'endpointId' => $endpoint->endpointId(),
                   'component' => 'query',
                   'isInput' => true,
+                  'html' => $htmlOptions,
                 ])
                 @endcomponent
             </p>