Skip to content

Commit db0b2dc

Browse files
Merge remote-tracking branch 'upstream/v2' into PR/fix-6
2 parents c478c93 + 55d1590 commit db0b2dc

14 files changed

Lines changed: 177 additions & 162 deletions

File tree

apps/application/flow/compare/regex_compare.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
from .compare import Compare
1212
from common.cache.mem_cache import MemCache
1313

14-
1514
match_cache = MemCache('regex', {
16-
'TIMEOUT': 3600, # 缓存有效期为 1 小时
15+
'TIMEOUT': 3600, # 缓存有效期为 1 小时
1716
'OPTIONS': {
18-
'MAX_ENTRIES': 500, # 最多缓存 500 个条目
19-
'CULL_FREQUENCY': 10, # 达到上限时,删除约 1/10 的缓存
17+
'MAX_ENTRIES': 500, # 最多缓存 500 个条目
18+
'CULL_FREQUENCY': 10, # 达到上限时,删除约 1/10 的缓存
2019
},
2120
})
2221

2322

2423
def compile_and_cache(regex):
2524
match = match_cache.get(regex)
2625
if not match:
27-
match = re.compile(regex).match
26+
match = re.compile(regex).fullmatch
2827
match_cache.set(regex, match)
2928
return match
3029

30+
3131
class RegexCompare(Compare):
3232

3333
def compare(self, source_value, compare, target_value):

apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def execute(self, model_id, system, prompt, dialogue_number, history_chat_record
224224
)
225225
if mcp_result:
226226
return mcp_result
227-
227+
message_list = [SystemMessage(system)] + message_list
228228
if stream:
229229
r = chat_model.stream(message_list)
230230
return NodeResult({'result': r, 'chat_model': chat_model, 'message_list': message_list,

apps/locales/en_US/LC_MESSAGES/django.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9249,4 +9249,7 @@ msgid "The label field is required for the {index}th item in model_params_form"
92499249
msgstr ""
92509250

92519251
msgid "Publish"
9252+
msgstr ""
9253+
9254+
msgid "token is required for EVENT triggers"
92529255
msgstr ""

apps/locales/zh_CN/LC_MESSAGES/django.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9372,4 +9372,7 @@ msgid "The label field is required for the {index}th item in model_params_form"
93729372
msgstr "model_params_form 中的第 {index} 项的 label 字段是必填项"
93739373

93749374
msgid "Publish"
9375-
msgstr "发布"
9375+
msgstr "发布"
9376+
9377+
msgid "token is required for EVENT triggers"
9378+
msgstr "事件触发器必须设置 token"

apps/locales/zh_Hant/LC_MESSAGES/django.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9369,4 +9369,7 @@ msgid "The label field is required for the {index}th item in model_params_form"
93699369
msgstr "model_params_form 中的第 {index} 项的 label 字段是必填项"
93709370

93719371
msgid "Publish"
9372-
msgstr "發布"
9372+
msgstr "發布"
9373+
9374+
msgid "token is required for EVENT triggers"
9375+
msgstr "事件觸發器必須設定 token"

apps/trigger/handler/impl/trigger/event_trigger.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ class EventTrigger(BaseTrigger):
117117
@staticmethod
118118
def execute(trigger, request=None, **kwargs):
119119
trigger_setting = trigger.get('trigger_setting')
120-
if trigger_setting.get('token'):
121-
token = request.META.get('HTTP_AUTHORIZATION')
122-
if not token or trigger_setting.get('token') != token.replace('Bearer ', ''):
123-
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
120+
token = trigger_setting.get('token')
121+
if not token:
122+
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
123+
request_token = request.META.get('HTTP_AUTHORIZATION')
124+
if not request_token or token != request_token.replace('Bearer ', ''):
125+
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
124126
is_active = trigger.get('is_active')
125127
if not is_active:
126128
return Result(code=404, message="404", response_status=404)

apps/trigger/serializers/trigger.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ def _validate_event_setting(setting):
243243
raise serializers.ValidationError({
244244
'trigger_setting': _('body must be an array')
245245
})
246+
if not setting.get('token'):
247+
raise serializers.ValidationError({
248+
'trigger_setting': _('token is required for EVENT triggers')
249+
})
246250

247251

248252
class TriggerTaskCreateRequest(serializers.Serializer):

ui/src/components/dynamics-form/constructor/items/JsonInputConstructor.vue

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@
88

99
<el-row style="width: 100%" :gutter="10">
1010
<el-radio-group v-model="formValue.default_value_assignment_method">
11-
<el-radio :value="item.value" size="large" v-for="(item,index) in assignment_method_option_list" :key="index"
12-
>{{ item.label }}
13-
<el-popover
14-
width="300px"
15-
v-if="item.value == 'ref_variables'"
16-
class="box-item"
17-
placement="top-start"
18-
:persistent="false"
19-
>
20-
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover') }}:
21-
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.json_format') }}
11+
<el-radio
12+
:value="item.value"
13+
size="large"
14+
v-for="(item, index) in assignment_method_option_list"
15+
:key="index"
16+
>
17+
<span class="flex align-center">
18+
{{ item.label }}
2219

23-
<template #reference>
24-
<el-icon><InfoFilled /></el-icon>
25-
</template>
26-
</el-popover>
20+
<el-tooltip effect="dark" placement="right" v-if="item.value == 'ref_variables'">
21+
<template #content>
22+
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover') }}:
23+
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.json_format') }}
24+
</template>
25+
<AppIcon iconName="app-warning" class="app-warning-icon ml-4"></AppIcon>
26+
</el-tooltip>
27+
</span>
2728
</el-radio>
2829
</el-radio-group>
2930
</el-row>
@@ -137,9 +138,7 @@ const default_ref_variables_value_rule = {
137138
required: true,
138139
validator: (rule: any, value: any, callback: any) => {
139140
if (!(Array.isArray(value) && value.length > 1)) {
140-
callback(
141-
t('workflow.variable.Referencing') + t('common.required'),
142-
)
141+
callback(t('workflow.variable.Referencing') + t('common.required'))
143142
}
144143
145144
return true

ui/src/components/dynamics-form/constructor/items/MultiRowConstructor.vue

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,34 @@
88

99
<el-row style="width: 100%" :gutter="10">
1010
<el-radio-group @change="formValue.option_list = []" v-model="formValue.assignment_method">
11-
<el-radio :value="item.value" size="large" v-for="(item,index) in assignment_method_option_list" :key="index"
12-
>{{ item.label }}
13-
<el-popover
14-
width="300px"
15-
v-if="item.value == 'ref_variables'"
16-
class="box-item"
17-
placement="top-start"
18-
:persistent="false"
19-
>
20-
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover') }}:<br />
21-
[<br />
22-
{<br />
23-
"label": "xx",<br />
24-
"value": "xx",<br />
25-
"default": false<br />
26-
}<br />
27-
]<br />
28-
label: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_label') }}
29-
{{ $t('common.required') }}<br />
30-
value: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_value') }}
31-
{{ $t('common.required') }}<br />
32-
default:{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_default') }}
33-
<template #reference>
34-
<el-icon><InfoFilled /></el-icon>
35-
</template>
36-
</el-popover>
11+
<el-radio
12+
:value="item.value"
13+
size="large"
14+
v-for="(item, index) in assignment_method_option_list"
15+
:key="index"
16+
>
17+
<span class="flex align-center">
18+
{{ item.label }}
19+
20+
<el-tooltip effect="dark" placement="right" v-if="item.value == 'ref_variables'">
21+
<template #content>
22+
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover') }}:<br />
23+
[<br />
24+
{<br />
25+
"label": "xx",<br />
26+
"value": "xx",<br />
27+
"default": false<br />
28+
}<br />
29+
]<br />
30+
label: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_label') }}
31+
{{ $t('common.required') }}<br />
32+
value: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_value') }}
33+
{{ $t('common.required') }}<br />
34+
default:{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_default') }}
35+
</template>
36+
<AppIcon iconName="app-warning" class="app-warning-icon ml-4"></AppIcon>
37+
</el-tooltip>
38+
</span>
3739
</el-radio>
3840
</el-radio-group>
3941
</el-row>

ui/src/components/dynamics-form/constructor/items/MultiSelectConstructor.vue

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,29 @@
1313
size="large"
1414
v-for="(item, index) in assignment_method_option_list"
1515
:key="index"
16-
>{{ item.label }}
17-
<el-popover
18-
width="300px"
19-
v-if="item.value == 'ref_variables'"
20-
class="box-item"
21-
placement="top-start"
22-
:persistent="false"
23-
>
24-
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover') }}:<br />
25-
[<br />
26-
{<br />
27-
"label": "xx",<br />
28-
"value": "xx",<br />
29-
"default": false<br />
30-
}<br />
31-
]<br />
32-
label: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_label') }}
33-
{{ $t('common.required') }}<br />
34-
value: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_value') }}
35-
{{ $t('common.required') }}<br />
36-
default: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_default') }}
37-
<template #reference>
38-
<el-icon><InfoFilled /></el-icon>
39-
</template>
40-
</el-popover>
16+
>
17+
<span class="flex align-center">
18+
{{ item.label }}
19+
20+
<el-tooltip effect="dark" placement="right" v-if="item.value == 'ref_variables'">
21+
<template #content>
22+
{{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover') }}:<br />
23+
[<br />
24+
{<br />
25+
"label": "xx",<br />
26+
"value": "xx",<br />
27+
"default": false<br />
28+
}<br />
29+
]<br />
30+
label: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_label') }}
31+
{{ $t('common.required') }}<br />
32+
value: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_value') }}
33+
{{ $t('common.required') }}<br />
34+
default: {{ $t('dynamicsForm.AssignmentMethod.ref_variables.popover_default') }}
35+
</template>
36+
<AppIcon iconName="app-warning" class="app-warning-icon ml-4"></AppIcon>
37+
</el-tooltip>
38+
</span>
4139
</el-radio>
4240
</el-radio-group>
4341
</el-row>

0 commit comments

Comments
 (0)