Giter Site home page Giter Site logo

Comments (6)

anryko avatar anryko commented on July 17, 2024

Hi lawre,
Now it is more complicated to change grafana 3 menu. However, I found IMO better solution with adding redirect dashboard. Unfortunately I can't just give you the dashboard JSON to import because grafana will automatically execute it and perform the redirect. So there will be no way for you to save imported dashboard. Nevertheless I'll do my best trying to explain how to do that manually, using grafana GUI.

You will have to create a new grafana dashboard. In dashboard settings you should rename it to "Scripted Dashboard". Then add a "text" row of "html" type. Then to the text field of that row you need paste this code:

<meta http-equiv="refresh" content="1;url=/dashboard/script/getdash.js">
<script type="text/javascript">window.location.href = "/dashboard/script/getdash.js"</script>

After this is done you will have to save the dashboard. That's it. Now from your Grafana Home screen you can select newly created "Scripted Dashboard" and it will automatically redirect you to the actual GetDash dashboard.

Here is exported dashboard. Just in case I failed in my explanation and maybe JSON code will be clearer :). You will not be able to import it but maybe it will help.

{
  "id": 2,
  "title": "Scripted Dashboard",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "hideControls": true,
  "sharedCrosshair": false,
  "rows": [
    {
      "collapse": false,
      "editable": true,
      "height": "250px",
      "panels": [
        {
          "title": "Scripted Dashboard automatic redirect",
          "error": false,
          "span": 12,
          "editable": true,
          "type": "text",
          "isNew": true,
          "id": 1,
          "mode": "html",
          "content": "<meta http-equiv=\"refresh\" content=\"1;url=/dashboard/script/getdash.js\">\n<script type=\"text/javascript\">window.location.href = \"/dashboard/script/getdash.js\"</script>",
          "links": [],
          "height": "20px",
          "transparent": true
        }
      ],
      "title": "Row"
    }
  ],
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "schemaVersion": 12,
  "version": 0,
  "links": []
}

from grafana-influx-dashboard.

lawre avatar lawre commented on July 17, 2024

I tested your method and it works better than the method before. I had no idea an html refresh/redirect would work, so I hope this is an intended feature and the grafana team won't "fix" it in the future. :)

from grafana-influx-dashboard.

anryko avatar anryko commented on July 17, 2024

I hope so too :).

from grafana-influx-dashboard.

lawre avatar lawre commented on July 17, 2024

one issue i found: once the redirect is created, it is impossible to edit it through the UI since it gets redirected away. Any suggestions?

from grafana-influx-dashboard.

anryko avatar anryko commented on July 17, 2024

Create a new one with the same name. Then on saving action it will let you overwrite the old one.

from grafana-influx-dashboard.

vasekch avatar vasekch commented on July 17, 2024

Another downside is that you can't use such dashboards in playlists, such a pity. Nice workaround, though.

from grafana-influx-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.