updates for fasten-desktop.
Unfortunately the /wails/runtime.js request is expected to fail in Docker, but will work in desktop env. Working on a better solution.
This commit is contained in:
parent
1485329b76
commit
ea8a996d29
|
@ -39,6 +39,10 @@
|
||||||
|
|
||||||
<!-- required for lhncbc/lforms -->
|
<!-- required for lhncbc/lforms -->
|
||||||
<script src="./assets/js/webcomponents/webcomponents-loader.js"></script>
|
<script src="./assets/js/webcomponents/webcomponents-loader.js"></script>
|
||||||
|
|
||||||
|
<!-- wails -- this file is expected to be missing in docker/web mode. It's only required in Desktop -->
|
||||||
|
<script type="module" src="/wails/runtime.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
if (!window.customElements) {
|
if (!window.customElements) {
|
||||||
document.write('<!--');
|
document.write('<!--');
|
||||||
|
|
|
@ -6,7 +6,7 @@ export function OpenExternalLink(url: string, desktopMode: boolean, windowId?: s
|
||||||
|
|
||||||
//check if wails exists and is defined
|
//check if wails exists and is defined
|
||||||
if(typeof wails !== "undefined" && desktopMode){
|
if(typeof wails !== "undefined" && desktopMode){
|
||||||
wails.CallByName("pkg.AppService.BrowserOpenURL", url, windowId || 'external')
|
wails.Call.ByName("github.com/fastenhealth/fasten-desktop/pkg.AppService.BrowserOpenURL", url, windowId || 'external').then(console.log, console.error)
|
||||||
} else{
|
} else{
|
||||||
window.open(url, "_blank");
|
window.open(url, "_blank");
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,9 +74,10 @@ declare global {
|
||||||
Once: (eventName, callback) => void
|
Once: (eventName, callback) => void
|
||||||
On: (eventName, callback) => void
|
On: (eventName, callback) => void
|
||||||
}
|
}
|
||||||
Call: (options) => Promise<any>
|
Call: {
|
||||||
CallByID: (methodID, ...args) => Promise<any>
|
ByID: (methodID, ...args) => Promise<any>
|
||||||
CallByName: (name, ...args) => Promise<any>
|
ByName: (name, ...args) => Promise<any>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//see https://lhncbc.github.io/lforms/ for definitions
|
//see https://lhncbc.github.io/lforms/ for definitions
|
||||||
|
|
Loading…
Reference in New Issue