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

Default view mode #375

Closed
ridvansumset opened this issue Oct 18, 2019 · 6 comments
Closed

Default view mode #375

ridvansumset opened this issue Oct 18, 2019 · 6 comments
Labels
enhancement master fixed already fixed at master branch

Comments

@ridvansumset
Copy link

If data is a valid JSON, it would be nice to view it in tree mode by default. Otherwise, we always have to click "view mode tree" button.

@ValeSauer
Copy link
Contributor

+1 if the JSON view becomes more performant. The JSON view breaks chrome with very large payloads.

@sseide
Copy link
Collaborator

sseide commented Nov 5, 2019

@ValeSauer regarding performance - you are right as currently used lib json-tree (https://github.com/lmenezes/json-tree) is not the most performant one. Do you know another lib that can be used as a replacement? It must protect against XSS vulnerabilities.

JsonTreeViewer (summerstyle/jsonTreeViewer#13) for example does not...

sseide added a commit to sseide/redis-commander that referenced this issue Nov 12, 2019
sseide added a commit to sseide/redis-commander that referenced this issue Nov 12, 2019
@sseide
Copy link
Collaborator

sseide commented Nov 12, 2019

ok, switched json viewer to another library which seems to be a bit more performant.
@ValeSauer can you check with your data please

And added config value and env var to allow using this json display mode as defautl. Old default (display as text) is not changed, you need to enable it explicitly.

Either set ui.jsonViewAsDefault = "all" in your local config file or set env var "VIEW_JSON_DEFAULT=all"

If you like this new behaviour for strings only and not for other types you can set this config to "string" instead of "all". As Json view mode is only supported for string and hash by now (will add more in the future) setting this config to "string,hash" works to but is now equivalent to "all".
As written in docs/configuration.md this config value accepts a list of datatypes to display as json to not force all of them as json per default...

@sseide sseide added the master fixed already fixed at master branch label Nov 14, 2019
@sseide
Copy link
Collaborator

sseide commented Nov 29, 2019

@ridvansumset - does it help you? does it work?
@ValeSauer - better now?

Can ticket be closed now?

@ValeSauer
Copy link
Contributor

Yes, much better now.

@sseide
Copy link
Collaborator

sseide commented Jan 23, 2020

new version 0.6.7 with fix available on npm too

@sseide sseide closed this as completed Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement master fixed already fixed at master branch
Projects
None yet
Development

No branches or pull requests

3 participants