You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/02/02 09:40:51 UTC

[GitHub] [apisix-dashboard] liuxiran commented on issue #1039: Build plugin form according to its jsonschema

liuxiran commented on issue #1039:
URL: https://github.com/apache/apisix-dashboard/issues/1039#issuecomment-771504973


   I talked about this issue with @juzhiyuan offline and we have reached the following consensus:
   
   1. To improve the user experience, we would add plugin configuration templates, which are a range of configurations based on the different use scenario, in the templates, we should add  instructions for each configuration item at the same time.
   
   **where would these configuration template stored?**
       Stored in files would be better. Create a template file for each plugin under something called  `doc/plugin_templates` dir in dashboard
   **what is the template file type?**
      The type of the template file can be `markdown` or `yaml`. `yaml` would be easier to parse 
   **what would the template look like?**
      This needs further discussion. may be we can use follows:
   take limit-conn for an example
   ```yaml
   scenario1:                   # limit concurrency per client's IP
      conn: 1                   # the maximum number of concurrent requests allowed
      burst: 0                  # the number of excessive concurrent requests (or connections) allowed to be delayed
      default_conn_delay: 0.1  # the default processing latency of a typical connection
      rejected_code: 503       # returned when the request exceeds conn + burst will be rejected, default is 503
      key: "remote_addr"       # limit the concurrency level
   
   scenario2:                   # limit concurrency per server's IP
      conn: 1                   # the maximum number of concurrent requests allowed
      burst: 0                  # the number of excessive concurrent requests (or connections) allowed to be delayed
      default_conn_delay: 0.1  # the default processing latency of a typical connection
      rejected_code: 503       # returned when the request exceeds conn + burst will be rejected, default is 503
      key: "server_addr"       # limit the concurrency level
   ...
   ```
   
   2.  To support instructions in the configuration templates, we should use `yaml`  instead of `json` in dashboard plugin codemirror.
   3. in the plugin config page, we would add a select box to select configuration template, and show the template configuration in the codemirror:
   
   ![image](https://user-images.githubusercontent.com/2561857/106580514-f96dba00-657c-11eb-9756-a92831f23a03.png)
   
   Welcome any suggestions to improve the program
   
   cc @imjoey @LiteSun @membphis 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org