Variable, HTML code, Button

Hello, I am trying to make a button which will save value to one of my variable. I tried many things but does not work.

Can somebody help how to add function to button to set the variable ? Few examples:

  • Write number 50 to variable $machine
  • Write regex to variable $machine

This is my button code in text panel in HTML mode
<button class="btn navbar-button gf-timepicker-nav-btn" style="width: 100%" onClick="????">Execute</button>

This is the button
image

Variable list
image

Hello,

I’m afraid I can’t help you here either. However, could you help me?

I try to display a button, I do this in a text field and change the option to html.


unfortunately it only shows me the source code in the output.
Can you tell me what I do wrong?

Check your settings in grafana.ini and change to true, see below

[panels]
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
disable_sanitize_html = true

Hello i need help, actually i did all the things that you all said, however doesn`t work

image

any idea?
Thanks

Hello, I have exactly the same problem.
disable_sanitize_html is set to true but the button is not shown.

Nvm I solved my problem. I had a typo.

You have to uncomment the configuration:

;disable_sanitize_html = true

change to

disable_sanitize_html = true

solved! thanks but i need now to know how put icon image any idea?

You could use Font Awesome icons, for example: <i class="fa fa-play"/>

yes i did, thanks so much for help me.

Hi Fortiz,

I´m struggling with this, can you help me on how to call a variable and it´s value onclick