Horde trusted checkbox and disclaimer

This commit is contained in:
SillyLossy
2023-05-26 18:54:46 +03:00
parent 4725b2bf25
commit e576eca4d6
3 changed files with 23 additions and 2 deletions

View File

@ -25,6 +25,7 @@ let horde_settings = {
models: [],
auto_adjust_response_length: true,
auto_adjust_context_length: false,
trusted_workers_only: false,
};
const MAX_RETRIES = 100;
@ -100,7 +101,7 @@ async function generateHorde(prompt, params, signal) {
const payload = {
"prompt": prompt,
"params": params,
//"trusted_workers": false,
"trusted_workers": horde_settings.trusted_workers_only,
//"slow_workers": false,
"models": horde_settings.models,
};
@ -198,6 +199,7 @@ function loadHordeSettings(settings) {
$('#horde_auto_adjust_response_length').prop("checked", horde_settings.auto_adjust_response_length);
$('#horde_auto_adjust_context_length').prop("checked", horde_settings.auto_adjust_context_length);
$("#horde_trusted_workers_only").prop("checked", horde_settings.trusted_workers_only);
}
async function showKudos() {
@ -251,6 +253,11 @@ jQuery(function () {
saveSettingsDebounced();
});
$("#horde_trusted_workers_only").on("input", function () {
horde_settings.trusted_workers_only = !!$(this).prop("checked");
saveSettingsDebounced();
})
$("#horde_api_key").on("input", async function () {
const key = $(this).val().trim();
await writeSecret(SECRET_KEYS.HORDE, key);