the api settings table container is now in the html page. see #102
This commit is contained in:
parent
92fba4a1b3
commit
56362266e2
2 changed files with 7 additions and 31 deletions
|
|
@ -109,6 +109,10 @@
|
|||
</tr>
|
||||
<tr id="api_additional_info" style="display: none;"><!-- API settings additional info -->
|
||||
<td colspan="5" id="api_ui_container">
|
||||
<table style="width: 100%; text-align: left;">
|
||||
<tr id="api_ui_anchor">
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -125,8 +125,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
});
|
||||
});
|
||||
|
||||
i18n.updateDocument();
|
||||
|
||||
const apiSettingsToggle = document.getElementById('api_additional_info_toggle');
|
||||
const apiSettingsRow = document.getElementById('api_additional_info');
|
||||
|
||||
|
|
@ -141,34 +139,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
}
|
||||
});
|
||||
|
||||
const apiTable = document.createElement('table');
|
||||
apiTable.style.width = '100%';
|
||||
apiTable.style.textAlign = 'left';
|
||||
|
||||
const tr = document.createElement('tr');
|
||||
tr.id = 'api_ui_anchor';
|
||||
|
||||
const td1 = document.createElement('td');
|
||||
td1.classList.add('w30');
|
||||
td1.textContent = browser.i18n.getMessage('prefs_Connection_type') + ':';
|
||||
|
||||
const td2 = document.createElement('td');
|
||||
|
||||
const select = document.createElement('select');
|
||||
select.id = 'new_prompt_api_type';
|
||||
select.classList.add('input_new');
|
||||
|
||||
const option = document.createElement('option');
|
||||
option.value = '';
|
||||
option.textContent = '-- ' + browser.i18n.getMessage('Custom') + ' --';
|
||||
select.appendChild(option);
|
||||
|
||||
td2.appendChild(select);
|
||||
tr.appendChild(td1);
|
||||
tr.appendChild(td2);
|
||||
apiTable.appendChild(tr);
|
||||
document.getElementById('api_ui_container').appendChild(apiTable);
|
||||
|
||||
await injectConnectionUI({
|
||||
afterTrId: 'api_ui_anchor',
|
||||
selectId: 'new_prompt_api_type',
|
||||
|
|
@ -176,6 +146,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
taLog: taLog
|
||||
});
|
||||
|
||||
i18n.updateDocument();
|
||||
|
||||
const apiSelect = document.getElementById('new_prompt_api_type');
|
||||
// Remove chatgpt_web
|
||||
// for (let i = 0; i < apiSelect.options.length; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue