diff --git a/ui/package.json b/ui/package.json index 3e1582bae..0e7449a67 100644 --- a/ui/package.json +++ b/ui/package.json @@ -63,7 +63,7 @@ "jsdom": "^22.1.0", "npm-run-all": "^4.1.5", "prettier": "^3.0.0", - "sass": "^1.66.1", + "sass": "1.66.1", "typescript": "~5.1.6", "unplugin-vue-define-options": "^1.3.18", "vite": "^4.4.9", diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index 52cc85ac2..fb2331743 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -19,6 +19,7 @@ import InfiniteScroll from './infinite-scroll/index.vue' import AutoTooltip from './auto-tooltip/index.vue' import MdEditor from './markdown/MdEditor.vue' import MdPreview from './markdown/MdPreview.vue' +import MdEditorMagnify from './markdown/MdEditorMagnify.vue' import LogoFull from './logo/LogoFull.vue' import LogoIcon from './logo/LogoIcon.vue' import SendIcon from './logo/SendIcon.vue' @@ -50,5 +51,6 @@ export default { app.component(LogoIcon.name, LogoIcon) app.component(SendIcon.name, SendIcon) app.component(CodemirrorEditor.name, CodemirrorEditor) + app.component(MdEditorMagnify.name, MdEditorMagnify) } } diff --git a/ui/src/components/markdown/MdEditorMagnify.vue b/ui/src/components/markdown/MdEditorMagnify.vue new file mode 100644 index 000000000..cf12d42dc --- /dev/null +++ b/ui/src/components/markdown/MdEditorMagnify.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue index ad950feb9..89f00f200 100644 --- a/ui/src/views/application/ApplicationSetting.vue +++ b/ui/src/views/application/ApplicationSetting.vue @@ -149,11 +149,11 @@ - @@ -177,11 +177,12 @@ - @@ -281,21 +282,22 @@ - - @@ -618,6 +620,19 @@ const sttModelOptions = ref(null) const ttsModelOptions = ref(null) const showEditIcon = ref(false) +function submitPrologueDialog(val: string) { + applicationForm.value.prologue = val +} +function submitPromptDialog(val: string) { + applicationForm.value.model_setting.prompt = val +} +function submitNoReferencesPromptDialog(val: string) { + applicationForm.value.model_setting.no_references_prompt = val +} +function submitSystemDialog(val: string) { + applicationForm.value.model_setting.system = val +} + const submit = async (formEl: FormInstance | undefined) => { if (!formEl) return await formEl.validate((valid, fields) => { diff --git a/ui/src/workflow/nodes/ai-chat-node/index.vue b/ui/src/workflow/nodes/ai-chat-node/index.vue index f3791adbc..df7b619bd 100644 --- a/ui/src/workflow/nodes/ai-chat-node/index.vue +++ b/ui/src/workflow/nodes/ai-chat-node/index.vue @@ -130,21 +130,13 @@ - - - + style="height: 150px" + @submitDialog="submitDialog" + /> - - - - - + { return true } } -const dialogVisible = ref(false) -const cloneContent = ref('') -const footers: any = [null, '=', 0] -function openDialog() { - cloneContent.value = chat_data.value.prompt - dialogVisible.value = true +function submitDialog(val: string) { + set(props.nodeModel.properties.node_data, 'prompt', val) } -function submitDialog() { - set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value) - dialogVisible.value = false -} const model_change = (model_id?: string) => { if (model_id) { AIModeParamSettingDialogRef.value?.reset_default(model_id, id) @@ -334,10 +310,4 @@ onMounted(() => { set(props.nodeModel, 'validate', validate) }) - + diff --git a/ui/src/workflow/nodes/base-node/index.vue b/ui/src/workflow/nodes/base-node/index.vue index f0d7ddb17..3ba38ff36 100644 --- a/ui/src/workflow/nodes/base-node/index.vue +++ b/ui/src/workflow/nodes/base-node/index.vue @@ -37,21 +37,13 @@ /> - - - + style="height: 150px" + @submitDialog="submitDialog" + />
全局变量
@@ -248,68 +240,11 @@ -
- 全局变量 - - 添加 - -
- - - - - - - - - - - - - - - - - - - - - - + diff --git a/ui/src/workflow/nodes/question-node/index.vue b/ui/src/workflow/nodes/question-node/index.vue index 60eba1bb6..032f56c35 100644 --- a/ui/src/workflow/nodes/question-node/index.vue +++ b/ui/src/workflow/nodes/question-node/index.vue @@ -128,21 +128,13 @@
- - - + style="height: 150px" + @submitDialog="submitDialog" + /> - - - - - + { return true } } -const dialogVisible = ref(false) -const cloneContent = ref('') -const footers: any = [null, '=', 0] -function openDialog() { - cloneContent.value = form_data.value.prompt - dialogVisible.value = true -} + const model_change = (model_id?: string) => { if (model_id) { AIModeParamSettingDialogRef.value?.reset_default(model_id, id) @@ -232,9 +210,8 @@ const model_change = (model_id?: string) => { refreshParam({}) } } -function submitDialog() { - set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value) - dialogVisible.value = false +function submitDialog(val: string) { + set(props.nodeModel.properties.node_data, 'prompt', val) } const { params: { id } @@ -324,10 +301,4 @@ onMounted(() => { set(props.nodeModel, 'validate', validate) }) - + diff --git a/ui/src/workflow/nodes/reply-node/index.vue b/ui/src/workflow/nodes/reply-node/index.vue index 344d7d441..ae04d151a 100644 --- a/ui/src/workflow/nodes/reply-node/index.vue +++ b/ui/src/workflow/nodes/reply-node/index.vue @@ -24,22 +24,15 @@ - - - + style="height: 150px" + @submitDialog="submitDialog" + /> - - - - - - +