Skip to content

Commit

Permalink
Integrate chatbot into the app menu
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Feb 29, 2024
1 parent 679e151 commit a9304d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<meta name="msapplication-TileImage" content="<%= BASE_URL %>static/icons/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script type="text/javascript" src="https://lib.imjoy.io/imjoy-loader.js"></script>
<title><%= site_name %></title>
</head>

Expand All @@ -57,6 +56,7 @@
})();
</script>
<!-- End Matomo Code -->
<script type="text/javascript" src="https://lib.imjoy.io/imjoy-loader.js"></script>
</body>

</html>
2 changes: 1 addition & 1 deletion site.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"og_image": "https://bioimage.io/static/img/bioimage-io-banner.png",
"og_description": "Advanced AI models in one-click",
"background_image": "static/img/zoo-background.svg",
"manifest_url": "https://bioimage-io.github.io/collection-bioimage-io/rdf.json",
"manifest_url": "https://bioimage-io.github.io/collection-bioimage-io/collection.json",
"explore_button_text": "🚀 Explore the Zoo",
"subscribe_url": "https://docs.google.com/forms/d/e/1FAIpQLSfQhTjXOuTXZNtalprbsXMPd4ct2ydiMhlPc2lhcs6WY4yo0w/viewform?embedded=true",
"contact_form_url": "https://oeway.typeform.com/to/K3j2tJt7",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
computed: {
...mapState({
showNavbar: state => state.showNavbar,
siteConfig: state => state.siteConfig
siteConfig: state => state.siteConfig,
})
},
mounted() {
Expand Down
8 changes: 8 additions & 0 deletions src/bioEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const imjoyReady = new Promise((resolve, reject) => {
resolveImJoy = resolve;
rejectImJoy = reject;
});

export async function setupBioEngine() {
const queryString = window.location.href.split("#")[1].split("?")[1];
const urlParams = new URLSearchParams(queryString);
Expand Down Expand Up @@ -191,6 +192,13 @@ export async function setupBioEngine() {
api.createWindow({ src: "https://jupyter.imjoy.io" });
}
});
app.addMenuItem({
label: "🤖 BioImage.IO Chatbot",
async callback() {
await api.createWindow({"src": "https://staging.chat.bioimage.io/public/apps/bioimageio-chatbot-client/chat", name: "BioImage.IO Chatbot"});
await app.loadPlugin("https://raw.githubusercontent.com/bioimage-io/bioimageio-chatbot/main/bioimageio_chatbot/static/bioimage-model-zoo-extension.imjoy.html");
}
});
// expose global variables
window.api = api;
window.imjoy = app.imjoy;
Expand Down

0 comments on commit a9304d1

Please sign in to comment.