-
Notifications
You must be signed in to change notification settings - Fork 575
Closed
api7/dashboard-components
#64Description
Why
- The plugin module is divided into two parts:
- Generic plugin page;
- Plugin Orchestration
This proposal is intended to document changes to the generic plugin page.
How
Operation & Limitation
The plugin list page is used to categorize each plugin using the card and its basic information: name, description, enable or disable, Raw View, configuration button.
- The specific classification should be obtained from the APISIX plugin, but since APISIX does not currently implement this feature, a set of mappings is maintained on the frontend to get the specific classification based on the filename. If there is no classification, it is classified as "Other".
- The "Description" is used to show the description of the plugin, which is obtained from the relevant GitHub plug-in documentation.
- When you click
View Raw, enable Ant Design's drawer component and use a plugin such as CodeMirror Highlight to display the data currently bound to the plugin in JSON format. This behavior is independent no matter if this plugin is enabled. In addition, View Raw currently supports read-only but should be considered editable. - Whether or not the plugin is enabled is determined by whether or not the plugin name is included in the plugins field of the initialization data passed into the Plugin module. If the plugin is included in the initialization data, it is enabled by default.
- When a plugin is enabled, data sent to the API should be appended to the plugins object or omitted otherwise.
- When the
Configurebutton is clicked- First, get the plugin schema and use
react-jsonschema-formto render the view. - Gets the initial data, and if the plugin is included, gets the corresponding data and populates it into the UI so that the user can continue to configure it.
- Note: The schema of some plugins cannot render properly in the UI due to the differences of JSONSchema version (Draft7 is required in this PluginModule), if you encounter such plugins, you can record them in the GitHub issue.
- First, get the plugin schema and use
Module
- The plugin module (which contains the plugin list page and plugin edit page) should be called from inside the component to get the plugin list API and render the page when it is loaded.
- The module has an internal method called
getData, which is used to get all the currently enabled plugin configurations, here is an example when you call that method:
{
"basic-auth": {},
"prometheus": {}
}- The module has the following two props.
- initialData: Initialization data for enabled plugins
- ref: A React Reference so that we can call the child
getDatamethod from the parent component. https://stackoverflow.com/questions/37949981/call-child-method-from-parent 。
Metadata
Metadata
Assignees
Labels
No labels
