Skip to content

Commit a05e88b

Browse files
committed
feat: update SVG icons to use percentage dimensions for better responsiveness
1 parent 34175c7 commit a05e88b

File tree

4 files changed

+114
-16
lines changed

4 files changed

+114
-16
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1+
<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
22
<path d="M13.1753 11.2238H10.6946V8.98998H13.1753V11.2238ZM13.1753 3.5H10.6946V5.80958H13.1753V3.5ZM16.107 8.98998H13.6263V11.2238H16.107V8.98998ZM10.2436 6.26392H7.76291V8.53563H10.2436V6.26392ZM13.1753 6.26392H10.6946V8.53563H13.1753V6.26392ZM23.5866 10.0501C23.0604 9.67149 21.7824 9.55791 20.8428 9.74722C20.73 8.83853 20.2038 8.04343 19.3018 7.32405L18.7756 6.9833L18.4373 7.51336C17.7607 8.5735 17.5728 10.3151 18.2869 11.451C17.9487 11.6403 17.3097 11.8675 16.4828 11.8675H0.0953884C-0.242884 13.7984 0.320904 16.2973 1.74917 18.0011C3.13984 19.667 5.24465 20.5 7.95083 20.5C13.8518 20.5 18.2494 17.7739 20.279 12.7762C21.0683 12.7762 22.8348 12.7762 23.6993 11.0724C23.7369 10.9967 23.9624 10.5802 24 10.4287L23.5866 10.0501ZM4.38018 8.98998H1.89951V11.2238H4.38018V8.98998ZM7.31188 8.98998H4.83121V11.2238H7.31188V8.98998ZM10.2436 8.98998H7.76291V11.2238H10.2436V8.98998ZM7.31188 6.26392H4.83121V8.53563H7.31188V6.26392Z" fill="#1D63ED"/>
33
</svg>

ui/src/components/dynamics-form/items/model/provider-data.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const providerList = [
2222
{
2323
"provider": "model_docker_ai_provider",
2424
"name": "Docker AI",
25-
"icon": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M13.1753 11.2238H10.6946V8.98998H13.1753V11.2238ZM13.1753 3.5H10.6946V5.80958H13.1753V3.5ZM16.107 8.98998H13.6263V11.2238H16.107V8.98998ZM10.2436 6.26392H7.76291V8.53563H10.2436V6.26392ZM13.1753 6.26392H10.6946V8.53563H13.1753V6.26392ZM23.5866 10.0501C23.0604 9.67149 21.7824 9.55791 20.8428 9.74722C20.73 8.83853 20.2038 8.04343 19.3018 7.32405L18.7756 6.9833L18.4373 7.51336C17.7607 8.5735 17.5728 10.3151 18.2869 11.451C17.9487 11.6403 17.3097 11.8675 16.4828 11.8675H0.0953884C-0.242884 13.7984 0.320904 16.2973 1.74917 18.0011C3.13984 19.667 5.24465 20.5 7.95083 20.5C13.8518 20.5 18.2494 17.7739 20.279 12.7762C21.0683 12.7762 22.8348 12.7762 23.6993 11.0724C23.7369 10.9967 23.9624 10.5802 24 10.4287L23.5866 10.0501ZM4.38018 8.98998H1.89951V11.2238H4.38018V8.98998ZM7.31188 8.98998H4.83121V11.2238H7.31188V8.98998ZM10.2436 8.98998H7.76291V11.2238H10.2436V8.98998ZM7.31188 6.26392H4.83121V8.53563H7.31188V6.26392Z\" fill=\"#1D63ED\"/>\n</svg>\n"
25+
"icon": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M13.1753 11.2238H10.6946V8.98998H13.1753V11.2238ZM13.1753 3.5H10.6946V5.80958H13.1753V3.5ZM16.107 8.98998H13.6263V11.2238H16.107V8.98998ZM10.2436 6.26392H7.76291V8.53563H10.2436V6.26392ZM13.1753 6.26392H10.6946V8.53563H13.1753V6.26392ZM23.5866 10.0501C23.0604 9.67149 21.7824 9.55791 20.8428 9.74722C20.73 8.83853 20.2038 8.04343 19.3018 7.32405L18.7756 6.9833L18.4373 7.51336C17.7607 8.5735 17.5728 10.3151 18.2869 11.451C17.9487 11.6403 17.3097 11.8675 16.4828 11.8675H0.0953884C-0.242884 13.7984 0.320904 16.2973 1.74917 18.0011C3.13984 19.667 5.24465 20.5 7.95083 20.5C13.8518 20.5 18.2494 17.7739 20.279 12.7762C21.0683 12.7762 22.8348 12.7762 23.6993 11.0724C23.7369 10.9967 23.9624 10.5802 24 10.4287L23.5866 10.0501ZM4.38018 8.98998H1.89951V11.2238H4.38018V8.98998ZM7.31188 8.98998H4.83121V11.2238H7.31188V8.98998ZM10.2436 8.98998H7.76291V11.2238H10.2436V8.98998ZM7.31188 6.26392H4.83121V8.53563H7.31188V6.26392Z\" fill=\"#1D63ED\"/>\n</svg>\n"
2626
},
2727
{
2828
"provider": "model_kimi_provider",
@@ -92,7 +92,7 @@ export const providerList = [
9292
{
9393
"provider": "model_anthropic_provider",
9494
"name": "Anthropic",
95-
"icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" shape-rendering=\"geometricPrecision\" text-rendering=\"geometricPrecision\" image-rendering=\"optimizeQuality\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" viewBox=\"0 0 512 512\"><rect fill=\"#CC9B7A\" width=\"512\" height=\"512\" rx=\"104.187\" ry=\"105.042\"/><path fill=\"#1F1F1E\" fill-rule=\"nonzero\" d=\"M318.663 149.787h-43.368l78.952 212.423 43.368.004-78.952-212.427zm-125.326 0l-78.952 212.427h44.255l15.932-44.608 82.846-.004 16.107 44.612h44.255l-79.126-212.427h-45.317zm-4.251 128.341l26.91-74.701 27.083 74.701h-53.993z\"/></svg>"
95+
"icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" shape-rendering=\"geometricPrecision\" text-rendering=\"geometricPrecision\" image-rendering=\"optimizeQuality\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" viewBox=\"0 0 512 512\"><rect fill=\"#CC9B7A\" width=\"100%\" height=\"100%\" rx=\"104.187\" ry=\"105.042\"/><path fill=\"#1F1F1E\" fill-rule=\"nonzero\" d=\"M318.663 149.787h-43.368l78.952 212.423 43.368.004-78.952-212.427zm-125.326 0l-78.952 212.427h44.255l15.932-44.608 82.846-.004 16.107 44.612h44.255l-79.126-212.427h-45.317zm-4.251 128.341l26.91-74.701 27.083 74.701h-53.993z\"/></svg>"
9696
},
9797
{
9898
"provider": "model_siliconCloud_provider",
@@ -104,4 +104,4 @@ export const providerList = [
104104
"name": "Regolo",
105105
"icon": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n id=\"Livello_2\"\n data-name=\"Livello 2\"\n viewBox=\"0 0 104.4 104.38\"\n version=\"1.1\"\n sodipodi:docname=\"Regolo_logo_positive.svg\"\n width=\"100%\" height=\"100%\"\n inkscape:version=\"1.4 (e7c3feb100, 2024-10-09)\"\n xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:svg=\"http://www.w3.org/2000/svg\">\n <sodipodi:namedview\n id=\"namedview13\"\n pagecolor=\"#ffffff\"\n bordercolor=\"#666666\"\n borderopacity=\"1.0\"\n inkscape:showpageshadow=\"2\"\n inkscape:pageopacity=\"0.0\"\n inkscape:pagecheckerboard=\"0\"\n inkscape:deskcolor=\"#d1d1d1\"\n inkscape:zoom=\"2.1335227\"\n inkscape:cx=\"119.05193\"\n inkscape:cy=\"48.511318\"\n inkscape:window-width=\"1920\"\n inkscape:window-height=\"1025\"\n inkscape:window-x=\"0\"\n inkscape:window-y=\"0\"\n inkscape:window-maximized=\"1\"\n inkscape:current-layer=\"g13\" />\n <defs\n id=\"defs1\">\n <style\n id=\"style1\">\n .cls-1 {\n fill: #303030;\n }\n\n .cls-2 {\n fill: #59e389;\n }\n </style>\n </defs>\n <g\n id=\"Grafica\"\n transform=\"translate(0,-40.87)\">\n <g\n id=\"g13\">\n <path\n class=\"cls-1\"\n d=\"m 104.39,105.96 v 36.18 c 0,0.32 -0.05,0.62 -0.14,0.91 -0.39,1.27 -1.58,2.2 -2.99,2.2 H 65.08 c -1.73,0 -3.13,-1.41 -3.13,-3.13 V 113.4 c 0,-0.15 0,-0.29 0,-0.44 v -7 c 0,-1.73 1.4,-3.13 3.13,-3.13 h 36.19 c 1.5,0 2.77,1.07 3.06,2.5 0.05,0.21 0.07,0.41 0.07,0.63 z\"\n id=\"path1\" />\n <path\n class=\"cls-1\"\n d=\"m 104.39,105.96 v 36.18 c 0,0.32 -0.05,0.62 -0.14,0.91 -0.39,1.27 -1.58,2.2 -2.99,2.2 H 65.08 c -1.73,0 -3.13,-1.41 -3.13,-3.13 V 113.4 c 0,-0.15 0,-0.29 0,-0.44 v -7 c 0,-1.73 1.4,-3.13 3.13,-3.13 h 36.19 c 1.5,0 2.77,1.07 3.06,2.5 0.05,0.21 0.07,0.41 0.07,0.63 z\"\n id=\"path2\" />\n <path\n class=\"cls-2\"\n d=\"M 101.27,40.88 H 65.09 c -1.73,0 -3.13,1.4 -3.13,3.13 v 28.71 c 0,4.71 -1.88,9.23 -5.2,12.56 L 44.42,97.61 c -3.32,3.33 -7.85,5.2 -12.55,5.2 H 18.98 c -2.21,0 -3.99,-1.79 -3.99,-3.99 V 87.29 c 0,-2.21 1.79,-3.99 3.99,-3.99 h 20.34 c 1.41,0 2.59,-0.93 2.99,-2.2 0.09,-0.29 0.14,-0.59 0.14,-0.91 V 44 c 0,-0.22 -0.02,-0.42 -0.07,-0.63 -0.29,-1.43 -1.56,-2.5 -3.06,-2.5 H 3.13 C 1.4,40.87 0,42.27 0,44 v 7 c 0,0.15 0,0.29 0,0.44 v 28.72 c 0,1.72 1.41,3.13 3.13,3.13 h 3.16 c 2.21,0 3.99,1.79 3.99,3.99 v 11.53 c 0,2.21 -1.79,3.99 -3.99,3.99 H 3.15 c -1.73,0 -3.13,1.4 -3.13,3.13 v 36.19 c 0,1.72 1.41,3.13 3.13,3.13 h 36.19 c 1.73,0 3.13,-1.41 3.13,-3.13 V 113.4 c 0,-4.7 1.87,-9.23 5.2,-12.55 L 60,88.51 c 3.33,-3.32 7.85,-5.2 12.56,-5.2 h 28.71 c 1.73,0 3.13,-1.4 3.13,-3.13 V 44 c 0,-1.73 -1.4,-3.13 -3.13,-3.13 z\"\n id=\"path3\" />\n </g>\n </g>\n</svg>\n"
106106
}
107-
]
107+
]

ui/src/views/trigger/TriggerDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@
505505
</el-form-item>
506506
</el-form>
507507
<ApplicationDialog @refresh="applicationRefresh" ref="applicationDialogRef"></ApplicationDialog>
508-
<ToolDialog @refresh="toolRefresh" ref="toolDialogRef"></ToolDialog>
508+
<ToolDialog @refresh="toolRefresh" ref="toolDialogRef" tool_type="CUSTOM,WORKFLOW"></ToolDialog>
509509
<template #footer>
510510
<el-button @click="close">{{ $t('common.cancel') }}</el-button>
511511
<el-button v-if="!is_edit || editPermission" type="primary" @click="submit">{{

ui/src/views/trigger/component/ToolParameter.vue

Lines changed: 109 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
size="small"
3737
style="width: 85px"
3838
>
39-
<el-option :label="$t('chat.quote')" value="reference" />
40-
<el-option :label="$t('common.custom')" value="custom" />
39+
<el-option :label="$t('chat.quote')" value="reference"/>
40+
<el-option :label="$t('common.custom')" value="custom"/>
4141
</el-select>
4242
</div>
4343
</template>
@@ -57,11 +57,61 @@
5757
/>
5858
</el-form-item>
5959
</template>
60+
<template v-for="(f, index) in user_input_field_list" :key="f.field">
61+
<el-form-item
62+
v-if="modelValue['user_input_field_list'] && modelValue['user_input_field_list'][f.field]"
63+
:label="$t('workflow.nodes.startNode.question')"
64+
:prop="`user_input_field_list.${f.field}.value`"
65+
:rules="{
66+
message: $t('common.inputPlaceholder'),
67+
trigger: 'blur',
68+
required: f.required,
69+
}"
70+
>
71+
<template #label>
72+
<div class="flex-between">
73+
<div>
74+
{{ f.label.value }}
75+
<span class="color-danger" v-if="f.required">*</span>
76+
</div>
77+
<el-select
78+
:teleported="false"
79+
v-if="
80+
modelValue['user_input_field_list'][f.field] &&
81+
trigger.trigger_type === 'EVENT' &&
82+
trigger.trigger_setting.body.length
83+
"
84+
v-model="modelValue['user_input_field_list'][f.field].source"
85+
size="small"
86+
style="width: 85px"
87+
>
88+
<el-option :label="$t('chat.quote')" value="reference"/>
89+
<el-option :label="$t('common.custom')" value="custom"/>
90+
</el-select>
91+
</div>
92+
</template>
93+
94+
<el-cascader
95+
v-if="modelValue['user_input_field_list'][f.field].source === 'reference'"
96+
v-model="modelValue['user_input_field_list'][f.field].value"
97+
:options="options"
98+
:placeholder="$t('common.selectPlaceholder')"
99+
:props="props"
100+
style="width: 100%"
101+
/>
102+
<el-input
103+
v-else
104+
v-model="modelValue['user_input_field_list'][f.field].value"
105+
:placeholder="$t('common.inputPlaceholder')"
106+
/>
107+
</el-form-item>
108+
</template>
60109
</el-form>
61110
</template>
62111
<script setup lang="ts">
63-
import { computed, ref, watch } from 'vue'
64-
import { type FormInstance } from 'element-plus'
112+
import {computed, ref, watch} from 'vue'
113+
import {type FormInstance} from 'element-plus'
114+
65115
const toolParameterFormRef = ref<FormInstance>()
66116
const props = defineProps<{ tool?: any; modelValue: any; trigger: any }>()
67117
const emit = defineEmits(['update:modelValue'])
@@ -81,10 +131,26 @@ watch(
81131
source: 'custom',
82132
}
83133
} else {
84-
parameter[f.field] = { source: 'custom', value: f.default_value }
134+
parameter[f.field] = {source: 'custom', value: f.default_value}
85135
}
86136
})
87-
emit('update:modelValue', { ...parameter })
137+
user_input_field_list.value.forEach((f) => {
138+
if (!parameter['user_input_field_list']) {
139+
parameter['user_input_field_list'] = {}
140+
}
141+
if (!parameter['user_input_field_list'][f.field]) {
142+
parameter['user_input_field_list'][f.field] = {
143+
source: 'custom',
144+
value: f.default_value ? f.default_value : '',
145+
}
146+
} else {
147+
parameter['user_input_field_list'][f.field] = {
148+
...parameter['user_input_field_list'][f.field],
149+
source: 'custom',
150+
}
151+
}
152+
})
153+
emit('update:modelValue', {...parameter})
88154
}
89155
},
90156
)
@@ -96,7 +162,7 @@ const options = computed(() => {
96162
{
97163
label: 'body',
98164
value: 'body',
99-
children: body.map((item: any) => ({ label: item.field, value: item.field })),
165+
children: body.map((item: any) => ({label: item.field, value: item.field})),
100166
},
101167
]
102168
}
@@ -113,7 +179,28 @@ const input_field_list = computed(() => {
113179
result.push({
114180
field: item.name,
115181
required: item.is_required,
116-
label: { value: item.name },
182+
label: {value: item.name},
183+
})
184+
})
185+
}
186+
return result
187+
})
188+
189+
const base_node = computed(() => {
190+
return (props.tool?.work_flow?.nodes || []).find((n: any) => n.type === 'tool-base-node')
191+
})
192+
193+
const user_input_field_list = computed(() => {
194+
const result: Array<any> = []
195+
if (base_node.value && base_node.value.properties.user_input_field_list) {
196+
base_node.value.properties.user_input_field_list.forEach((item: any) => {
197+
result.push({
198+
field: item.field,
199+
required: item.is_required,
200+
label:
201+
typeof item.label == 'string'
202+
? {value: item.label}
203+
: {...item.label, value: item.label.label},
117204
})
118205
})
119206
}
@@ -123,15 +210,26 @@ const input_field_list = computed(() => {
123210
const init_parameters = () => {
124211
const parameter: any = {}
125212
input_field_list.value.forEach((f) => {
126-
parameter[f.field] = { source: 'custom', value: f.default_value }
213+
parameter[f.field] = {source: 'custom', value: f.default_value}
214+
})
215+
user_input_field_list.value.forEach((f) => {
216+
if (!parameter['user_input_field_list']) {
217+
parameter['user_input_field_list'] = {}
218+
}
219+
if (!parameter['user_input_field_list'][f.field]) {
220+
parameter['user_input_field_list'][f.field] = {
221+
source: 'custom',
222+
value: f.default_value ? f.default_value : '',
223+
}
224+
}
127225
})
128-
emit('update:modelValue', { ...parameter, ...props.modelValue })
226+
emit('update:modelValue', {...parameter, ...props.modelValue})
129227
}
130228
131229
init_parameters()
132230
const validate = () => {
133231
return toolParameterFormRef.value?.validate()
134232
}
135-
defineExpose({ validate })
233+
defineExpose({validate})
136234
</script>
137235
<style lang="scss"></style>

0 commit comments

Comments
 (0)