One of the big improvements in Iguana X is ability to define custom fields on components. These are intended to make it easy to build re-usable components that can be configured by operations staff:
...
These fields are defined such that:
The definition of the fields is part of the component and stored in configuration file called config.json
The values of these fields is part of the operation configuration of each component
This means a component can be used many times and have different configurations
For example on the component card we can see the configuration fields:
...
The values are stored as part of the /wiki/spaces/DEVELOPMEN/pages/2318368811 here:
<instance>/components/configurations/fields/<component guid>.json
For example:
Code Block | ||
---|---|---|
| ||
{
"fields": {
"Folder": "/Folder/",
"Number": "1e3",
"Password": "4E4D90C9F91E21FCD59F9F31D88F71FB",
"Port": "64000",
"String": "A String"
}
} |
As mentioned - there could be many instances of a component with different configuration files. Notice some fields are not present?
These will have default values which are defined in the config.json in the translator. This is the GUI used to edit them. Notice the default value column?
...
You can view the source code this file:
...
language | json |
---|
...
Components are re-usable so you can have many instances of the same component with different custom fields settings. You can add, remove and change custom fields for each component:
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
Expand | ||
---|---|---|
| ||
|
Some more information:
Expand | ||
---|---|---|
| ||
To get programatic access of the values of the custom fields |
...
, there is this api call:
This returns a Lua table with the custom fields and their values for the component. |
Expand | ||
---|---|---|
| ||
You can use the component.setField{} API. |
Expand | ||
---|---|---|
| ||
Custom Field values set in the component card are encrypted and stored locally in components.json file in the component configuration directory.
The custom fields and default values, stored in config.json are stored in the component repository files and checked into Git. See Component Configuration Files. |