link on scada-vis - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: link on scada-vis (/showthread.php?tid=5712) |
link on scada-vis - gdimaria - 30.10.2024 Hi, is there a way to update the external link URL via script? Thanks PEPPE RE: link on scada-vis - admin - 30.10.2024 See this: https://forum.logicmachine.net/showthread.php?tid=1903&pid=11806#pid11806 RE: link on scada-vis - gdimaria - 31.10.2024 (30.10.2024, 15:41)admin Wrote: See this: https://forum.logicmachine.net/showthread.php?tid=1903&pid=11806#pid11806 $(function() { $('.link').off('vclick').on('vclick', function() { window.open('http://openrb.com'); }); }); That's fine, but I need to pass the URL from a key in storage... is it possible? RE: link on scada-vis - admin - 01.11.2024 Use a virtual object with 250 byte string data type (32/0/1 in this example). Code: $(function() { RE: link on scada-vis - gdimaria - 01.11.2024 (01.11.2024, 07:35)admin Wrote: Use a virtual object with 250 byte string data type (32/0/1 in this example). in fact I had already thought of this solution, the problem is that the URL is too long and is truncated to 250 bytes as it contains an authentication token that changes every time: http://10.0.0.146:8080/dashboard/28a2e200-75d2-11ef-80b8-2949263888cf?accessToken=eyJhbGciOiJIUzUeMiJ9.eyJzdWIiOiJnZGltYXJpYUBsaWJlcm8uaXQiLCJ1c2VySWQiOiI3NmE0ZmFjMC03MGU1LTExZWYtODBiOC0yOTQ5MjYzODg4Y2YiLCJzY29wZXMiOlsiQ1VTVE9NRVJfVVNFUiJdLCJzZXNzaW9uSWQiOiI4NmNmZDA4Yy04NzIwLTRmNzctOTAwYy0zYWFlNWIyNjZlNWQiLCJleHAiOjE3MzA0MzU0MDEsImlzcyI6InRoaW5nc2JvYXJkLmlvIiwiaWF0IjoxNzMwNDI2NDAxLCJmaXJzdE5hbWUiOiJQZXBwZSIsImxhc3ROYW1lIjoiTGliZXJvIiwiZW5hYmxlZCI6dHJ1ZSwiaXNQdWJsaWMiOmZhbHNlLCJ0ZW5hbnRJZCI6IjQzYTAxNGIwLWEwMjYtMTFlZS04MTJhLWU3M2JhZWFkYjcxMiIsImN1c3RvbWVySWQiOiJmZDAxOWIxMC03MGU0LTExZWYtODBiOC0yOTQ5MjYzODg4Y2YifQ.3N5fFV26nfh-ZuufXxDBRxzgfiv2ZLYSbrQJD_0Ke4-xCmGCe7wXh3z-d4f1bDRFzj4OY6I7svUU8So-6_WXUw RE: link on scada-vis - admin - 01.11.2024 You can create a .lp file that redirects to the specified URL from a storage entry. This way you don't need Custom JS at all. Link URL should be set to /user/redirect.lp. Code: <? RE: link on scada-vis - gdimaria - 01.11.2024 (01.11.2024, 13:03)admin Wrote: You can create a .lp file that redirects to the specified URL from a storage entry. This way you don't need Custom JS at all. Link URL should be set to /user/redirect.lp. sorry, but I have no idea about that... as you can understand, I just need to set a button object or something to click on visu to open a new tab in the browser with the link. Can you please give me the operating steps to do it? where I have to put that code and how? Thanks RE: link on scada-vis - admin - 01.11.2024 Create redirect.lp file and upload it to user directory via FTP using apps login. You might still need custom JS to open URL in a new window/tab. RE: link on scada-vis - gdimaria - 01.11.2024 (01.11.2024, 13:25)admin Wrote: Create redirect.lp file and upload it to user directory via FTP using apps login. in the end I found an italian way to do it event script for the button on visu Code: url = storage.get('dashboard_url', 'https://www.google.com/') and JS Code: // Funzione per aggiornare l'URL una volta ricevuti tutti i blocchi Best regards Peppe |