Skip to content

Commit ad697d7

Browse files
authored
Merge branch 'v2' into pr@v2@fix_knowledge_workflow
2 parents 90ad8b1 + fb2c1b0 commit ad697d7

File tree

17 files changed

+110
-14
lines changed

17 files changed

+110
-14
lines changed

apps/application/flow/step_node/data_source_web_node/impl/base_data_source_web_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020

2121
class BaseDataSourceWebNodeForm(BaseForm):
22-
source_url = forms.TextInputField('source url', required=True)
23-
selector = forms.TextInputField('knowledge selector', required=False,default_value="body")
22+
source_url = forms.TextInputField(_('Web source url'), required=True)
23+
selector = forms.TextInputField(_('Web knowledge selector'), required=False,attrs={'placeholder': _('The default is body, you can enter .classname/#idname/tagname')})
2424

2525

2626
def get_collect_handler():

apps/common/utils/split_model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,9 @@ def smart_split_paragraph(content: str, limit: int):
300300

301301
# 优先级:句号 > 感叹号/问号 > 回车
302302
split_chars = [
303-
('。', 0), ('!', 0), ('?', 0), # 句子结束符,包含在当前段
304-
('\n', 0), # 回车符
303+
('。', 0), ('.', 0), # 中英文句号
304+
('!', 0), ('!', 0), # 中英文感叹号
305+
('?', 0), ('?', 0), # 中英文问号
305306
]
306307

307308
# 从后往前找分割点

apps/common/utils/tool_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def get_tool_mcp_config(self, code, params):
210210
'-c',
211211
f'import base64,gzip; exec(gzip.decompress(base64.b64decode(\'{compressed_and_base64_encoded_code_str}\')).decode())',
212212
],
213+
'cwd': self.sandbox_path,
213214
'env': {
214215
'LD_PRELOAD': self.sandbox_so_path,
215216
},

