diff --git a/public/index.html b/public/index.html index 21f0c25de..f148be6c9 100644 --- a/public/index.html +++ b/public/index.html @@ -1005,10 +1005,11 @@ Adjust response length to worker capabilities

API key

-
Get it here: Register +
Get it here: Register
+ Enter 0000000000 to use anonymous mode.
-
Your API key will removed from here after you click "Connect" for privacy reasons.
+
Your API key will removed from here after you reload the page for privacy reasons.

Model
diff --git a/public/scripts/horde.js b/public/scripts/horde.js index 9e6e57a6e..13dfa71fb 100644 --- a/public/scripts/horde.js +++ b/public/scripts/horde.js @@ -1,4 +1,5 @@ import { saveSettingsDebounced, changeMainAPI, callPopup, setGenerationProgress, CLIENT_VERSION, getRequestHeaders } from "../script.js"; +import { SECRET_KEYS, writeSecret } from "./secrets.js"; import { delay } from "./utils.js"; export { @@ -217,5 +218,10 @@ jQuery(function () { saveSettingsDebounced(); }); + $("#horde_api_key").on("input", async function () { + const key = $(this).val().trim(); + await writeSecret(SECRET_KEYS.HORDE, key); + }); + $("#horde_refresh").on("click", getHordeModels); }) \ No newline at end of file diff --git a/public/scripts/secrets.js b/public/scripts/secrets.js index 65096e2ca..0998ceadc 100644 --- a/public/scripts/secrets.js +++ b/public/scripts/secrets.js @@ -18,7 +18,12 @@ function updateSecretDisplay() { for (const [secret_key, input_selector] of Object.entries(INPUT_MAP)) { const validSecret = !!secret_state[secret_key]; const placeholder = validSecret ? '✔️ Key saved' : '❌ Missing key'; - $(input_selector).attr('placeholder', placeholder).val(''); + $(input_selector).attr('placeholder', placeholder); + + // Horde doesn't have a connect button + if (secret_key !== SECRET_KEYS.HORDE) { + $(input_selector).val(''); + } } }