disabling btn fetch models and selected models if apikey is empty. see #92
This commit is contained in:
parent
93afbb2490
commit
7eeb50b5b6
1 changed files with 7 additions and 0 deletions
|
|
@ -108,10 +108,17 @@ function showConnectionOptions() {
|
||||||
|
|
||||||
function warnAPIKeyEmpty() {
|
function warnAPIKeyEmpty() {
|
||||||
let apiKeyInput = document.getElementById('api_key_chatgpt');
|
let apiKeyInput = document.getElementById('api_key_chatgpt');
|
||||||
|
let btnFetchModels = document.getElementById('btnUpdateChatGPTModels');
|
||||||
|
let modelChatGPT = document.getElementById('model_chatgpt');
|
||||||
if(apiKeyInput.value === ''){
|
if(apiKeyInput.value === ''){
|
||||||
apiKeyInput.style.border = '2px solid red';
|
apiKeyInput.style.border = '2px solid red';
|
||||||
|
btnFetchModels.disabled = true;
|
||||||
|
modelChatGPT.disabled = true;
|
||||||
|
modelChatGPT.selectedIndex = -1;
|
||||||
}else{
|
}else{
|
||||||
apiKeyInput.style.border = 'none';
|
apiKeyInput.style.border = 'none';
|
||||||
|
btnFetchModels.disabled = false;
|
||||||
|
modelChatGPT.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue