ryantxu / ajax-panel

Ajax Panel Plugin for Grafana
MIT License
153 stars 154 forks source link

AJAX panel erratic behaviour in latest version of Grafana. #103

Open Kortenbach opened 1 year ago

Kortenbach commented 1 year ago

Hi,

Using the latest version of Grafana and the latest version of the JSON plugin I try to view a very simple html page using the AJAX plugin. This is for testing only to keep it simple.

The page looks like:

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

I’m trying to display this page in an AJAX panel plugin (not the text panel because the text panel cannot easily receive the time range for the panel if the user changes it after initial display).

After initial setup this works fine, but when I change something (for instance I change the URL, and I change it back) the panel doesn’t show the page anymore (blanc) or shows an error message ‘404’. I have played around using html pages of various complexity and ended up with this simple setup of the AJAX panel:

Request.Source: HTTP
Request.URL: http://localhost:1880/simple-html
Request. Method: Get
Request.response: Text
Request.Credentials: No
Request.Only changes: No
Request.Show errors: Yes

Parameters : {}

Headers (via javascript): {Accept : ‘text/html’}
Mode: Direct HTML

I’m using the AJAX panel because the TEXT panel doesn’t provide me with the time-range. The page works fine in the text pane though so I’m wondering why it doesn’t work in the AJAX panel. If the AJAX panel is set to TEXT/HTML is should work the same way as the text panel or shouldn’t it?