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

[csds-client] Opening broswer issue while using visualization feature #22

Open
Rainton opened this issue Aug 21, 2020 · 1 comment
Open

Comments

@Rainton
Copy link
Contributor

Rainton commented Aug 21, 2020

When we use visualization feature in the csds-client, the process is that the client parses the relationship between xDS and generates a graph based on the relationship in dot, then saves it in config_graph.dot. For example:

digraph G {
    "LDS0\\listener";
    "RDS0";
    "LDS0\\listener"->"RDS0";
}

Then the client will call OpenBrowser(url string) to open Graphviz Online with the dot file in the browser to show the graph automatically. For the previous graph example, the link would be https://dreampuf.github.io/GraphvizOnline/#digraph%20G{"LDS0\\listener";"RDS0";"LDS0\\listener"->"RDS0"}.

The logic of OpenBrowser(url string) is that it will run different cmd based on different os. For linux, it runs

xdg-open 'https://dreampuf.github.io/GraphvizOnline/#digraph G{"LDS0\\listener";"RDS0";"LDS0\\listener"->"RDS0"}'

However, the problem is that it seems this command passes the double quotes differently based on different os version.


The different behavior on different os version leads to the opening browser issue, and I cannot find a proper solution to it. Does anyone has suggestions?

The double quotes surrounding the node name cannot be discarded, because the real name of xDS always contains a backslash, only using double quotes can make the dot language recognize it as a whole name.

For now, the solution is, if opening browser fails, users can manually copy and paste the content in config_graph.dot into the input box of Graphviz Online to show the graph, which has been mentioned in README.

@Rainton
Copy link
Contributor Author

Rainton commented Aug 21, 2020

/cc @fuqianggao @alexburnos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant