Skip to content

v1.0.2

Choose a tag to compare

@andreypfau andreypfau released this 18 May 02:05
· 16 commits to main since this release

Fixed

  • Malformed iframe URLs: every embedded Grafana iframe was loading a
    URL missing both ? and panelId=N, e.g.
    /d-solo/<uid>/<slug>&var-device=.... Grafana responded with a 404
    whose default X-Frame-Options: deny made the browser show the
    iframe as <host> refused to connect, masquerading as a Grafana
    embedding/CSP problem.

    Root cause: in _iframe_pair.html, "?panelId="|add:panel_id|stringformat:"s"
    evaluated as stringformat(add("?panelId=", 3), "s"). Django's add
    filter, given a string and an int, fails both the int()+int() and
    str+str branches and returns the empty string, deleting the whole
    ?panelId=N prefix from the query string. Coerce panel_id to a
    string before feeding it into add.

  • URL-encode device_value and component_value in the iframe src
    so Device/component names containing spaces or & produce valid URLs.

Install

pip install git+https://github.com/AlphaCompute/netbox-grafana-embed.git@v1.0.2