Skip to content

Commit da65ce5

Browse files
fix: tool
1 parent 356dbeb commit da65ce5

File tree

24 files changed

+410
-135
lines changed

24 files changed

+410
-135
lines changed

ui/src/api/tool/tool.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,24 @@ const getToolList: (
3939
)
4040
}
4141

42+
/**
43+
* 创建工具
44+
* @param 参数
45+
*/
46+
const postTool: (
47+
wordspace_id: string,
48+
data: toolData,
49+
loading?: Ref<boolean>,
50+
) => Promise<Result<any>> = (wordspace_id, data, loading) => {
51+
return post(`${prefix}/${wordspace_id}/tool`, data, undefined, loading)
52+
}
53+
4254
/**
4355
* 修改工具
4456
* @param 参数
4557
4658
*/
47-
const putToolLib: (
59+
const putTool: (
4860
wordspace_id: string,
4961
tool_id: string,
5062
data: toolData,
@@ -67,9 +79,22 @@ const getToolById: (
6779
return get(`${prefix}/${wordspace_id}/tool/${function_lib_id}`, undefined, loading)
6880
}
6981

82+
/**
83+
* 调试工具
84+
* @param 参数
85+
86+
*/
87+
// const postToolDebug: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
88+
// data: any,
89+
// loading
90+
// ) => {
91+
// return post(`${prefix}/debug`, data, undefined, loading)
92+
// }
93+
7094
export default {
7195
getToolByFolder,
7296
getToolList,
73-
putToolLib,
74-
getToolById
97+
putTool,
98+
getToolById,
99+
postTool
75100
}

ui/src/layout/components/breadcrumb/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,16 @@ import { ref, onMounted, computed } from 'vue'
138138
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router'
139139
// import CreateApplicationDialog from '@/views/application/component/CreateApplicationDialog.vue'
140140
// import CreateDatasetDialog from '@/views/dataset/component/CreateDatasetDialog.vue'
141-
import { isAppIcon, isWorkFlow } from '@/utils/application'
141+
import { isWorkFlow } from '@/utils/application'
142+
import { isAppIcon } from '@/utils/common'
143+
142144
import useStore from '@/stores'
143145
const { common, dataset, application } = useStore()
144146
const route = useRoute()
145147
const router = useRouter()
146148
const {
147149
meta: { activeMenu },
148-
params: { id }
150+
params: { id },
149151
} = route as any
150152
151153
onBeforeRouteLeave((to, from) => {
@@ -193,7 +195,7 @@ function changeMenu(id: string) {
193195
} else {
194196
router.push({
195197
name: lastMatched.name,
196-
params: { id: id, type: type }
198+
params: { id: id, type: type },
197199
})
198200
}
199201
}

ui/src/locales/lang/en-US/common.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,21 @@ export default {
5858
outputParam: 'Output Parameters',
5959
inputParam: 'Input Parameters',
6060
initParam: 'Startup Parameters',
61+
editParam: 'Edit Parameter',
62+
addParam: 'Add Parameter',
6163
},
62-
6364
inputPlaceholder: 'Please input',
6465
title: 'Title',
6566
content: 'Content',
6667
rename: 'Rename',
68+
EditAvatarDialog: {
69+
title: 'App Logo',
70+
customizeUpload: 'Custom Upload',
71+
upload: 'Upload',
72+
default: 'Default Logo',
73+
custom: 'Custom',
74+
sizeTip: 'Recommended size: 32×32 pixels. Supports JPG, PNG, and GIF formats. Max size: 10 MB',
75+
fileSizeExceeded: 'File size exceeds 10 MB',
76+
uploadImagePrompt: 'Please upload an image',
77+
},
6778
}

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@ export default {
2727
enabledSuccess: 'Enabled',
2828
disabledSuccess: 'Disabled'
2929
},
30-
EditAvatarDialog: {
31-
title: 'App Logo',
32-
customizeUpload: 'Custom Upload',
33-
upload: 'Upload',
34-
default: 'Default Logo',
35-
custom: 'Custom',
36-
sizeTip:
37-
'Recommended size: 32×32 pixels. Supports JPG, PNG, and GIF formats. Max size: 10 MB',
38-
fileSizeExceeded: 'File size exceeds 10 MB',
39-
uploadImagePrompt: 'Please upload an image'
40-
},
4130
EmbedDialog: {
4231
fullscreenModeTitle: 'Fullscreen Mode',
4332
copyInstructions: 'Copy the code below to embed',

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ export default {
3838
baseInfo: 'Basic Information',
3939
advancedInfo: 'Advanced Settings',
4040
modelParams: 'Model Parameters',
41-
editParam: 'Edit Parameter',
42-
addParam: 'Add Parameter',
4341
paramSetting: 'Model Parameter Settings',
4442
apiParamPassing: 'Interface Parameters',
4543
},

ui/src/locales/lang/zh-CN/common.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,25 @@ export default {
5858
enableSuccess: '启用成功',
5959
disableSuccess: '禁用成功',
6060
},
61-
inputPlaceholder: '请输入',
62-
title: '标题',
63-
content: '内容',
6461
param: {
6562
outputParam: '输出参数',
6663
inputParam: '输入参数',
6764
initParam: '启动参数',
65+
editParam: '编辑参数',
66+
addParam: '添加参数',
6867
},
68+
inputPlaceholder: '请输入',
69+
title: '标题',
70+
content: '内容',
6971
rename: '重命名',
72+
EditAvatarDialog: {
73+
title: 'App Logo',
74+
customizeUpload: 'Custom Upload',
75+
upload: 'Upload',
76+
default: 'Default Logo',
77+
custom: 'Custom',
78+
sizeTip: 'Recommended size: 32×32 pixels. Supports JPG, PNG, and GIF formats. Max size: 10 MB',
79+
fileSizeExceeded: 'File size exceeds 10 MB',
80+
uploadImagePrompt: 'Please upload an image',
81+
},
7082
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ export default {
3838
baseInfo: '基础信息',
3939
advancedInfo: '高级设置',
4040
modelParams: '模型参数',
41-
editParam: '编辑参数',
42-
addParam: '添加参数',
4341
paramSetting: '模型参数设置',
4442
apiParamPassing: '接口传参',
4543
},

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export default {
77
confirmMessage: '禁用后,引用了该工具的应用提问时会报错 ,请谨慎操作。',
88
},
99
form: {
10+
title: {
11+
copy: '副本',
12+
baseInfo: '基础信息'
13+
},
1014
toolName: {
1115
label: '名称',
1216
name: '工具名称',

ui/src/locales/lang/zh-Hant/common.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,25 @@ export default {
5454
enableSuccess: '啟用成功',
5555
disableSuccess: '停用成功',
5656
},
57-
inputPlaceholder: '請輸入',
58-
title: '標題',
59-
content: '内容',
6057
param: {
6158
outputParam: '輸出參數',
6259
inputParam: '輸入參數',
6360
initParam: '啟動參數',
61+
editParam: '編輯參數',
62+
addParam: '新增參數',
6463
},
64+
inputPlaceholder: '請輸入',
65+
title: '標題',
66+
content: '内容',
6567
rename: '重命名',
68+
EditAvatarDialog: {
69+
title: '應用頭像',
70+
customizeUpload: '自訂上傳',
71+
upload: '上傳',
72+
default: '預設logo',
73+
custom: '自訂',
74+
sizeTip: '建議尺寸 32*32,支援 JPG、PNG、GIF,大小不超過 10 MB',
75+
fileSizeExceeded: '檔案大小超過 10 MB',
76+
uploadImagePrompt: '請上傳一張圖片'
77+
},
6678
}

ui/src/locales/lang/zh-Hant/views/application-overview.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ export default {
2626
enabledSuccess: '已啟用',
2727
disabledSuccess: '已停用'
2828
},
29-
EditAvatarDialog: {
30-
title: '應用頭像',
31-
customizeUpload: '自訂上傳',
32-
upload: '上傳',
33-
default: '預設logo',
34-
custom: '自訂',
35-
sizeTip: '建議尺寸 32*32,支援 JPG、PNG、GIF,大小不超過 10 MB',
36-
fileSizeExceeded: '檔案大小超過 10 MB',
37-
uploadImagePrompt: '請上傳一張圖片'
38-
},
3929
EmbedDialog: {
4030
fullscreenModeTitle: '全螢幕模式',
4131
copyInstructions: '複製以下程式碼進行嵌入',

0 commit comments

Comments
 (0)