This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create bookmark.js * Update README.md Add Tip 2 for bookmark to catwalk * Update port logic Works for desktop, server and with docker container Add fallback if appId is not present in url, go to catwalk.core.qlik.com * Add href to bookmark folder and js file
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
javascript: (function () { | ||
const getAppId = (location) => { | ||
const prefix = '/sense/app/'; | ||
let start = location.pathname.indexOf(prefix); | ||
if (start === -1) return; | ||
start += prefix.length; | ||
const end = location.pathname.indexOf('/', start); | ||
const appId = location.pathname.substring(start, end !== -1 ? end : location.pathname.length); | ||
return appId; | ||
}; | ||
const appId = getAppId(window.location); | ||
if (appId) { | ||
const { hostname } = window.location; | ||
const protocol = window.location.protocol === 'http:' ? 'ws' : 'wss'; | ||
const port = window.location.port === '' ? '': `:${window.location.port}`; | ||
|
||
const engineUrl = `${protocol}://${hostname}${port}/app/${appId}`; | ||
const url = `http://catwalk.core.qlik.com/?engine_url=${engineUrl}`; | ||
window.open(url, '_blank'); | ||
} else { | ||
const url = 'http://catwalk.core.qlik.com'; | ||
window.open(url, '_blank'); | ||
} | ||
}()); |