Skip to content
Merged
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
2 changes: 2 additions & 0 deletions ui/src/locales/lang/en-US/views/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default {
saveErrorMessage: 'Saving failed, please check your input or try again later',
loadingErrorMessage: 'Failed to load configuration, please check your input or try again later',
noDocPermission: 'No permission to create documents',
confirmUse: 'Are you sure you want to use',
overwrite: 'overwrite the current workflow',
},

form: {
Expand Down
2 changes: 2 additions & 0 deletions ui/src/locales/lang/zh-CN/views/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default {
saveErrorMessage: '保存失败,请检查输入或稍后再试',
loadingErrorMessage: '加载配置失败,请检查输入或稍后再试',
noDocPermission: '无文档创建权限',
confirmUse: '确定使用',
overwrite: '覆盖当前工作流',
},
form: {
appName: {
Expand Down
2 changes: 2 additions & 0 deletions ui/src/locales/lang/zh-Hant/views/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default {
saveErrorMessage: '儲存失敗,請檢查輸入或稍後再試',
loadingErrorMessage: '載入配置失敗,請檢查輸入或稍後再試',
noDocPermission: '無文檔創建權限',
confirmUse: '確定使用',
overwrite: '覆蓋當前工作流',
},
form: {
appName: {
Expand Down
37 changes: 25 additions & 12 deletions ui/src/views/knowledge-workflow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,22 +394,35 @@ const elUploadRef = ref()
const importKnowledgeWorkflow = (file: any) => {
const formData = new FormData()
formData.append('file', file.raw)
const name = file.name.replace('.kbwf', '')
elUploadRef.value.clearFiles()
loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value })
.importKnowledgeWorkflow(id, formData, loading)
debugger
MsgConfirm(
t('common.tip'),
`${t('views.application.tip.confirmUse')} ${name} ${t('views.application.tip.overwrite')}?`,
{
confirmButtonText: t('common.confirm'),
cancelButtonText: t('common.cancel'),
},
)
.then(() => {
getDetail()
})
.catch((error: any) => {
if (error.code === 400) {
MsgConfirm(t('common.tip'), t('views.application.tip.professionalMessage'), {
cancelButtonText: t('common.confirm'),
confirmButtonText: t('common.professional'),
}).then(() => {
window.open('https://maxkb.cn/pricing.html', '_blank')
loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value })
.importKnowledgeWorkflow(id, formData, loading)
.then(() => {
getDetail()
})
.catch((error: any) => {
if (error.code === 400) {
MsgConfirm(t('common.tip'), t('views.application.tip.professionalMessage'), {
cancelButtonText: t('common.confirm'),
confirmButtonText: t('common.professional'),
}).then(() => {
window.open('https://maxkb.cn/pricing.html', '_blank')
})
}
})
}
})
.catch(() => {})
}

function exportKnowledgeWorkflow(name: string, id: string) {
Expand Down
Loading