secret.js: update for new popup

134ade0951f2cc8dc2d4235b24923a0af9860074

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -3Ignore whitespace
public/scripts/secrets.js+4 -3
@@ -1,6 +1,7 @@
1import { DOMPurify } from '../lib.js';1import { DOMPurify } from '../lib.js';
2import { callPopup, getRequestHeaders } from '../script.js';2import { getRequestHeaders } from '../script.js';
3import { t } from './i18n.js';3import { t } from './i18n.js';
4import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js';
45
5export const SECRET_KEYS = {6export const SECRET_KEYS = {
6 HORDE: 'api_key_horde',7 HORDE: 'api_key_horde',
@@ -116,7 +117,7 @@ async function viewSecrets() {
116 });117 });
117118
118 if (response.status == 403) {119 if (response.status == 403) {
119 callPopup('<h3>' + t`Forbidden` + '</h3><p>' + t`To view your API keys here, set the value of allowKeysExposure to true in config.yaml file and restart the SillyTavern server.` + '</p>', 'text');120 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.`);
120 return;121 return;
121 }122 }
122123
@@ -134,7 +135,7 @@ async function viewSecrets() {
134 $(table).append(`<tr><td>${DOMPurify.sanitize(key)}</td><td>${DOMPurify.sanitize(value)}</td></tr>`);135 $(table).append(`<tr><td>${DOMPurify.sanitize(key)}</td><td>${DOMPurify.sanitize(value)}</td></tr>`);
135 }136 }
136137
137 callPopup(table.outerHTML, 'text');138 await callGenericPopup(table.outerHTML, POPUP_TYPE.TEXT, '', { wide: true, large: true, allowVerticalScrolling: true });
138}139}
139140
140export let secret_state = {};141export let secret_state = {};