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

support to show raw data for Route, Upstream, Service and so on #1399

Closed
juzhiyuan opened this issue Jan 30, 2021 · 9 comments · Fixed by #1601
Closed

support to show raw data for Route, Upstream, Service and so on #1399

juzhiyuan opened this issue Jan 30, 2021 · 9 comments · Fixed by #1601
Assignees
Labels
enhancement New feature or request frontend
Milestone

Comments

@juzhiyuan
Copy link
Member

juzhiyuan commented Jan 30, 2021

Feature request

Please describe your feature

Due to some fields are not supported by Frontend, once users modify a Route that is created by admin API, then that Route would be overridden by Frontend's data.

Describe the solution you'd like

We may first support showing raw data and allow the user to modify it directly and add some tips before submitting data change, to tell the user to be careful if this Route is created by Admin API.

If possible, we could support Data Diff before data submitting.

cc @LiteSun @liuxiran @membphis

@juzhiyuan juzhiyuan added enhancement New feature or request frontend labels Jan 30, 2021
@juzhiyuan juzhiyuan added this to the 2.5 milestone Jan 30, 2021
@LiteSun
Copy link
Member

LiteSun commented Jan 31, 2021

This feature allows the user to see the data faster and more intuitively, a very good feature.

It is necessary to check the legitimacy of the data if the user is allowed to enter it manually. otherwise, such a problem #1234 will occur.

@liuxiran
Copy link
Contributor

liuxiran commented Feb 4, 2021

This feature would be more practical for advanced users, Perhaps Expert Mode is a fitting name for it(config in form can be defined as Normal Mode)

As we have plan to deprecate the admin-api, my only question is that Is this feature only for interim use or intended for long-term support?

@juzhiyuan
Copy link
Member Author

Long term support, of course, both Normal mode & Advanced Mode.

@LiteSun LiteSun self-assigned this Feb 23, 2021
@LiteSun
Copy link
Member

LiteSun commented Feb 23, 2021

Solutions design:

On the page, in the list of route, service, consumer and upstream, add a view button. When the user clicks view, a Drawer will pop up on the right side, and the corresponding data will be displayed in the form of json in the Drawer.

image
image

The code editor uses codemirror, the same as the plugin editor;

  • documents: When clicked, it will jump to the corresponding document.
  • format: When clicked, it will format the current code.
  • copy: When clicked, the code will be copied to the clipboard for testing and debugging purposes.

Discussion needed:

If the user uses raw data for editing, the edited data is missing fields that the front-end depends on, which can cause the page to crash.
For example, the following issue: #1234

Can we use jsonchema to verify that the data entered by the user is legitimate, just like we verify that the plugin is legitimate?

@juzhiyuan @nic-chen @liuxiran

@juzhiyuan
Copy link
Member Author

Can we use jsonchema to verify that the data entered by the user is legitimate

As far as I know, the backend is using this method to check the client's input, right?

@membphis
Copy link
Member

ping @LiteSun

@LiteSun
Copy link
Member

LiteSun commented Feb 25, 2021

  1. I submitted a PR for rawDataEditor's view mode. feat: add rawDataEditor for route, consumer, upstream and service #1505

  2. edit mode needs @nic-chen's support to validate data.

@nic-chen
Copy link
Member

@LiteSun
The api cannot verify whether the submitted data is missing fields.
Only required fields can be checked if they are missing.

@LiteSun
Copy link
Member

LiteSun commented Feb 25, 2021

@LiteSun
The api cannot verify whether the submitted data is missing fields.
Only required fields can be checked if they are missing.

ok, let me do more research on how to prevent the page from crashing if a field is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants