You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
At the moment it is difficult to extend the supported variables in the Dashboard component with new options, e.g. an option from the Azure plugin, which loads all resource groups or an option in the klogs plugin which allows users to select a value from a field.
The problem is that all options for the variables are defined within the following function:
A better solution would be to define the options to load variable values in the plugin, for example we can add a new optional field to the IPluginComponent interface:
With the new variables field we can then define function for each plugin which takes the user defined variable (type: IVariable), then runs the plugin logic / executes the API request and returns the variable values (type: IVariableValues).
Additional context
With this new implementation it is also possible that variables can be defined via community plugins.
We have to find a new home for the Variable Plugin Options documentation. At the moment I think the best would be to add a new Variables heading on the same level as the Configuration and Options headings.
The text was updated successfully, but these errors were encountered:
This commit changes the variables handling, like it was discussed in
issue #250. This means that each plugin can now export a "variables"
function to load variables in a dashboard. The only exception is the
"core" plugin, where the variables are still handled within the
Dashboards component.
This change allows us, to introduced variables for more plugins, like a
list of resource groups via the Azure plugin or a list of field values
via the klogs plugin.
We also adjusted the naming and location of some interfaces for this
change. So that the interfaces for the CRDs are now prefixed with the
name of the CRD (e.g. "IPlaceholder" becomes "IDashboardPlaceholder").
This was necessary to reduce conflicts in names and to avoid cycle
imports.
The documentation for the variables options which can be used in a
dashboard, should be placed on the corresponding plugin page and a link
should be added to the "Variable Plugin Options" section in the
dashboards documentation.
Closes#250.
This commit changes the variables handling, like it was discussed in
issue #250. This means that each plugin can now export a "variables"
function to load variables in a dashboard. The only exception is the
"core" plugin, where the variables are still handled within the
Dashboards component.
This change allows us, to introduced variables for more plugins, like a
list of resource groups via the Azure plugin or a list of field values
via the klogs plugin.
We also adjusted the naming and location of some interfaces for this
change. So that the interfaces for the CRDs are now prefixed with the
name of the CRD (e.g. "IPlaceholder" becomes "IDashboardPlaceholder").
This was necessary to reduce conflicts in names and to avoid cycle
imports.
The documentation for the variables options which can be used in a
dashboard, should be placed on the corresponding plugin page and a link
should be added to the "Variable Plugin Options" section in the
dashboards documentation.
Closes#250.
Is your feature request related to a problem? Please describe
At the moment it is difficult to extend the supported variables in the
Dashboard
component with new options, e.g. an option from the Azure plugin, which loads all resource groups or an option in the klogs plugin which allows users to select a value from a field.The problem is that all options for the variables are defined within the following function:
kobs/plugins/dashboards/src/components/dashboards/Dashboard.tsx
Line 74 in e81cb3c
Describe the solution you'd like
A better solution would be to define the options to load variable values in the plugin, for example we can add a new optional field to the
IPluginComponent
interface:With the new
variables
field we can then define function for each plugin which takes the user defined variable (type:IVariable
), then runs the plugin logic / executes the API request and returns the variable values (type:IVariableValues
).Additional context
The text was updated successfully, but these errors were encountered: