# Overview

The plug-in management function is used to maintain plug-in metadata and define custom attributes at the routing level and custom configuration information at the plug-in level. The created plug-in is enabled when used for routing management settings. When the gateway accepts a request that matches the routing rules, the execution of the enabled plug-in logic will be triggered. Custom attribute data can be obtained in the plug-in logic.

# Plug-in list

Menu location: Gateway Management > Plug-in Management. Click the menu to enter the plug-in management list page, as shown in the figure.

manager_plugin_list_query

# Add new plug-in

Click the Add button to pop up the new window, as shown in the figure.

manager_plugin_add_1

manager_plugin_add_2

Plug-in name: The plug-in name consists of English letters, underscores or numbers. It cannot start with a number and cannot exceed 50 characters in length. It is required;

Plug-in description: A brief description of the plug-in, the length cannot exceed 50 characters, required;

Default execution order: The default execution order of the plug-in, sorted from small to large, the smaller the value, the earlier it is executed, the value range is 0~255, required;

Form definition: a custom attribute at the routing level. When the plug-in is enabled in the routing management configuration, the front end will convert the form definition into a form input interface. For more information, please see the routing management introduction. The form specifications are as follows:

/*
* plugin_config_design
* Dynamic plug-in reference structure
* */

const pluginConfig = [
   {
/* Required fields */
"field": "inputVal",
"label": "input box",
"component": "input", // input, select, radio, checkbox,
"dataType": "string", // number(long, double), string, boolean, array
/* optional fields */
"desc": "Description text of the field",
"placeholder": "placeholder text",
"default": "Aa123", // Initial default value
"options": [ // for select, radio, checkbox
{
"label": "Option 1",
"value": 1 // number(long, double), string, boolean,
},
{
"label": "Option 2",
"value": 2
}
],
"rules": [ // min|max / range / length / regex pattern
{ "required": true, "message": "The input box cannot be empty", "trigger": "change" }, // required
// { "min": 3, "max": 5, "message": "The length is between 3 and 5 characters", "trigger": "change" }, // range length range (for dataType: "string ")
// { "len": 8, "message": "The length requires 8 characters", "trigger": "change" }, // length length limit (for dataType: "string")
// { "type": "number", "message": "Please enter the number type"}, // for dataType: "number" check value
// { "type": "integer", "message": "Please enter an integer value", "trigger": "change" }, // for dataType: "long" check integer
// { "type": "float", "message": "Please enter a floating point value", "trigger": "change" }, // for dataType: "double" Verify floating point number
{ "pattern": "^[A-Za-z\\d]+$", "message": "can only be letters or numbers", "trigger": "change" } // regex pattern
]
   },
   {
"field": "selectVal",
"label": "selector",
"component": "select",
"dataType": "number",
"options": [
{
"label": "Option 1",
"value": 1
},
{
"label": "Option 2",
"value": 2
},
{
"label": "Option 3",
"value": 3
}
],
"desc": "Description text of the selector",
"placeholder": "Please select",
"rules": [
{ "required": true, "message": "The selector cannot be empty", "trigger": "change" }
]
   },
   {
"field": "radioVal",
"label": "radio button",
"component": "radio",
"dataType": "boolean",
"default": true,
"options": [
{
"label": "Yes",
"value": true
},
{
"label": "No",
"value": false
}
],
"desc": "Description text of radio button",
"rules": [
{ "required": true, "message": "Please select the radio button", "trigger": "change" }
]
   },
   {
"field": "checkboxVal",
"label": "Multiple selection box",
"component": "checkbox",
"dataType": "array",
"options": [
{
"label": "Option 1",
"value": 11
},
{
"label": "Option 2",
"value": 22
},
{
"label": "Option 3",
"value": 33
}
],
"desc": "Description text of the multiple selection box",
"rules": [
{ "required": true, "message": "Please select the checkbox", "trigger": "change" }
]
   }
];

// TODO Attention! !
// dataType of component "checkbox" = "array"
//The actual value type of component "radio/select" is equal to the value type in options

Custom configuration: Custom configuration information at the plug-in level, which can be obtained in the plug-in logic.

# Edit plugin

Click the Edit button to pop up the editing window, as shown in the figure.

manager_plugin_edit_1

manager_plugin_edit_2

# Delete plugin

Click the Delete button to pop up the deletion confirmation window, as shown in the figure.

manager_plugin_delete_1

manager_plugin_delete_2

Click the OK button to delete the plug-in. If the plug-in has associated routing configurations, you need to delete all associated routing configurations before you can delete the plug-in.