import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs" import "pkg:/source/asyncTask/asyncTask.bs" import "pkg:/source/utils/StringUtils.bs" function Init() end function function OnNodeReady() address = m.webserver@.GetServerAddress(invalid) isValidIp = not StringUtils.IsNullOrEmpty(address) if isValidIp m.top.url = address end if m.top.findNode("noInternet").visible = not isValidIp m.top.findNode("yesInternet").visible = isValidIp end function function OnUrlSet() url = m.top.url urlLabel = m.top.findNode("urlLabel") urlLabel.text = url qrCodePoster = m.top.findNode("QrCodePoster") StartAsyncTask(GenerateQrCodeTask, { poster: qrCodePoster, text: url, size: qrCodePoster.loadWidth, padding: 20 }) end function