jakubplichta / grafana-dashboard-builder

Generate Grafana dashboards with YAML
Apache License 2.0
147 stars 42 forks source link

Support "include All" option for custom template #149

Open manueligno78 opened 5 years ago

manueligno78 commented 5 years ago

includeAll flag is not working properly. YAML snippet:

...
    - custom-template:
        name: service
        options: 
          - option 1
          - option 2
        includeAll: true
        multi: true
        current: All
...

This is the output:

...
      {
        "current": {
          "text": "All",
          "value": "All"
        },
        "datasource": null,
        "includeAll": true,
        "multi": true,
        "name": "service",
        "options": [
          {
            "text": "option 1",
            "value": "option 1"
          },
          {
            "text": "option 2",
            "value": "option 2"
          }
        ],
        "query": "option 1,option 2",
        "refresh": 0,
        "refresh_on_load": false,
        "type": "custom"
      }
...

Output should be:

...
        "current": {
          "tags": [],
          "text": "All",
          "value": "$__all"
        },
        "datasource": null,
        "hide": 0,
        "includeAll": true,
        "label": "",
        "multi": false,
        "name": "service",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
...
jakubplichta commented 5 years ago

@manueligno78 which grafana version are you using? I'm pretty sure that this worked well in the past..

manueligno78 commented 5 years ago

5.3.2 and 5.1.3. I dont know if it works on 6.x versions.