Add more fields in Datasource config page

I am developing a plugin using simple json datasource, I have to give many more inputs to give while adding a datasource, can you help me where is the current=“ctrl.current” pointing in
this is my config.html file
i am accessing it like ng-model = “current.username”

how should i get it in the datasource file ?
i tried by usimg instanceSettings.username; but it dint work

1 Like

Use the jsonData property for custom fields.

Marcus

Here’s how i did at https://github.com/gbrian/grafana-timelion-datasource

  • In config.html add extra code for the settings like <input ng-model="ctrl.current.jsonData.xxxx"/>
  • In your ConfigCtrl constructor initialize values
  • In datasource.js read the value at constructor like this instanceSettings.jsonData.xxx

Hope this helps