cloudspout / cloudspout-button-panel

Grafana panel to integrate with any kind of HTTP/REST API
MIT License
50 stars 35 forks source link

Download Button should be able to download the file #43

Open sameoo opened 3 years ago

sameoo commented 3 years ago

Hi,

We have one urgent request, we are trying to download the file using API, we are seeing the response data as encoded content. We need to download the file on click. we are using flask API from flask.send_file

xerocobra commented 3 years ago

Hi, we have the same requirements. Our API call is producing a plain text file, that needs to be downloaded by the user. Is there a solution for this already?

flistonfr commented 1 year ago

Hello! I need the same feature. I would like to download files when clicking. Thanks!

rakesh94 commented 1 year ago

+1 would really love if downloading works.

A-BenMao commented 1 year ago

+1 would really love if downloading works. Is there a solution for this already?

rakesh94 commented 10 months ago

Seems like this issue or the repo is abandoned. I have moved out of this plugin and commenting here the workaround so any other future googlers can find it.

Grafana has a inbuilt text panel which allows HTML code to be written. You can also add javascript and include scripts on your own. So i wrote a button that calls a function in the script tag. The script tag calls the get api using fetch api call. If you want to stream the response and store it on runtime, the streamsaver js can be added and made use of to download the file in stream.