diff --git a/ui/src/views/template/index.vue b/ui/src/views/template/index.vue index a9217bb04..fa5cd458a 100644 --- a/ui/src/views/template/index.vue +++ b/ui/src/views/template/index.vue @@ -2,37 +2,79 @@
-

供应商

+

供应商

+
    +
  • +
    + + 全部模型 +
    +
  • +
- - - + + + + + + + + + + + + + +
@@ -57,7 +99,8 @@ style="max-width: 240px" clearable /> - @@ -152,6 +195,8 @@ const model_search_form = ref<{ name: string, create_user: string, permission_ty const user_options = ref([]) const list_model_loading = ref(false) const provider_list = ref>([]) +const online_provider_list = ref>([]) +const local_provider_list = ref>([]) const model_list = ref>([]) @@ -186,7 +231,7 @@ const list_model = () => { ModelApi.getModel({ ...model_search_form.value, ...params }, list_model_loading).then((ok) => { model_list.value = ok.data const v = model_list.value.map((m) => ({ id: m.user_id, username: m.username })) - if (user_options.value.length === 0){ + if (user_options.value.length === 0) { user_options.value = Array.from( new Map(v.map(item => [item.id, item])).values() ) @@ -203,6 +248,17 @@ onMounted(() => { ModelApi.getProvider(loading).then((ok) => { active_provider.value = allObj provider_list.value = [allObj, ...ok.data] + + const local_provider = ['model_ollama_provider', 'model_local_provider', 'model_xinference_provider', 'model_vllm_provider'] + ok.data.forEach((item) => { + if (local_provider.indexOf(item.provider) > -1) { + local_provider_list.value.push(item) + } else { + online_provider_list.value.push(item) + } + }) + online_provider_list.value.sort((a, b) => a.provider.localeCompare(b.provider)) + local_provider_list.value.sort((a, b) => a.provider.localeCompare(b.provider)) list_model() }) })