grafana / opensearch-datasource

Apache License 2.0
25 stars 20 forks source link

Add button to auto-detect version to config editor #132

Closed iwysiu closed 1 year ago

iwysiu commented 1 year ago

Change the ConfigEditor to have a button to detect the version. Instead of having the version selected from a dropdown, we have a button to detect the version and set it. When the button is pushed, we can save the datasource, fetch the OpenSearch version, and re-save the datasource with that information. Note that the datasource needs to be saved first, so that the backend has the correct http address and credentials to send the request. We should still display the version in the editor We should also change testDatasource to fail for ElasticSearch v7.10+ and v8.x and point the user toward the ElasticSearch datasource, and to default to a null version instead of OpenSearch 1.0.x, to make it clearer when it hasn't been set.

iwysiu commented 1 year ago

Video of the added feature:

https://github.com/grafana/opensearch-datasource/assets/5421859/526afb3d-766f-483e-8828-4eed9fec1363