Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions ui/src/views/model/component/CreateModelDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@
<el-empty
v-else-if="
base_form_data.model_type === 'RERANKER' ||
base_form_data.model_type === 'EMBEDDING' ||
base_form_data.model_type === 'STT'
base_form_data.model_type === 'EMBEDDING'
"
:description="$t('views.model.tip.emptyMessage2')"
/>
Expand All @@ -149,14 +148,7 @@
<el-button
type="text"
@click.stop="openAddDrawer()"
:disabled="
base_form_data.model_type !== 'TTS' &&
base_form_data.model_type !== 'LLM' &&
base_form_data.model_type !== 'IMAGE' &&
base_form_data.model_type !== 'TTI' &&
base_form_data.model_type !== 'TTV' &&
base_form_data.model_type !== 'ITV'
"
:disabled="!['TTS', 'LLM', 'IMAGE', 'TTI', 'TTV', 'ITV','STT'].includes(base_form_data.model_type)"
>
<AppIcon iconName="app-add-outlined" class="mr-4"/> {{ $t('common.add') }}
</el-button>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/workflow/nodes/intent-classify-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
prop="content_list"
:label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
:rules="{
required: true,
message: $t('views.applicationWorkflow.nodes.textToSpeechNode.content.label'),
trigger: 'change',
required: true,
}"
>
<template #label>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're trying to define a validation rule for an input field within a Vue component. However, there seems to be an issue with the order and structure of the rules:

<el-form-item
  prop="content_list"
  :label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
  :rules="{
    required: true,
    message: $t('views.applicationWorkflow.nodes.textToSpeechNode.content.label'),
    trigger: 'change'
  }"
>

The required property is repeated twice, which can lead to unexpected behavior. If you want both conditions (message and required) to apply, you should only include one instance of the required property or use separate properties if necessary.

Additionally, ensure that $t('views.applicationWorkflow.nodes.intentNode.input.label') returns the correct text label and that $t('views.applicationWorkflow.nodes.textToSpeechNode.content.label') correctly retrieves the error message. Here's a corrected version:

<el-form-item
  prop="content_list"
  :label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
  :rules="[
    { required: true, message: $t('views.applicationWorkflow.nodes.textToSpeechNode.content.label'), trigger: 'change' }
  ]"
>

This way, the form item will require an entry and display a custom error message when it fails validation.

Expand Down
Loading