secret.js: update for new popup
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | import { DOMPurify } from '../lib.js'; |
| 2 | 2 | import { callPopup, getRequestHeaders } from '../script.js'; |
| 3 | 3 | import { t } from './i18n.js'; |
| 4 | +import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js'; | |
| 4 | 5 | |
| 5 | 6 | export const SECRET_KEYS = { |
| 6 | 7 | HORDE: 'api_key_horde', |
| @@ -116,7 +117,7 @@ async function viewSecrets() { | ||
| 116 | 117 | }); |
| 117 | 118 | |
| 118 | 119 | if (response.status == 403) { |
| 119 | 120 | callPopup('<h3>' +await Popup.show.text(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 | 121 | return; |
| 121 | 122 | } |
| 122 | 123 | |
| @@ -134,7 +135,7 @@ async function viewSecrets() { | ||
| 134 | 135 | $(table).append(`<tr><td>${DOMPurify.sanitize(key)}</td><td>${DOMPurify.sanitize(value)}</td></tr>`); |
| 135 | 136 | } |
| 136 | 137 | |
| 137 | - callPopup(table.outerHTML, 'text'); | |
| 138 | + await callGenericPopup(table.outerHTML, POPUP_TYPE.TEXT, '', { wide: true, large: true, allowVerticalScrolling: true }); | |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | 141 | export let secret_state = {}; |