secret.js: update for new popup
| @@ -1,6 +1,7 @@ | |||
| 1 | import { DOMPurify } from '../lib.js'; | 1 | import { DOMPurify } from '../lib.js'; |
| 2 | import { callPopup, getRequestHeaders } from '../script.js'; | 2 | import { getRequestHeaders } from '../script.js'; |
| 3 | import { t } from './i18n.js'; | 3 | import { t } from './i18n.js'; |
| 4 | import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js'; | ||
| 4 | 5 | ||
| 5 | export const SECRET_KEYS = { | 6 | export const SECRET_KEYS = { |
| 6 | HORDE: 'api_key_horde', | 7 | HORDE: 'api_key_horde', |
| @@ -116,7 +117,7 @@ async function viewSecrets() { | |||
| 116 | }); | 117 | }); |
| 117 | 118 | ||
| 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 | } |
| 122 | 123 | ||
| @@ -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 | } |
| 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 | export let secret_state = {}; | 141 | export let secret_state = {}; |