Skip to content

Commit

Permalink
Update mask.js
Browse files Browse the repository at this point in the history
Refactoring ability to set custom values.
- Stores them in localstore if set.
- cleans them if checkbox is unset
- add button to reset localstore
  • Loading branch information
robbizbal committed Nov 13, 2024
1 parent b216f08 commit f85e97a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/static/scripts/mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ document.getElementById('LLMcustom').addEventListener('change', function() {
const llmUrl = localStorage.getItem('LLMURL');
const llmModel = localStorage.getItem('LLMMODEL');

// Set the input fields if values exist
if (llmUrl) {
document.getElementById('inputLLMurl').value = llmUrl;
}
if (llmModel) {
document.getElementById('inputLLMmodel').value = llmModel;
if (this.checked === true) {
if (llmUrl) {
document.getElementById('inputLLMurl').value = llmUrl;
}
if (llmModel) {
document.getElementById('inputLLMmodel').value = llmModel;
}
} else {
document.getElementById('inputLLMurl').value = "";
document.getElementById('inputLLMmodel').value = "";
}
});

Expand Down

0 comments on commit f85e97a

Please sign in to comment.