diff --git a/public/index.html b/public/index.html
index 1539f15a9..df054e0da 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1008,7 +1008,10 @@
Get it here: Register
Enter 0000000000 to use anonymous mode.
-
+
+
+
+
For privacy reasons, your API key will hidden after you reload the page.
Model
@@ -1039,7 +1042,10 @@
Enter it in the box below:
-
+
+
+
+
For privacy reasons, your API key will hidden after you reload the page.
@@ -1093,7 +1099,10 @@
Enter it in the box below:
-
+
+
+
+
For privacy reasons, your API key will hidden after you reload the page.
@@ -1130,7 +1139,10 @@
diff --git a/public/scripts/secrets.js b/public/scripts/secrets.js
index 6b0c615fd..41a46a550 100644
--- a/public/scripts/secrets.js
+++ b/public/scripts/secrets.js
@@ -14,6 +14,14 @@ const INPUT_MAP = {
[SECRET_KEYS.NOVEL]: '#api_key_novel',
}
+async function clearSecret() {
+ const key = $(this).data('key');
+ await writeSecret(key, '');
+ secret_state[key] = false;
+ updateSecretDisplay();
+ $(INPUT_MAP[key]).val('');
+}
+
function updateSecretDisplay() {
for (const [secret_key, input_selector] of Object.entries(INPUT_MAP)) {
const validSecret = !!secret_state[secret_key];
@@ -91,4 +99,5 @@ export async function readSecretState() {
jQuery(() => {
$('#viewSecrets').on('click', viewSecrets);
+ $(document).on('click', '.clear-api-key', clearSecret);
});
\ No newline at end of file