This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

link on scada-vis
#9
(01.11.2024, 13:25)admin Wrote: 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.

in the end I found an italian way to do it Smile

event script for the button on visu
Code:
url = storage.get('dashboard_url', 'https://www.google.com/')
lunghezza = string.len(url)
n=1
dashboard_url=''

for i = 1, lunghezza, 230 do
 
  blocco = string.sub(url, i, i+229)
 

 
  grp.write('33/2/'..n, blocco)
  log (i, blocco)
  sleep (0.5)
  sottostringa = grp.getvalue('33/2/'..n)
 
  dashboard_url = dashboard_url..sottostringa
 

  n= n +1
end


and  JS

Code:
  // Funzione per aggiornare l'URL una volta ricevuti tutti i blocchi
  function aggiornaUrl() {
   // if (blocco1 && blocco2 && blocco3 && blocco4) {
      url = blocco1 + blocco2 + blocco3 + blocco4;
   // }
  }

  // Listener per ogni indirizzo di gruppo
  grp.listen('33/2/1', function(obj) {
    blocco1 = obj.value;
    aggiornaUrl();
  });

  grp.listen('33/2/2', function(obj) {
    blocco2 = obj.value;
    aggiornaUrl();
  });

  grp.listen('33/2/3', function(obj) {
    blocco3 = obj.value;
    aggiornaUrl();
  });

  grp.listen('33/2/4', function(obj) {
    blocco4 = obj.value;
    aggiornaUrl();
  });
});


Best regards 

Peppe
Reply


Messages In This Thread
link on scada-vis - by gdimaria - 30.10.2024, 15:33
RE: link on scada-vis - by admin - 30.10.2024, 15:41
RE: link on scada-vis - by gdimaria - 31.10.2024, 12:33
RE: link on scada-vis - by admin - 01.11.2024, 07:35
RE: link on scada-vis - by gdimaria - 01.11.2024, 12:58
RE: link on scada-vis - by admin - 01.11.2024, 13:03
RE: link on scada-vis - by gdimaria - 01.11.2024, 13:21
RE: link on scada-vis - by admin - 01.11.2024, 13:25
RE: link on scada-vis - by gdimaria - 01.11.2024, 20:12

Forum Jump: