Skip to content

Commit 1540fcd

Browse files
fix: model page‘s icon error and change workflow page‘s model api
1 parent efbcec9 commit 1540fcd

File tree

9 files changed

+37
-31
lines changed

9 files changed

+37
-31
lines changed

ui/src/views/model/component/ModelCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
</template>
66
<template #title>
77
<div class="flex" style="height: 22px">
8-
<span class="ellipsis-1 mb-4" :title="model.name" style="width: 80%">
8+
<span class="ellipsis-1 mb-4" :title="model.name" style="max-width: 80%">
99
{{ model.name }}
1010
</span>
1111
<span v-if="currentModel.status === 'ERROR'">
1212
<el-tooltip effect="dark" :content="errMessage" placement="top">
13-
<el-icon class="color-danger ml-4" size="18"><Warning /></el-icon>
13+
<el-icon class="color-danger ml-4" size="18"><WarningFilled /></el-icon>
1414
</el-tooltip>
1515
</span>
1616
<span v-if="currentModel.status === 'PAUSE_DOWNLOAD'">
@@ -19,7 +19,7 @@
1919
:content="`${$t('views.model.modelForm.base_model.label')}: ${props.model.model_name} ${$t('views.model.tip.downloadError')}`"
2020
placement="top"
2121
>
22-
<el-icon class="color-danger ml-4" size="18"><Warning /></el-icon>
22+
<el-icon class="color-danger ml-4" size="18"><WarningFilled /></el-icon>
2323
</el-tooltip>
2424
</span>
2525
</div>

ui/src/workflow/nodes/ai-chat-node/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,14 @@ const validate = () => {
277277
})
278278
}
279279
280+
const application = getApplicationDetail()
281+
280282
function getSelectModel() {
281283
const obj =
282284
apiType.value === 'systemManage'
283285
? {
284286
model_type: 'LLM',
285-
// workspace_id: workspace,
287+
workspace_id: application.value?.workspace_id,
286288
}
287289
: {
288290
model_type: 'LLM',
@@ -333,8 +335,6 @@ function submitMcpServersDialog(config: any) {
333335
}
334336
335337
onMounted(() => {
336-
const application = getApplicationDetail()
337-
console.log(application.value)
338338
getSelectModel()
339339
if (typeof props.nodeModel.properties.node_data?.is_result === 'undefined') {
340340
if (isLastNode(props.nodeModel)) {

ui/src/workflow/nodes/base-node/index.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
import { groupBy, set } from 'lodash'
171171
import NodeContainer from '@/workflow/common/NodeContainer.vue'
172172
import type { FormInstance } from 'element-plus'
173-
import { ref, computed, onMounted, nextTick } from 'vue'
173+
import { ref, computed, onMounted, nextTick, inject } from 'vue'
174174
import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message'
175175
import { t } from '@/locales'
176176
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
@@ -179,7 +179,7 @@ import UserInputFieldTable from './component/UserInputFieldTable.vue'
179179
import FileUploadSettingDialog from '@/workflow/nodes/base-node/component/FileUploadSettingDialog.vue'
180180
import { useRoute } from 'vue-router'
181181
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
182-
182+
const getApplicationDetail = inject('getApplicationDetail') as any
183183
const route = useRoute()
184184
185185
const {
@@ -261,12 +261,13 @@ const validate = () => {
261261
})
262262
}
263263
264+
const application = getApplicationDetail()
264265
function getSTTModel() {
265266
const obj =
266267
apiType.value === 'systemManage'
267268
? {
268269
model_type: 'STT',
269-
// workspace_id: workspace,
270+
workspace_id: application.value?.workspace_id,
270271
}
271272
: {
272273
model_type: 'STT',
@@ -283,7 +284,7 @@ function getTTSModel() {
283284
apiType.value === 'systemManage'
284285
? {
285286
model_type: 'TTS',
286-
// workspace_id: workspace,
287+
workspace_id: application.value?.workspace_id,
287288
}
288289
: {
289290
model_type: 'TTS',

ui/src/workflow/nodes/image-generate/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@
153153

154154
<script setup lang="ts">
155155
import NodeContainer from '@/workflow/common/NodeContainer.vue'
156-
import { computed, nextTick, onMounted, ref } from 'vue'
156+
import { computed, nextTick, onMounted, ref, inject } from 'vue'
157157
import { groupBy, set } from 'lodash'
158158
import type { FormInstance } from 'element-plus'
159159
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
160160
import { t } from '@/locales'
161161
import { useRoute } from 'vue-router'
162162
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
163-
163+
const getApplicationDetail = inject('getApplicationDetail') as any
164164
const route = useRoute()
165165
166166
const {
@@ -225,12 +225,13 @@ const form_data = computed({
225225
},
226226
})
227227
228+
const application = getApplicationDetail()
228229
function getSelectModel() {
229230
const obj =
230231
apiType.value === 'systemManage'
231232
? {
232233
model_type: 'TTI',
233-
// workspace_id: workspace,
234+
workspace_id: application.value?.workspace_id,
234235
}
235236
: {
236237
model_type: 'TTI',

ui/src/workflow/nodes/image-understand/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@
169169

170170
<script setup lang="ts">
171171
import NodeContainer from '@/workflow/common/NodeContainer.vue'
172-
import { computed, onMounted, ref } from 'vue'
172+
import { computed, onMounted, ref, inject } from 'vue'
173173
import { groupBy, set } from 'lodash'
174174
import NodeCascader from '@/workflow/common/NodeCascader.vue'
175175
import type { FormInstance } from 'element-plus'
176176
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
177177
import { t } from '@/locales'
178178
import { useRoute } from 'vue-router'
179179
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
180-
180+
const getApplicationDetail = inject('getApplicationDetail') as any
181181
const route = useRoute()
182182
183183
const {
@@ -245,12 +245,13 @@ const form_data = computed({
245245
},
246246
})
247247
248+
const application = getApplicationDetail()
248249
function getSelectModel() {
249250
const obj =
250251
apiType.value === 'systemManage'
251252
? {
252253
model_type: 'IMAGE',
253-
// workspace_id: workspace,
254+
workspace_id: application.value?.workspace_id,
254255
}
255256
: {
256257
model_type: 'IMAGE',

ui/src/workflow/nodes/question-node/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ import { set, groupBy } from 'lodash'
136136
import NodeContainer from '@/workflow/common/NodeContainer.vue'
137137
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
138138
import type { FormInstance } from 'element-plus'
139-
import { ref, computed, onMounted } from 'vue'
139+
import { ref, computed, onMounted, inject } from 'vue'
140140
import { isLastNode } from '@/workflow/common/data'
141141
import { t } from '@/locales'
142142
import { useRoute } from 'vue-router'
143143
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
144-
144+
const getApplicationDetail = inject('getApplicationDetail') as any
145145
const route = useRoute()
146146
147147
const {
@@ -228,12 +228,13 @@ const validate = () => {
228228
})
229229
}
230230
231+
const application = getApplicationDetail()
231232
function getSelectModel() {
232233
const obj =
233234
apiType.value === 'systemManage'
234235
? {
235236
model_type: 'LLM',
236-
// workspace_id: workspace,
237+
workspace_id: application.value?.workspace_id,
237238
}
238239
: {
239240
model_type: 'LLM',

ui/src/workflow/nodes/reranker-node/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ import { set, cloneDeep, groupBy } from 'lodash'
184184
import NodeContainer from '@/workflow/common/NodeContainer.vue'
185185
import NodeCascader from '@/workflow/common/NodeCascader.vue'
186186
import ParamSettingDialog from './ParamSettingDialog.vue'
187-
import { ref, computed, onMounted } from 'vue'
187+
import { ref, computed, onMounted, inject } from 'vue'
188188
import { useRoute } from 'vue-router'
189189
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
190-
190+
const getApplicationDetail = inject('getApplicationDetail') as any
191191
const route = useRoute()
192192
193193
const {
@@ -251,12 +251,14 @@ const form_data = computed({
251251
function refreshParam(data: any) {
252252
set(props.nodeModel.properties.node_data, 'reranker_setting', data)
253253
}
254+
255+
const application = getApplicationDetail()
254256
function getSelectModel() {
255257
const obj =
256258
apiType.value === 'systemManage'
257259
? {
258260
model_type: 'RERANKER',
259-
// workspace_id: workspace,
261+
workspace_id: application.value?.workspace_id,
260262
}
261263
: {
262264
model_type: 'RERANKER',

ui/src/workflow/nodes/speech-to-text-node/index.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,16 @@
9696

9797
<script setup lang="ts">
9898
import NodeContainer from '@/workflow/common/NodeContainer.vue'
99-
import { computed, onMounted, ref } from 'vue'
99+
import { computed, onMounted, ref, inject } from 'vue'
100100
import { groupBy, set } from 'lodash'
101101
import NodeCascader from '@/workflow/common/NodeCascader.vue'
102102
import type { FormInstance } from 'element-plus'
103103
import { useRoute } from 'vue-router'
104104
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
105-
105+
const getApplicationDetail = inject('getApplicationDetail') as any
106106
const route = useRoute()
107107
108-
const {
109-
110-
} = route as any
108+
const {} = route as any
111109
112110
const apiType = computed(() => {
113111
if (route.path.includes('resource-management')) {
@@ -161,12 +159,13 @@ const form_data = computed({
161159
},
162160
})
163161
162+
const application = getApplicationDetail()
164163
function getSelectModel() {
165164
const obj =
166165
apiType.value === 'systemManage'
167166
? {
168167
model_type: 'STT',
169-
// workspace_id: workspace,
168+
workspace_id: application.value?.workspace_id,
170169
}
171170
: {
172171
model_type: 'STT',

ui/src/workflow/nodes/text-to-speech-node/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
</template>
106106

107107
<script setup lang="ts">
108-
import { computed, onMounted, ref } from 'vue'
108+
import { computed, onMounted, ref, inject } from 'vue'
109109
import { groupBy, set } from 'lodash'
110110
import NodeContainer from '@/workflow/common/NodeContainer.vue'
111111
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
@@ -115,7 +115,7 @@ import { MsgSuccess } from '@/utils/message'
115115
import { t } from '@/locales'
116116
import { useRoute } from 'vue-router'
117117
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
118-
118+
const getApplicationDetail = inject('getApplicationDetail') as any
119119
const route = useRoute()
120120
121121
const {
@@ -177,12 +177,13 @@ const form_data = computed({
177177
},
178178
})
179179
180+
const application = getApplicationDetail()
180181
function getSelectModel() {
181182
const obj =
182183
apiType.value === 'systemManage'
183184
? {
184185
model_type: 'TTS',
185-
// workspace_id: workspace,
186+
workspace_id: application.value?.workspace_id,
186187
}
187188
: {
188189
model_type: 'TTS',

0 commit comments

Comments
 (0)