I’ve used HTML anchors [tt]…[/tt] quite successfully in a number of plugin .json files, but I’m having a specific problem with crafting the right static .json file syntax for a link which references port 3480…
Plain URL references to ‘self’ work just fine:
"text": "<a href='/dashboard.html' target='_blank'>Dashboard</a>"
…will link to the file in [tt]/www/dashboard.html[/tt] just fine.
However, I have a plugin which registers a Luup HTML handler in the usual way, say:
luup.register_handler ("HTTP_MyHandler", "dashboard")
…and thus needs to be invoked with a URL of the form [tt]http://10.0.0.2:3480/data_request?id=lr_dashboard[/tt].
I think this also works fine if the .json file specifies a specific URL:
"text": "<a href='10.0.0.2:3480/data_request?id=lr_dashboard' target='_blank'>Dashboard</a>"
BUT, I don’t want to hardwire the IP Vera address (since this is supposed to be installable on any machine) and would like to use something like:
"text": "<a href='127.0.0.1:3480/data_request?id=lr_dashboard' target='_blank'>Dashboard</a>"
But it doesn’t work. Neither does:
"text": "<a href='/port_3480/data_request?id=lr_dashboard' target='_blank'>Dashboard</a>"
The only thing I can think of (which is horrible) is to have a standard URL link to a file which the app writes to /www/ containing a redirect with the specific IP address and port 3480.
There must be a better way … ? (Frankly, I know very little about HTML and am probably being very stupid)