GithubHelp home page GithubHelp logo

grafana-button-panel's People

Contributors

ldsystem avatar speakyourcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grafana-button-panel's Issues

specify database in the query

is it possible to support database selection (as a panel variable) in the query? like in DROP MEASUREMENT ?
I think INFLUXQL does not support configuring the database in the query. But if you are using the REST API, the database can be specified. Can we support something like this?

{
"query": "DROP MEASUREMENT "$measurement_name"”,
"db": "$database_name",
"rawQuery": true,
"resultFormat": "time_series"
}

Custom Response text

Hi @speakyourcode / @Ldsystem ,

Thank you for the plugin. I have been using it for long and it works flawlessly. I use it insert the data into the MySQL tables. Is there anyway to show the response(which SQL gives like duplicate rows when primary key is there) when the query fails? For now it gives 400 response code if i am not wrong. It would be good if we get that response from SQL so that it would be helpful for people who are using the dashboard.

Thank you and waiting for your response.

I have a mysql table. How to insert the data inside it?

I have a mysql table. How to insert the data inside it? I am using the below query but that dosent work.

{
"rawSql": "INSERT INTO TestDB.MAINT_MODE (HostName,ItemName,Start_Date,End_Date,Processed_Flag) VALUES (asdf,ghjk,9894,thdk,Y);",
"format": table
}

But nothing is happening

Plugin does not work in newer Version than v8.5.0 due to API change

Hi!

After upgrading my Grafana instance to v9.0.3 I noticed that I'm getting 404 Errors after clicking on a button:
image

The 404 error is cause by trying to call the /api/tsdb/query path.
According to the Grafana v8.5.0 documentation the /api/tsdb/query path is deprecated.

So since v9.0.x the new path need to be /api/ds/query according to the docs.
At least it looks like the POST body format stayed the same.

Using the Health API it should be possible to determine the current Grafana version before sending the API call according to the button click.

Button not working with Postgres Datasource

Hello,

I love this button, but unfortunately is not working with Postgres Datasources.
I'm using the json returned by query inspector, only the query part.
Button return 200 ok message, but the action defined in datasource (a table update) doesn't works.
The datasource itself is working fine.

Here my query:

{
"request": {
"url": "api/tsdb/query",
"method": "POST",
"data": {
"from": "1610432023688",
"to": "1610432323689",
"queries": [
{
"intervalMs": 60000,
"maxDataPoints": 934,
"rawSql": "UPDATE schema_name.table_name set flag=1 where flag=0",
"format": "table"
}
]
}
}
}

Also tried to reduce it as

{
"queries": {
"rawSql": "UPDATE schema_name.table_name set flag=1 where flag=0",
"format": "table"
}
}

Could you please advice on this?

Many thanks in advance,
best regards,
Emanuele

drop measurement did not work

configured a button to drop a measurement called "Test_tr1"

{
  "query": "DROP MEASUREMENT \"Test_tr1\"",
  "rawQuery": true,
  "resultFormat": "time_series"
}

it returns a green notification Delete: 200 (OK) but the measurement is still in the db.

How to call the stored Procedure?

Hi Team,

Thanks for the wonderful plugin. I have been using for inserts till now. But can you please let me know how to call the stored procedure from the click ? Also request you to add some more examples in the sheet so that we dont disturb you :-)

[Feature Request] Add the option to refresh the dashboard after a button has been clicked

Hi there,

thank you very much already for your excellent plugin, it is very handy for our use case!

Would it be possible/considerable for future versions to add the ability to add the configuration parameter to trigger a dashboard refresh after a button has been clicked and the result has been returned via the notification successfully ?

Best regards and have a nice day

Daniel

Control functionality question

Hi, I am considering using your plugin for a user interface in my grafana dashboard. I'm confused as to how database queries can be used for dashboard controls.

When edit any properties, all buttons collapse

I am editing any property (in editor), like Query, Color , ... still after pressing the key, everything is packed

for example, I press the space key at the specified location

image

the editor was packed

image

Add possibility to show REST call result

Hello,
I'm trying to use your plugin with Infinity datasource.
It works fine but I have only a notify popup with the text "200 (OK)" as feedback.
Could you please add an optional text box to show results from datasource or (could be better) a javascript method to override?

Thank you for your plugin!

Fabrizio

"Plugin not registered" error with Grafana 8.0.2.

Thank you for this very useful plugin, unfortunately it is not working for me with a "marcusolsson-json-datasource" datasource. I am using the dockerized version of grafana 8.2.0 and I have the following error on grafana logs:

error="plugin not registered"

On the front-end the error is "Metric request error".

there is not a problem on the server api side (a flask microservice) because I cannot even see the requests from grafana.

Not able to use Button Panel in the AMG(AWS managed Grafana) dashboard

Gets below error when uses Button Panel in the dashboard when used in AMG(AWS managed Grafana)

{message: "Internal server error", messageld: "plugin unavailable", statusCode: 500, traceID: "'} message: "Internal server error" messageld: "plugin.unavailable" statusCode: 500

Please find the attachment:

Screenshot 2024-04-05 at 12 52 07 PM

Need help on this concern

Implementing Mysql

Hi, I was wondering if there's a way to implement it to MYSQL. I am looking to update a Table by clicking the button but I don't know if that is going to be possible.

two SQL queries in one click MySQL

Hi,

Is it possible to create a SQL query against the MySQL database so that two queries are executed on one click?
I tried :

[
{
"rawSql" : "INSERT INTO REPORTER.REPORTER_JOURNAL (chrono, userid, servername, serial, serverserial, text1) VALUES (NOW(), '${__user.id}', 'GRAFANA', '$serverserial', '$serverserial', 'Alert Acknowledge by ${__user.login}')",
"format": "table"
},
{
"rawSql" : "UPDATE REPORTER.REPORTER_STATUS SET acknowledged = IF('${__user.login}' IN ('xxx', 'yyy'), '1', acknowledged) WHERE serverserial = '$serverserial'",
"format": "table"
}
]

Br,
M

"Cosmetic" Feature request: change color of the buttons to custom colors and add an icon to the button

Hi!

Is there any plan or roadmap for add the possibility in the plugin to change the button color to a custom color, and add an icon to the button, like you can do for example in Volkov Labs Data Manipulation Panel, https://volkovlabs.io/plugins/volkovlabs-form-panel/, or in Cloudspout-Button-Panel, https://grafana.com/grafana/plugins/cloudspout-button-panel/?

Your plugin is amazing, and is the only one of "button type" that works correctly with Infinity Plugin and Oauth2 authentication, so the use cases that you can create for "Response" using API POST are really a lot, :)

Thanks for create this plugin.

Regards,
Alejandro

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.