Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
fix the reloaded info for code interpreter
  • Loading branch information
alalulu8668 authored Jun 2, 2024
1 parent bef57bc commit f9499ce
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions public/chat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -891,21 +891,27 @@ <h3 class="text-center">Welcome to BioImage.IO Chatbot</h3>
function setupCodeInterpreter() {
// check if the browser is not Chromium based then tell the user to use Chromium based browser
if (!window.showOpenFilePicker) {
const warning = document.createElement("div")
warning.classList.add("alert")
warning.classList.add("alert-warning")
warning.role = "alert"
warning.innerHTML = `<strong>Warning!</strong> While the code interpreter works in non-Chromium based browsers, the ability to mount data folders to the chatbot is only supported in Chromium based browsers (e.g. Chrome, Edge, Brave, etc.). Please use a Chromium based browser for full functionality.`
// insert the warning after the chat-dialog-header
$('#chat1 .chat-dialog-header').after(warning)
if (!document.getElementById('non-chromium-warning')) {
const warning = document.createElement("div")
warning.classList.add("alert")
warning.classList.add("alert-warning")
warning.id = "non-chromium-warning"
warning.role = "alert"
warning.innerHTML = `<strong>Warning!</strong> While the code interpreter works in non-Chromium based browsers, the ability to mount data folders to the chatbot is only supported in Chromium based browsers (e.g. Chrome, Edge, Brave, etc.). Please use a Chromium based browser for full functionality.`
// insert the warning after the chat-dialog-header
$('#chat1 .chat-dialog-header').after(warning)
}
}
else{
const info = document.createElement("div")
info.classList.add("alert")
info.classList.add("alert-info")
info.role = "alert"
info.innerHTML = `<strong>Info:</strong> The code interpreter runs entirely in-browser. Mounted data stays in-browser, won't be uploaded to any server. Code execution results, like print messages, are sent to the chat server. WARNING: Please ALWAYS keep a backup before mounting your data folder.`
$('#chat1 .chat-dialog-header').after(info)
else {
if (!document.getElementById('chromium-info')) {
const info = document.createElement("div")
info.classList.add("alert")
info.classList.add("alert-info")
info.id = "chromium-info"
info.role = "alert"
info.innerHTML = `<strong>Info:</strong> The code interpreter runs entirely in-browser. Mounted data stays in-browser, won't be uploaded to any server. Code execution results, like print messages, are sent to the chat server. WARNING: Please ALWAYS keep a backup before mounting your data folder.`
$('#chat1 .chat-dialog-header').after(info)
}
}
$('#console-btn').show()
const bioengineStartupScript = `
Expand Down Expand Up @@ -1964,4 +1970,4 @@ <h3 id="spinner-${messageId}" style="display:none;"><div class="spinner" style='
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.3.0/github-markdown-light.css" />
</body>

</html>
</html>

0 comments on commit f9499ce

Please sign in to comment.