From 134ade0951f2cc8dc2d4235b24923a0af9860074 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 2 Jun 2025 23:49:56 +0300 Subject: [PATCH] secret.js: update for new popup --- public/scripts/secrets.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/scripts/secrets.js b/public/scripts/secrets.js index 279a28351..861a5daac 100644 --- a/public/scripts/secrets.js +++ b/public/scripts/secrets.js @@ -1,6 +1,7 @@ import { DOMPurify } from '../lib.js'; -import { callPopup, getRequestHeaders } from '../script.js'; +import { getRequestHeaders } from '../script.js'; import { t } from './i18n.js'; +import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js'; export const SECRET_KEYS = { HORDE: 'api_key_horde', @@ -116,7 +117,7 @@ async function viewSecrets() { }); if (response.status == 403) { - callPopup('

' + t`Forbidden` + '

' + t`To view your API keys here, set the value of allowKeysExposure to true in config.yaml file and restart the SillyTavern server.` + '

', 'text'); + await Popup.show.text(t`Forbidden`, t`To view your API keys here, set the value of allowKeysExposure to true in config.yaml file and restart the SillyTavern server.`); return; } @@ -134,7 +135,7 @@ async function viewSecrets() { $(table).append(`${DOMPurify.sanitize(key)}${DOMPurify.sanitize(value)}`); } - callPopup(table.outerHTML, 'text'); + await callGenericPopup(table.outerHTML, POPUP_TYPE.TEXT, '', { wide: true, large: true, allowVerticalScrolling: true }); } export let secret_state = {};