mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: report invalid image Additional Parameters JSON instead of leaving Save spinning (#31382)
This commit is contained in:
parent
e924fa7b50
commit
6e3ad226ba
1 changed files with 20 additions and 0 deletions
|
|
@ -176,6 +176,26 @@
|
|||
const saveHandler = async () => {
|
||||
loading = true;
|
||||
|
||||
if (
|
||||
typeof config?.IMAGES_OPENAI_API_PARAMS === 'string' &&
|
||||
config.IMAGES_OPENAI_API_PARAMS.trim() !== '' &&
|
||||
!validateJSON(config.IMAGES_OPENAI_API_PARAMS)
|
||||
) {
|
||||
toast.error($i18n.t('Invalid JSON format for Parameters'));
|
||||
loading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
typeof config?.AUTOMATIC1111_PARAMS === 'string' &&
|
||||
config.AUTOMATIC1111_PARAMS.trim() !== '' &&
|
||||
!validateJSON(config.AUTOMATIC1111_PARAMS)
|
||||
) {
|
||||
toast.error($i18n.t('Invalid JSON format for Parameters'));
|
||||
loading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (config?.COMFYUI_WORKFLOW) {
|
||||
if (!validateJSON(config?.COMFYUI_WORKFLOW)) {
|
||||
toast.error($i18n.t('Invalid JSON format for ComfyUI Workflow.'));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue