Sub Process_Globals
Public BANano As BANano 'ignore
'this is the folder on your development server.
Public AppName As String = "giaokvb"
Public AppTitle As String = "Quản lý TNMT Vùng bờ"
Private Publish As String = "C:\laragon\www"
Public Version As String = "1.00"
Public ServerIP As String
Public Database As String = "dtbgkvb"
Public DbPort As String = "27017/dtbgkvb"
Public DbHost As String = "bong:*****@xxx.xxx.xx.xxx"
End Sub
Sub AppStart (Form1 As Form, Args() As String)
'read the ServerIP from config.properties file
'change this according to your needs
Dim config As Map = File.ReadMap(File.DirAssets, "config.properties")
ServerIP = config.Get("ServerIP")
'initialize banano for first use
BANano.Initialize("BANano", AppName, DateTime.now)
BANano.HTML_NAME = "index.html"
BANano.Header.Title = AppTitle
BANano.Header.AddFavicon("./assets/bonho.jpg", "16x16")
BANano.Header.AddAppleTouchIcon("apple-touch-icon.png", "180x180")
BANano.Header.Author ="Anele Mbanga (Mashy)"
'BANano.Header.Charset = "iso-8859-1"
BANano.Header.Description = "BVAD3 Design System"
'BANano.header.Expires = "Mon, 22 Jul 2002 11:12:01 GMT"
BANano.Header.Keywords = "banano,vuetify,material design"
BANano.Header.Language = "en"
BANano.Header.AddMeta($"<meta name="copyright" content="© 2020 BVAD3">"$)
BANano.Header.AddMeta($"<meta name="robots" content="ALL">"$)
'BANano.Header.AddMSTileIcon("mstile-150x150.png", "144x144")
'BANano.Header.SetMaskIcon("safari-pinned-tab.svg")
'BANano.Header.AddManifestIcon("android-chrome-192x192.png", "192x192")
'BANano.Header.AddManifestIcon("android-chrome-512x512.png", "512x512")
BANano.TranspilerOptions.UseServiceWorker = False
BANano.TranspilerOptions.MinifyOnline = False
BANano.TranspilerOptions.RemoveDeadCode = False
BANano.TranspilerOptions.IgnoreWarningsOldBrowsers = True
BANano.TranspilerOptions.SetFireReadyWhenReadyStateComplete(False)
BANano.TranspilerOptions.ShowWarningDeadCode = False
BANano.TranspilerOptions.MergeAllCSSFiles = True
BANano.TranspilerOptions.MergeAllJavascriptFiles = True
BANano.TranspilerOptions.EnableLiveCodeSwapping = False
BANano.TranspilerOptions.IgnoreB4JLibrary("BVAD3Classes")
BANano.Header.OnDOMContentLoaded = BANanoShared.DOMContentLoaded
'set php settings
BANano.PHP_NAME = $"${AppName}.php"$
#if release
'change to external host domain e.g http://www.google.com
'exclude the port address
#end if
BANano.PHPHost = $"${ServerIP}/${AppName}/"$
BANano.PHPAddHeader("Access-Control-Allow-Origin: *")
BANano.Build(Publish)
'
Dim sPath As String = $"${Publish}\${AppName}\assets"$
Dim tPath As String = $"${Publish}\${AppName}\styles"$
File.MakeDir(tPath, "images")
'
tPath = $"${tPath}\images"$
'
File.Copy(sPath, "layers.png", tPath, "layers.png")
File.Copy(sPath, "layers-2x.png", tPath, "layers-2x.png")
File.Copy(sPath, "marker-icon.png", tPath, "marker-icon.png")
File.Copy(sPath, "marker-icon-2x.png", tPath, "marker-icon-2x.png")
File.Copy(sPath, "marker-shadow.png", tPath, "marker-shadow.png")
Dim fx As JFX
'Dim URL As String = File.GetUri(File.DirApp,"log.txt")
'fx.ShowExternalDocument(URL)
'
Dim appPath As String = $"${ServerIP}/${AppName}/index.html"$
fx.ShowExternalDocument(appPath)
#if release
ExitApplication
#end if
End Sub