You are not logged in.
Pages: 1
I am trying to build custom functionality through the port using custom button feature. Wanted to understand if there is a possibility to pass variables and return a response (say JSON) from service.
Kindly let me know your thoughts, possibly you can share a sample code/steps.
thanks in anticipation!
Last edited by Rahul (2021-06-13 14:02:28)
Offline
Sure you can use [[NetReturn ]] to do it.
https://docs.nanodlp.com/manual/code/
Offline
I just tried to add test functionality to redirect to /plates. but receiving an error:: "Net Request Failed Get '/plates': unsupported protocol scheme ''
here is the content from my buttons.json:
{
        "ID": 0,
        "Name": "Test",
        "Position": "/",
        "Condition": "",
        "Color": "btn btn-info",
        "Gcode": "[[NetReturn /plates]]",
        "HTML": "\u003clabel\u003etest redirect\u003c/label\u003e",
        "ConfirmText": "testing redirect"
    }
My actual requirement is to execute the external script passing some values and return the response back to the page. 
For Ex: Adding current time to the UI, also allowing the user to modify time and change the timezone.
kindly advise.
Offline
It must be full URL. For example http://127.0.0.1/plates
Offline
Pages: 1