fullstorydev / grpcui

An interactive web UI for gRPC, along the lines of postman
MIT License
5.25k stars 388 forks source link

Add "raw request gRPCurl" output #241

Closed gerektoolhy closed 1 year ago

gerektoolhy commented 1 year ago

Implements #3 Copy as "grpcurl".

Example: image

With highlights of the changes parts: image

gerektoolhy commented 1 year ago

@dragonsinth thanks. Removed empty line!

jhump commented 1 year ago

First nit: it's called "grpcurl" or "gRPCurl", not "gRPC curl".

Another few cents worth of UX feedback, take it or leave it:

This seems overly prominent in the UI... a bit of an eyesore and possibly even confusing. Should users try to paste existing grpcurl invocations into the textarea, like they can with JSON? Or is it read-only? While it's possibly interesting information, it is more likely a distraction for most people actually using the "Raw Request" tab.

Following how Chrome exposes similar functionality in its dev tools, I think it would be better to instead add a "Copy as grpcurl" button to each row in the "History" tab.

(I cannot approve or block PRs, so I leave it to @dragonsinth to decide if this is worth changing...)

dragonsinth commented 1 year ago

This seems like a reasonable incremental thing. If some sufficiently motivated person wants to turn this into "copy as gRPCurl" that might be a nice improvment.

dragonsinth commented 1 year ago

FYI: I pushed a commit to do 2 things:

1) Adjust the spacing a tad, break up with an HR 2) (javascript) ensure consistency between editing the form and copying as curl by shuffling the code a tad.

dragonsinth commented 1 year ago

Screenshot 2023-04-27 at 6 18 17 PM