mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Replace info popups with toasts
This commit is contained in:
@ -1703,7 +1703,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (main_api == 'textgenerationwebui' && textgenerationwebui_settings.streaming && !textgenerationwebui_settings.streaming_url) {
|
if (main_api == 'textgenerationwebui' && textgenerationwebui_settings.streaming && !textgenerationwebui_settings.streaming_url) {
|
||||||
callPopup('Streaming URL is not set. Look it up in the console window when starting TextGen Web UI', 'text');
|
toastr.error('Streaming URL is not set. Look it up in the console window when starting TextGen Web UI');
|
||||||
is_send_press = false;
|
is_send_press = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2998,11 +2998,6 @@ function extractMessageFromData(data) {
|
|||||||
|
|
||||||
if (main_api == 'textgenerationwebui') {
|
if (main_api == 'textgenerationwebui') {
|
||||||
getMessage = data.results[0].text;
|
getMessage = data.results[0].text;
|
||||||
if (getMessage == null || data.error) {
|
|
||||||
activateSendButtons();
|
|
||||||
callPopup('<h3>Got empty response from Text generation web UI. Try restarting the API with recommended options.</h3>', 'text');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (main_api == 'novel') {
|
if (main_api == 'novel') {
|
||||||
@ -4520,7 +4515,7 @@ function setGenerationProgress(progress) {
|
|||||||
|
|
||||||
function isHordeGenerationNotAllowed() {
|
function isHordeGenerationNotAllowed() {
|
||||||
if (main_api == "kobold" && horde_settings.use_horde && preset_settings == "gui") {
|
if (main_api == "kobold" && horde_settings.use_horde && preset_settings == "gui") {
|
||||||
callPopup('GUI Settings preset is not supported for Horde. Please select another preset.', 'text');
|
toastr.error('GUI Settings preset is not supported for Horde. Please select another preset.');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5587,7 +5582,7 @@ $(document).ready(function () {
|
|||||||
let value = formatKoboldUrl($.trim($("#api_url_text").val()));
|
let value = formatKoboldUrl($.trim($("#api_url_text").val()));
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
callPopup('Please enter a valid URL.', 'text');
|
toastr.error('Please enter a valid URL.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ async function convertSoloToGroupChat() {
|
|||||||
$(`.group_select[grid="${group.id}"]`).click();
|
$(`.group_select[grid="${group.id}"]`).click();
|
||||||
|
|
||||||
await delay(1);
|
await delay(1);
|
||||||
callPopup('The chat has been successfully converted!', 'text');
|
toastr.success('The chat has been successfully converted!');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
@ -414,7 +414,7 @@ async function generatePicture(_, trigger, message, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!modules.includes('sd') && !extension_settings.sd.horde) {
|
if (!modules.includes('sd') && !extension_settings.sd.horde) {
|
||||||
callPopup("Extensions API is not connected or doesn't provide SD module. Enable Stable Horde to generate images.", 'text');
|
toastr.warning("Extensions API is not connected or doesn't provide SD module. Enable Stable Horde to generate images.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ async function generateHordeImage(prompt, callback) {
|
|||||||
const base64Image = `data:image/webp;base64,${data}`;
|
const base64Image = `data:image/webp;base64,${data}`;
|
||||||
callback ? callback(prompt, base64Image) : sendMessage(prompt, base64Image);
|
callback ? callback(prompt, base64Image) : sendMessage(prompt, base64Image);
|
||||||
} else {
|
} else {
|
||||||
callPopup('Image generation has failed. Please try again.', 'text');
|
toastr.error('Image generation has failed. Please try again.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
|||||||
activatedMembers = activateSwipe(group.members);
|
activatedMembers = activateSwipe(group.members);
|
||||||
|
|
||||||
if (activatedMembers.length === 0) {
|
if (activatedMembers.length === 0) {
|
||||||
callPopup('<h3>Deleted group member swiped. To get a reply, add them back to the group.</h3>', 'text');
|
toastr.warning('Deleted group member swiped. To get a reply, add them back to the group.');
|
||||||
throw new Error('Deleted group member swiped');
|
throw new Error('Deleted group member swiped');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -961,7 +961,7 @@ function select_group_chats(groupId, skipAnimation) {
|
|||||||
$("#rm_group_delete").off();
|
$("#rm_group_delete").off();
|
||||||
$("#rm_group_delete").on("click", function () {
|
$("#rm_group_delete").on("click", function () {
|
||||||
if (is_group_generating) {
|
if (is_group_generating) {
|
||||||
callPopup('<h3>Not so fast! Wait for the characters to stop typing before deleting the group.</h3>', 'text');
|
toastr.warning('Not so fast! Wait for the characters to stop typing before deleting the group.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ function validateHordeModel() {
|
|||||||
let selectedModels = models.filter(m => horde_settings.models.includes(m.name));
|
let selectedModels = models.filter(m => horde_settings.models.includes(m.name));
|
||||||
|
|
||||||
if (selectedModels.length === 0) {
|
if (selectedModels.length === 0) {
|
||||||
callPopup('No Horde model selected or the selected models are no longer available. Please choose another model', 'text');
|
toastr.warning('No Horde model selected or the selected models are no longer available. Please choose another model');
|
||||||
throw new Error('No Horde model available');
|
throw new Error('No Horde model available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ function validateReverseProxy() {
|
|||||||
new URL(oai_settings.reverse_proxy);
|
new URL(oai_settings.reverse_proxy);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
callPopup('Entered reverse proxy address is not a valid URL', 'text');
|
toastr.error('Entered reverse proxy address is not a valid URL');
|
||||||
setOnlineStatus('no_connection');
|
setOnlineStatus('no_connection');
|
||||||
resultCheckStatusOpen();
|
resultCheckStatusOpen();
|
||||||
throw err;
|
throw err;
|
||||||
@ -930,7 +930,7 @@ async function showApiKeyUsage() {
|
|||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
callPopup('Invalid API key', 'text');
|
toastr.error('Invalid API key');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -995,7 +995,7 @@ async function createNewLogitBiasPreset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name in oai_settings.bias_presets) {
|
if (name in oai_settings.bias_presets) {
|
||||||
callPopup('Preset name should be unique.', 'text');
|
toastr.error('Preset name should be unique.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1032,12 +1032,12 @@ async function onLogitBiasPresetImportFileChange(e) {
|
|||||||
e.target.value = '';
|
e.target.value = '';
|
||||||
|
|
||||||
if (name in oai_settings.bias_presets) {
|
if (name in oai_settings.bias_presets) {
|
||||||
callPopup('Preset name should be unique.', 'text');
|
toastr.error('Preset name should be unique.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Array.isArray(importedFile)) {
|
if (!Array.isArray(importedFile)) {
|
||||||
callPopup('Invalid logit bias preset file.', 'text');
|
toastr.error('Invalid logit bias preset file.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1341,7 +1341,7 @@ $(document).ready(function () {
|
|||||||
$("#update_oai_preset").on('click', async function () {
|
$("#update_oai_preset").on('click', async function () {
|
||||||
const name = oai_settings.preset_settings_openai;
|
const name = oai_settings.preset_settings_openai;
|
||||||
await saveOpenAIPreset(name, oai_settings);
|
await saveOpenAIPreset(name, oai_settings);
|
||||||
callPopup('Preset updated', 'text');
|
toastr.success('Preset updated');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#main_prompt_restore").on('click', function () {
|
$("#main_prompt_restore").on('click', function () {
|
||||||
|
@ -80,7 +80,7 @@ function setWorldInfoSettings(settings, data) {
|
|||||||
// World Info Editor
|
// World Info Editor
|
||||||
async function showWorldEditor() {
|
async function showWorldEditor() {
|
||||||
if (!world_info) {
|
if (!world_info) {
|
||||||
callPopup("<h3>Select a world info first!</h3>", "text");
|
toastr.warning("Select a world info first!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user