Skip to content

Commit

Permalink
Keep chatbot server
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Apr 2, 2024
1 parent 2f763dc commit e5d9103
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/chat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,11 @@ <h3 class="text-center">Welcome to BioImage.IO Chatbot</h3>
if(Object.keys(allAssistants).length > 1){
const assistantButtons = document.getElementById('assistant-buttons');
assistantButtons.innerHTML = Object.values(allAssistants).map((a)=>{
return `<li><a class="dropdown-item" href="?assistant=${a.name}" data-assistant="${a.name}">${a.alias}(${a.name})</a></li>`
// check if server is in query string
const server_url = urlParams.get('server')
// if server is in query string, add it to back to the href
const href = server_url ? `?assistant=${a.name}&server=${server_url}` : `?assistant=${a.name}`;
return `<li><a class="dropdown-item" href="${href}" data-assistant="${a.name}">${a.alias}(${a.name})</a></li>`
}).join("\n")
}
else{
Expand Down

0 comments on commit e5d9103

Please sign in to comment.