apps/knowledge/views/knowledge_workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class KnowledgeWorkflowActionView(APIView):
7373
tags=[_('Knowledge Base')] # type: ignore
7474
)
7575
@has_permissions(
76-
PermissionConstants.KNOWLEDGE_READ.get_workspace_knowledge_permission(),
77-
PermissionConstants.KNOWLEDGE_READ.get_workspace_permission_workspace_manage_role(),
76+
PermissionConstants.KNOWLEDGE_DOCUMENT_CREATE.get_workspace_knowledge_permission(),
77+
PermissionConstants.KNOWLEDGE_DOCUMENT_CREATE.get_workspace_permission_workspace_manage_role(),
7878
RoleConstants.WORKSPACE_MANAGE.get_workspace_role(),
7979
ViewPermission(
8080
[RoleConstants.USER.get_workspace_role()],
@@ -148,8 +148,8 @@ class Publish(APIView):
148148
responses=DefaultResultSerializer,
149149
tags=[_('Knowledge')] # type: ignore
150150
)
151-
@has_permissions(PermissionConstants.KNOWLEDGE_EDIT.get_workspace_knowledge_permission(),
152-
PermissionConstants.KNOWLEDGE_EDIT.get_workspace_permission_workspace_manage_role(),
151+
@has_permissions(PermissionConstants.KNOWLEDGE_WORKFLOW_EDIT.get_workspace_knowledge_permission(),
152+
PermissionConstants.KNOWLEDGE_WORKFLOW_EDIT.get_workspace_permission_workspace_manage_role(),
153153
ViewPermission([RoleConstants.USER.get_workspace_role()],
154154
[PermissionConstants.KNOWLEDGE.get_workspace_knowledge_permission()],
155155
CompareConstants.AND),

apps/locales/en_US/LC_MESSAGES/django.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8784,4 +8784,13 @@ msgid "SAML2 SSO"
87848784
msgstr ""
87858785

87868786
msgid "Workflow"
8787+
msgstr ""
8788+
8789+
msgid "Web source url"
8790+
msgstr ""
8791+
8792+
msgid "Web knowledge selector"
8793+
msgstr ""
8794+
8795+
msgid "The default is body, you can enter .classname/#idname/tagname"
87878796
msgstr ""

apps/locales/zh_CN/LC_MESSAGES/django.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8911,3 +8911,12 @@ msgstr "SAML2 单点登录"
89118911

89128912
msgid "Workflow"
89138913
msgstr "工作流"
8914+
8915+
msgid "Web source url"
8916+
msgstr "Web 根地址"
8917+
8918+
msgid "Web knowledge selector"
8919+
msgstr "选择器"
8920+
8921+
msgid "The default is body, you can enter .classname/#idname/tagname"
8922+
msgstr "默认为 body,可输入 .classname/#idname/tagname"

apps/locales/zh_Hant/LC_MESSAGES/django.po

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8910,4 +8910,13 @@ msgid "SAML2 SSO"
89108910
msgstr "SAML2 單點登入"
89118911

89128912
msgid "Workflow"
8913-
msgstr "工作流"
8913+
msgstr "工作流"
8914+
8915+
msgid "Web source url"
8916+
msgstr "Web 根地址"
8917+
8918+
msgid "Web knowledge selector"
8919+
msgstr "選擇器"
8920+
8921+
msgid "The default is body, you can enter .classname/#idname/tagname"
8922+
msgstr "默認為 body,可輸入 .classname/#idname/tagname"

ui/src/components/app-icon/icons/document.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,29 @@ export default {
9696
])
9797
},
9898
},
99+
'app-import-doc': {
100+
iconReader: () => {
101+
return h('i', [
102+
h(
103+
'svg',
104+
{
105+
style: { height: '100%', width: '100%' },
106+
viewBox: '0 0 1024 1024',
107+
version: '1.1',
108+
xmlns: 'http://www.w3.org/2000/svg',
109+
},
110+
[
111+
h('path', {
112+
d: 'M128 935.594667A45.653333 45.653333 0 0 0 173.482667 981.333333h338.346666v-85.76H213.248V128H810.24v426.666667h85.333333V87.978667A45.653333 45.653333 0 0 0 850.005333 42.24H173.482667A45.653333 45.653333 0 0 0 128 87.978667v847.616z',
113+
fill: 'currentColor',
114+
}),
115+
h('path', {
116+
d: 'M298.922667 480.768c0-6.314667 5.12-11.434667 11.392-11.434667h403.626666c6.314667 0 11.392 5.12 11.392 11.434667v62.890667c0 6.314667-5.12 11.434667-11.392 11.434666h-403.626666a11.392 11.392 0 0 1-11.392-11.434666v-62.890667zM310.4 298.666667a11.392 11.392 0 0 0-11.392 11.434666v62.890667c0 6.314667 5.12 11.434667 11.392 11.434667h190.208c6.314667 0 11.392-5.12 11.392-11.434667V310.101333A11.392 11.392 0 0 0 500.608 298.666667H310.4zM725.333333 661.333333a21.333333 21.333333 0 0 1 21.333334-21.333333h42.666666a21.333333 21.333333 0 0 1 21.333334 21.333333V768h106.666666a21.333333 21.333333 0 0 1 21.333334 21.333333v42.666667a21.333333 21.333333 0 0 1-21.333334 21.333333H810.666667v106.666667a21.333333 21.333333 0 0 1-21.333334 21.333333h-42.666666a21.333333 21.333333 0 0 1-21.333334-21.333333V853.333333h-106.666666a21.333333 21.333333 0 0 1-21.333334-21.333333v-42.666667a21.333333 21.333333 0 0 1 21.333334-21.333333H725.333333v-106.666667z',
117+
fill: 'currentColor',
118+
}),
119+
],
120+
),
121+
])
122+
},
123+
},
99124
}

ui/src/locales/lang/en-US/views/application.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
'The Community Edition supports up to 5 APP. If you need more APP, please upgrade to the Professional Edition.',
2727
saveErrorMessage: 'Saving failed, please check your input or try again later',
2828
loadingErrorMessage: 'Failed to load configuration, please check your input or try again later',
29+
noDocPermission: 'No permission to create documents',
2930
},
3031

3132
form: {

ui/src/locales/lang/zh-CN/views/application.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
professionalMessage: '社区版最多支持 5 个应用,如需拥有更多应用,请升级为专业版。',
2727
saveErrorMessage: '保存失败,请检查输入或稍后再试',
2828
loadingErrorMessage: '加载配置失败,请检查输入或稍后再试',
29+
noDocPermission: '无文档创建权限',
2930
},
3031
form: {
3132
appName: {

0 commit comments

Comments
 (0)