diff --git a/extensions/grpc/deployment/src/main/resources/dev-templates/service.html b/extensions/grpc/deployment/src/main/resources/dev-templates/service.html index 6d91e12b6edc8..d8883a972e75f 100644 --- a/extensions/grpc/deployment/src/main/resources/dev-templates/service.html +++ b/extensions/grpc/deployment/src/main/resources/dev-templates/service.html @@ -15,6 +15,24 @@ background-color: #f0f0c0; padding: 2px 20px; border-radius: 3px; +} +.fa.connected-icon { + color: #207020; + padding: 0 1em 0 1em; +} + +.form-control.grpc-output { + color: #f0f0e0; + background-color: #303030; +} + +.fa.connected-icon { + color: #107010; +} + +span.connected-status { + font-size: 0.5em; + margin-left: 1em; } {/style} {#script} @@ -37,8 +55,8 @@ const idBase = connection.queryIdentifier.replace('#', '/'); const connectedElement = document.getElementById(`$\{idBase}_connected`); if (connectedElement) { - connectedElement.style.display = 'block'; - document.getElementById(`$\{idBase}_disconnect`).style.display = 'block'; + connectedElement.style.display = 'inline'; + document.getElementById(`$\{idBase}_disconnect`).style.display = 'inline'; } } @@ -60,14 +78,14 @@ grpcWS.onerror = function (error) { console.log("error on gRPC websocket", error); } - + grpcWS.onclose = function () { info("Web Socket bridge to gRPC disconnected, reconnecting"); connections.forEach(connection => hideConnected(connection)); connections.clear(); setTimeout(connect, 2000); } - + grpcWS.onmessage = function (event) { const data = JSON.parse(event.data); if (data.status == 'RESET') { @@ -81,6 +99,7 @@ connection.responseText = data.body + connection.responseText; responseElement.value = connection.responseText; + responseElement.style.height = Math.min(responseElement.scrollHeight + 5, 500) + "px" } else if (data.status == 'COMPLETED') { const connection = connections.get(data.id); hideConnected(connection); @@ -98,7 +117,7 @@ } } } - + function info(message) { clearTimeout(clearMessageTimeout); const statusText = document.getElementById('status-text') @@ -122,6 +141,9 @@ $(".app-class").on("click", function() { openInIDE($(this).text()); }); + + document.querySelectorAll('.grpc-input') + .forEach(textArea => textArea.style.height = (textArea.scrollHeight + 5) + "px"); connect(); }); @@ -192,39 +214,44 @@

{#for method in service.methodsWithPrototypes} -
+
-
-
-

{method.type} {method.bareMethodName}

-
-
- {#when method.type} - {#is in BIDI_STREAMING CLIENT_STREAMING} - - {#is SERVER_STREAMING} - - {/when} -
-
+

{method.type} {method.bareMethodName} + {#when method.type} + {#is in BIDI_STREAMING CLIENT_STREAMING} + + {#is SERVER_STREAMING} + + {/when} +

{#if method.isTestable}
- +
+
+
+ +
+
+
+
- -
-
- + Disconnect +