Skip to content

Commit 2a88651

Browse files
perf: Optimize markdown image style
1 parent 902f5dd commit 2a88651

File tree

4 files changed

+57
-27
lines changed

4 files changed

+57
-27
lines changed

ui/src/styles/element-plus.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
border: none;
3232
}
3333
}
34+
.el-button--text {
35+
border: none !important;
36+
&:focus {
37+
border: none !important;
38+
}
39+
}
3440
.el-button--large {
3541
font-size: 16px;
3642
}

ui/src/styles/md-editor.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
}
1515
img {
1616
border: 0 !important;
17+
max-width: 360px !important;
18+
}
19+
}
20+
21+
@media only screen and (max-width: 768px) {
22+
.md-editor-preview {
23+
img {
24+
max-width: 100% !important;
25+
}
1726
}
1827
}
1928

ui/src/views/application/index.vue

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="flex-between">
66
<el-upload
77
:file-list="[]"
8-
class="flex-between"
8+
class="flex-between mr-12"
99
action="#"
1010
multiple
1111
:auto-upload="false"
@@ -275,18 +275,18 @@ function mapToUrlParams(map: any[]) {
275275
}
276276
277277
function getAccessToken(id: string) {
278-
applicationList.value.filter((app)=>app.id === id)[0]?.work_flow?.nodes
279-
?.filter((v: any) => v.id === 'base-node')
280-
.map((v: any) => {
281-
apiInputParams.value = v.properties.api_input_field_list
282-
? v.properties.api_input_field_list
283-
.map((v: any) => {
284-
return {
285-
name: v.variable,
286-
value: v.default_value
287-
}
288-
})
289-
: v.properties.input_field_list
278+
applicationList.value
279+
.filter((app) => app.id === id)[0]
280+
?.work_flow?.nodes?.filter((v: any) => v.id === 'base-node')
281+
.map((v: any) => {
282+
apiInputParams.value = v.properties.api_input_field_list
283+
? v.properties.api_input_field_list.map((v: any) => {
284+
return {
285+
name: v.variable,
286+
value: v.default_value
287+
}
288+
})
289+
: v.properties.input_field_list
290290
? v.properties.input_field_list
291291
.filter((v: any) => v.assignment_method === 'api_input')
292292
.map((v: any) => {
@@ -296,9 +296,11 @@ function getAccessToken(id: string) {
296296
}
297297
})
298298
: []
299-
})
299+
})
300300
301-
const apiParams = mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : ''
301+
const apiParams = mapToUrlParams(apiInputParams.value)
302+
? '?' + mapToUrlParams(apiInputParams.value)
303+
: ''
302304
application.asyncGetAccessToken(id, loading).then((res: any) => {
303305
window.open(application.location + res?.data?.access_token + apiParams)
304306
})

ui/src/views/template/component/CreateModelDialog.vue

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
<el-tooltip effect="dark" placement="right">
8989
<template #content>
9090
<p>大语言模型:在应用中与AI对话的推理模型。</p>
91-
<p>向量模型:在知识库中导入文档进行向量化和向量检索召回分段时使用的向量模型。</p>
91+
<p>
92+
向量模型:在知识库中导入文档进行向量化和向量检索召回分段时使用的向量模型。
93+
</p>
9294
<p>
9395
重排模型:在二次召回中根据召回的候选分段和用户问题的匹配度重新排序,从而得到更精确的结果。
9496
</p>
@@ -155,13 +157,17 @@
155157
</DynamicsForm>
156158
</el-tab-pane>
157159
<el-tab-pane label="高级设置" name="advanced-info">
158-
<div class="flex-between">
160+
<div class="flex-between mb-8">
159161
<h5>模型参数</h5>
160-
<el-button type="text" @click="openAddDrawer()" :disabled="form_data.model_type !== 'LLM' && form_data.model_type !== 'IMAGE' && form_data.model_type !== 'TTS' && form_data.model_type !== 'TTI'">
162+
<el-button type="text" @click.stop="openAddDrawer()">
161163
<AppIcon iconName="Plus" class="add-icon" />添加
162164
</el-button>
163165
</div>
164-
<el-table :data="base_form_data.model_params_form" v-if="base_form_data.model_params_form?.length > 0" class="mb-16">
166+
<el-table
167+
:data="base_form_data.model_params_form"
168+
v-if="base_form_data.model_params_form?.length > 0"
169+
class="mb-16"
170+
>
165171
<el-table-column prop="label" label="显示名称" show-overflow-tooltip>
166172
<template #default="{ row }">
167173
<span v-if="row.label && row.label.input_type === 'TooltipLabel'">{{
@@ -216,7 +222,6 @@
216222
</template>
217223
</el-dialog>
218224
<AddParamDrawer ref="AddParamRef" @refresh="refresh" />
219-
220225
</template>
221226
<script setup lang="ts">
222227
import { ref, computed } from 'vue'
@@ -245,7 +250,6 @@ const dialogVisible = ref<boolean>(false)
245250
const activeName = ref('base-info')
246251
const AddParamRef = ref()
247252
248-
249253
const base_form_data_rule = ref<FormRules>({
250254
name: { required: true, trigger: 'blur', message: '模型名称不能为空' },
251255
permission_type: { required: true, trigger: 'change', message: '权限不能为空' },
@@ -296,10 +300,14 @@ const getModelForm = (model_name: string) => {
296300
dynamicsFormRef.value?.render(model_form_field.value, undefined)
297301
})
298302
299-
ModelApi.listBaseModelParamsForm(providerValue.value.provider, form_data.value.model_type, model_name, base_model_loading)
300-
.then((ok) => {
301-
base_form_data.value.model_params_form = ok.data
302-
})
303+
ModelApi.listBaseModelParamsForm(
304+
providerValue.value.provider,
305+
form_data.value.model_type,
306+
model_name,
307+
base_model_loading
308+
).then((ok) => {
309+
base_form_data.value.model_params_form = ok.data
310+
})
303311
}
304312
}
305313
@@ -325,7 +333,13 @@ const list_base_model = (model_type: any, change?: boolean) => {
325333
}
326334
327335
const close = () => {
328-
base_form_data.value = { name: '', model_type: '', model_name: '', permission_type: 'PRIVATE', model_params_form: [] }
336+
base_form_data.value = {
337+
name: '',
338+
model_type: '',
339+
model_name: '',
340+
permission_type: 'PRIVATE',
341+
model_params_form: []
342+
}
329343
credential_form_data.value = {}
330344
model_form_field.value = []
331345
base_model_list.value = []
@@ -386,7 +400,6 @@ function refresh(data: any, index: any) {
386400
}
387401
}
388402
389-
390403
const toSelectProvider = () => {
391404
close()
392405
emit('change')

0 commit comments

Comments
 (0)