diff --git a/ui/src/components/app-icon/index.ts b/ui/src/components/app-icon/index.ts index c18798afa..2f26344bc 100644 --- a/ui/src/components/app-icon/index.ts +++ b/ui/src/components/app-icon/index.ts @@ -75,6 +75,48 @@ export const iconMap: any = { ]) }, }, + 'app-magnify': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + style: { height: '100%', width: '100%' }, + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M366.165333 593.749333a21.333333 21.333333 0 0 1 30.208 0l30.165334 30.165334a21.333333 21.333333 0 0 1 0 30.208l-170.752 170.666666H377.173333a21.333333 21.333333 0 0 1 21.333334 21.333334v42.666666a21.333333 21.333333 0 0 1-21.333334 21.333334H156.458667a42.538667 42.538667 0 0 1-42.666667-42.666667v-220.16a21.333333 21.333333 0 0 1 21.333333-21.333333h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333333v113.493333l167.04-167.04z m500.992-480a42.538667 42.538667 0 0 1 42.666667 42.666667v220.16a21.333333 21.333333 0 0 1-21.333333 21.333333h-42.666667a21.333333 21.333333 0 0 1-21.333333-21.333333v-113.493333l-167.04 167.04a21.333333 21.333333 0 0 1-30.165334 0l-30.165333-30.165334a21.333333 21.333333 0 0 1 0-30.165333l170.709333-170.666667h-121.344a21.333333 21.333333 0 0 1-21.333333-21.333333v-42.666667a21.333333 21.333333 0 0 1 21.333333-21.333333h220.672z', + fill: 'currentColor', + }), + ], + ), + ]) + }, + }, + 'app-minify': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + style: { height: '100%', width: '100%' }, + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M384.341333 597.205333a42.538667 42.538667 0 0 1 42.666667 42.666667v220.16a21.333333 21.333333 0 0 1-21.333333 21.333333h-42.666667a21.333333 21.333333 0 0 1-21.333333-21.333333v-113.493333l-167.04 167.04a21.333333 21.333333 0 0 1-30.165334 0l-30.165333-30.208a21.333333 21.333333 0 0 1 0-30.165334l170.709333-170.666666H163.669333a21.333333 21.333333 0 0 1-21.333333-21.333334v-42.666666a21.333333 21.333333 0 0 1 21.333333-21.333334h220.672zM849.92 110.506667a21.333333 21.333333 0 0 1 30.165333 0l30.165334 30.165333a21.333333 21.333333 0 0 1 0 30.165333l-170.709334 170.666667h121.344a21.333333 21.333333 0 0 1 21.333334 21.333333v42.666667a21.333333 21.333333 0 0 1-21.333334 21.333333h-220.672a42.538667 42.538667 0 0 1-42.666666-42.666666v-220.16a21.333333 21.333333 0 0 1 21.333333-21.333334h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333334v113.493333l167.04-166.997333z', + fill: 'currentColor', + }), + ], + ), + ]) + }, + }, // 动态加载的图标 ...dynamicIcons, } diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index 5cfd49ed9..bd151885b 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -4,6 +4,8 @@ import LogoIcon from './logo/LogoIcon.vue' import SendIcon from './logo/SendIcon.vue' 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' export default { install(app: App) { app.component('LogoFull', LogoFull) @@ -11,5 +13,7 @@ export default { app.component('SendIcon', SendIcon) app.use(dynamicsForm) app.component('AppIcon', AppIcon) + app.component('LayoutContainer', LayoutContainer) + app.component('ContentContainer', ContentContainer) }, } diff --git a/ui/src/components/layout-container/ContentContainer.vue b/ui/src/components/layout-container/ContentContainer.vue new file mode 100644 index 000000000..d01ef295b --- /dev/null +++ b/ui/src/components/layout-container/ContentContainer.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/ui/src/components/layout-container/index.vue b/ui/src/components/layout-container/index.vue new file mode 100644 index 000000000..1c5c8ab03 --- /dev/null +++ b/ui/src/components/layout-container/index.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/ui/src/enums/model.ts b/ui/src/enums/model.ts new file mode 100644 index 000000000..6d073d932 --- /dev/null +++ b/ui/src/enums/model.ts @@ -0,0 +1,18 @@ +export enum PermissionType { + PRIVATE = 'common.private', + PUBLIC = 'common.public' +} +export enum PermissionDesc { + PRIVATE = 'views.model.templateForm.form.permissionType.privateDesc', + PUBLIC = 'views.model.templateForm.form.permissionType.publicDesc', +} + +export enum modelType { + EMBEDDING = 'views.model.modelType.EMBEDDING', + LLM = 'views.model.modelType.LLM', + STT = 'views.model.modelType.STT', + TTS = 'views.model.modelType.TTS', + IMAGE = 'views.model.modelType.IMAGE', + TTI = 'views.model.modelType.TTI', + RERANKER = 'views.model.modelType.RERANKER' +} diff --git a/ui/src/layout/layout-header/avatar/index.vue b/ui/src/layout/layout-header/avatar/index.vue index d9735792d..fb162488a 100644 --- a/ui/src/layout/layout-header/avatar/index.vue +++ b/ui/src/layout/layout-header/avatar/index.vue @@ -1,9 +1,9 @@ - diff --git a/ui/src/layout/layout-template/SimpleLayout.vue b/ui/src/layout/layout-template/SimpleLayout.vue new file mode 100644 index 000000000..a8635e2a8 --- /dev/null +++ b/ui/src/layout/layout-template/SimpleLayout.vue @@ -0,0 +1,18 @@ + + + + diff --git a/ui/src/layout/layout-template/index.scss b/ui/src/layout/layout-template/index.scss index 327f0c219..c48a10d48 100644 --- a/ui/src/layout/layout-template/index.scss +++ b/ui/src/layout/layout-template/index.scss @@ -22,14 +22,3 @@ padding-top: calc(var(--app-header-height) + 40px) !important; } } - -.sidebar-container { - box-sizing: border-box; - transition: width 0.28s; - width: var(--sidebar-width); - min-width: var(--sidebar-width); - background-color: var(--sidebar-bg-color); -} -.view-container { - width: calc(100% - var(--sidebar-width)); -} diff --git a/ui/src/router/modules/model.ts b/ui/src/router/modules/model.ts index b7b075a61..d9527b4a4 100644 --- a/ui/src/router/modules/model.ts +++ b/ui/src/router/modules/model.ts @@ -3,7 +3,7 @@ const ModelRouter = { name: 'model', meta: { title: 'views.model.title', permission: 'MODEL:READ' }, redirect: '/model', - component: () => import('@/layout/layout-template/MainLayout.vue'), + component: () => import('@/layout/layout-template/SimpleLayout.vue'), children: [ { path: '/model', diff --git a/ui/src/styles/element-plus.scss b/ui/src/styles/element-plus.scss index e6e06542d..f88cc3d8c 100644 --- a/ui/src/styles/element-plus.scss +++ b/ui/src/styles/element-plus.scss @@ -9,3 +9,11 @@ // --el-text-color-primary: #1f2329; // --el-font-line-height-primary: 22px; } + +.el-avatar { + --el-avatar-bg-color: var(--el-color-primary); + --el-avatar-size-small: 33px; + --el-avatar-border-radius: 6px; + cursor: pointer; + flex-shrink: 0; +} diff --git a/ui/src/views/model/component/CreateModelDialog.vue b/ui/src/views/model/component/CreateModelDialog.vue index 88791fe87..8b5c344d4 100644 --- a/ui/src/views/model/component/CreateModelDialog.vue +++ b/ui/src/views/model/component/CreateModelDialog.vue @@ -275,7 +275,7 @@ import type { FormRules } from 'element-plus' import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message' import { PermissionType, PermissionDesc } from '@/enums/model' import { input_type_list } from '@/components/dynamics-form/constructor/data' -import AddParamDrawer from '@/views/template/component/AddParamDrawer.vue' +import AddParamDrawer from '@/views/model/component/AddParamDrawer.vue' import { t } from '@/locales' const providerValue = ref() diff --git a/ui/src/views/model/component/ModelCard.vue b/ui/src/views/model/component/ModelCard.vue index 1b2237767..fd5299fe7 100644 --- a/ui/src/views/model/component/ModelCard.vue +++ b/ui/src/views/model/component/ModelCard.vue @@ -61,7 +61,7 @@
- +
{{ $t('views.model.download.downloading') }} @@ -125,8 +125,8 @@ import type { Provider, Model } from '@/api/type/model' import ModelApi from '@/api/model/model' import { computed, ref, onMounted, onBeforeUnmount } from 'vue' -import EditModel from '@/views/template/component/EditModel.vue' -import DownloadLoading from '@/components/loading/DownloadLoading.vue' +import EditModel from '@/views/model/component/EditModel.vue' +// import DownloadLoading from '@/components/loading/DownloadLoading.vue' import { MsgConfirm } from '@/utils/message' import { modelType } from '@/enums/model' import useStore from '@/stores' diff --git a/ui/src/views/model/component/Provider.vue b/ui/src/views/model/component/Provider.vue new file mode 100644 index 000000000..69c27231c --- /dev/null +++ b/ui/src/views/model/component/Provider.vue @@ -0,0 +1,3 @@ + diff --git a/ui/src/views/model/index.vue b/ui/src/views/model/index.vue index e2d9553b9..8de34f3fb 100644 --- a/ui/src/views/model/index.vue +++ b/ui/src/views/model/index.vue @@ -1,8 +1,7 @@ - + --> - {{ row.name }}
- + -->
-
-
-

{{ active_provider?.name }}

-
- - {{ $t('views.model.addModel') }} - -
-
-
- -
- - - - -
-
+ + +
+ + {{ $t('views.model.addModel') }} +
-
+ +
+ +
+ + + + +
+
+
+ + - --> +