diff --git a/ui/src/api/model/model.ts b/ui/src/api/model/model.ts index 146a399d6..55929aad9 100644 --- a/ui/src/api/model/model.ts +++ b/ui/src/api/model/model.ts @@ -1,28 +1,26 @@ - import { Result } from '@/request/Result' import { get, post, del, put } from '@/request/index' import { type Ref } from 'vue' import type { ListModelRequest, Model, - BaseModel, CreateModelRequest, EditModelRequest, } from '@/api/type/model' import type { FormField } from '@/components/dynamics-form/type' -import type { KeyValue } from '../type/common' -const prefix = '/model' -const prefix_provider = '/provider' + +const prefix = '/workspace' /** * 获得模型列表 * @params 参数 name, model_type, model_name */ const getModel: ( + wordspace_id: string, request?: ListModelRequest, loading?: Ref, -) => Promise>> = (data, loading) => { - return get(`${prefix}`, data, loading) +) => Promise>> = (wordspace_id, data, loading) => { + return get(`${prefix}/${wordspace_id}/model`, data, loading) } /** @@ -37,42 +35,6 @@ const getModelParamsForm: ( ) => Promise>> = (model_id, loading) => { return get(`model/${model_id}/model_params_form`, {}, loading) } -/** - * 获取模型类型列表 - * @param provider 供应商 - * @param loading 加载器 - * @returns 模型类型列表 - */ -const listModelType: ( - provider: string, - loading?: Ref, -) => Promise>>> = (provider, loading?: Ref) => { - return get(`${prefix_provider}/model_type_list`, { provider }, loading) -} - -/** - * 获取基础模型列表 - * @param provider - * @param model_type - * @param loading - * @returns - */ -const listBaseModel: ( - provider: string, - model_type: string, - loading?: Ref, -) => Promise>> = (provider, model_type, loading) => { - return get(`${prefix_provider}/model_list`, { provider, model_type }, loading) -} - -const listBaseModelParamsForm: ( - provider: string, - model_type: string, - model_name: string, - loading?: Ref, -) => Promise>> = (provider, model_type, model_name, loading) => { - return get(`${prefix_provider}/model_params_form`, { provider, model_type, model_name }, loading) -} /** * 创建模型 @@ -159,9 +121,6 @@ const deleteModel: (model_id: string, loading?: Ref) => Promise Promise>> = (provider, model_type, model_name, loading) => { return get(`${prefix_provider}/model_form`, { provider, model_type, model_name }, loading) } + +/** + * 获取模型类型列表 + * @param provider 供应商 + * @param loading 加载器 + * @returns 模型类型列表 + */ +const listModelType: ( + provider: string, + loading?: Ref, +) => Promise>>> = (provider, loading?: Ref) => { + return get(`${prefix_provider}/model_type_list`, { provider }, loading) +} + +/** + * 获取基础模型列表 + * @param provider + * @param model_type + * @param loading + * @returns + */ +const listBaseModel: ( + provider: string, + model_type: string, + loading?: Ref, +) => Promise>> = (provider, model_type, loading) => { + return get(`${prefix_provider}/model_list`, { provider, model_type }, loading) +} + +const listBaseModelParamsForm: ( + provider: string, + model_type: string, + model_name: string, + loading?: Ref, +) => Promise>> = (provider, model_type, model_name, loading) => { + return get(`${prefix_provider}/model_params_form`, { provider, model_type, model_name }, loading) +} export default { getProvider, getModelCreateForm, getProviderByModelType, + listModelType, + listBaseModel, + listBaseModelParamsForm, } diff --git a/ui/src/assets/icon_document.svg b/ui/src/assets/icon_document.svg new file mode 100644 index 000000000..34fe1b36f --- /dev/null +++ b/ui/src/assets/icon_document.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ui/src/components/card-box/index.vue b/ui/src/components/card-box/index.vue new file mode 100644 index 000000000..e8c090e05 --- /dev/null +++ b/ui/src/components/card-box/index.vue @@ -0,0 +1,110 @@ + + + diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index bd151885b..76bfccd83 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -6,6 +6,7 @@ import dynamicsForm from './dynamics-form' import AppIcon from './app-icon/AppIcon.vue' import LayoutContainer from './layout-container/index.vue' import ContentContainer from './layout-container/ContentContainer.vue' +import CardBox from './card-box/index.vue' export default { install(app: App) { app.component('LogoFull', LogoFull) @@ -15,5 +16,6 @@ export default { app.component('AppIcon', AppIcon) app.component('LayoutContainer', LayoutContainer) app.component('ContentContainer', ContentContainer) + app.component('CardBox', CardBox) }, } diff --git a/ui/src/components/layout-container/ContentContainer.vue b/ui/src/components/layout-container/ContentContainer.vue index d01ef295b..b76b0a30f 100644 --- a/ui/src/components/layout-container/ContentContainer.vue +++ b/ui/src/components/layout-container/ContentContainer.vue @@ -42,7 +42,7 @@ const showBack = computed(() => { .content-container__main { // background-color: var(--app-view-bg-color); box-sizing: border-box; - min-width: 847px; + min-width: 447px; } } diff --git a/ui/src/components/layout-container/index.vue b/ui/src/components/layout-container/index.vue index 1c5c8ab03..fa604a048 100644 --- a/ui/src/components/layout-container/index.vue +++ b/ui/src/components/layout-container/index.vue @@ -1,6 +1,6 @@