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.

Loading screen
#1
Maybe somebody knows how can I prepare loading screen which would be shown until welcome page will be loaded?
Reply
#2
Hi,

I don't think that is possible now as the custom JavaScript is loaded only when visu starts..

Only way you can bypass that is to skip default welcome screen by setting the default startpage in the user settings direct to the visu and create your own welcome screen.

I don't think that that is your plan (;

BR,

Erwin
Reply
#3
Perfect would be when there will be no white or black screen and no unloaded screen without a screen  "Please wait".
Reply
#4
Not possible, if you want that then it must be build in to all browsers, if that message would be server side (and for us it is) then it must first be loaded before it can even show the wanted message...
Reply
#5
Chrome web apps have little support for welcome screens https://developer.chrome.com/multidevice...homescreen
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#6
Hi
I'm trying the solution from the link above.
I need to add <link rel="manifest" href="manifest.json"> into page's HEAD. How can I do it? Is it possible through javascript in the same way as I inject my own icon?

Code:
$(function(){
new_path = '/scada/resources/icons/favicon.png'
$('head > link')[3].href= new_path
$('head > link')[4].href= new_path
});

I need to store manifest.json file in LM. Can I do it in Images/Background, icons etc? Is there a better solution?

Thank you
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#7
Code:
$('<link rel="manifest" href="manifest.json">').appendTo('head')

You can store data via io.writefile('/path/to/file', data) but keep in mind that it will be deleted after FW upgrade.
Reply
#8
Thank you admin.
But I don't know LM's internal directory structure. Can I ask you about advice which '/path/to/file' should I use? I tried just janifest.json with no path and was looking for the file in root and in scada-vis directory but I haven't found it.

Here is my simple code for generating the file in case someone else is interrested in. I'm planning to add this code to Init event for minimizing the FW update issue mentioned abowe.



require('json')
local lt_data= {
  name="Smart Home",
  short_name="SmartHome",
  start_url="/scada-vis/touch",
  display="fullscreen",
  background_color="#575656",
  description="Smarthome aplication for Eclipse building",
  orientation="portrait-primary",
  theme_color="aliceblue",
  icons={
    {
    src="/scada/resources/icons/favicon.png",
    sizes="128x128",
    type="image/png"
    },
    {
    src="/scada/resources/icons/favicon.png",
    sizes="192x192",
    type="image/png"
    }
  },
  related_applications={
    {
    platform="web"
    }
  }
}
ls_data = json.encode(lt_data)
log(io.writefile('/www/scada/resources/chrome-manifest.json', ls_data))
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#9
All files accessible from the web UI are stored under /www/
Reply
#10
Thank you. I changed the code
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply


Forum Jump: