Can make ui_gauge clickable?

So with the ui_template node

<script>
    (function(scope) { 
        
        const addListeners = function(){
            let clickables = $('.clickable')
            for(let i = 0;i<clickables.length;++i){
                clickables[i].addEventListener('click',(evt) => {
                    scope.send({payload:evt.currentTarget.getAttribute('node-id'),topic:'dashboard-element-clicked'})
                })
            }
        }

        setTimeout(addListeners,100)

    })(scope);
</script>

Then add .clickable class to all elements which you wont to be clickable.
image

And the output of the ui_template will give the id of the clicked node
image

And then at server side you'll need to make some kind of logic which bounds node's id's with the data you need

2 Likes