Add peek proxy password btn

This commit is contained in:
Cohee 2023-08-14 12:01:06 +03:00
parent 6da3453efc
commit d395d3d8e6
2 changed files with 11 additions and 2 deletions

View File

@ -554,8 +554,9 @@
Will be used as a password for the proxy instead of API key.<br>
</span>
</div>
<div class="wide100p">
<input id="openai_proxy_password" type="password" class="text_pole" placeholder="" maxlength="200" />
<div class="flex-container width100p">
<input id="openai_proxy_password" type="password" class="text_pole flex1" placeholder="" maxlength="200" />
<div id="openai_proxy_password_show" title="Peek a password" class="menu_button fa-solid fa-eye-slash fa-fw"></div>
</div>
</div>
<div class="range-block" data-source="openai,claude">

View File

@ -2792,6 +2792,13 @@ function reconnectOpenAi() {
$('#api_button_openai').trigger('click');
}
function onProxyPasswordShowClick() {
const $input = $('#openai_proxy_password');
const type = $input.attr('type') === 'password' ? 'text' : 'password';
$input.attr('type', type);
$(this).toggleClass('fa-eye-slash fa-eye');
}
$(document).ready(function () {
$('#test_api_button').on('click', testApiConnection);
@ -3029,4 +3036,5 @@ $(document).ready(function () {
$("#openai_logit_bias_export_preset").on("click", onLogitBiasPresetExportClick);
$("#openai_logit_bias_delete_preset").on("click", onLogitBiasPresetDeleteClick);
$("#import_oai_preset").on("click", onImportPresetClick);
$("#openai_proxy_password_show").on("click", onProxyPasswordShowClick);
});