Merge branch 'main' of github.com:maxkb-dev/maxkb
This commit is contained in:
commit
cfc9c4cfd7
@ -216,6 +216,20 @@ const getApplicationHitTest: (
|
|||||||
return get(`${prefix}/${application_id}/hit_test`, data, loading)
|
return get(`${prefix}/${application_id}/hit_test`, data, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户可使用的模型列表
|
||||||
|
* @param application_id
|
||||||
|
* @param loading
|
||||||
|
* @query { query_text: string, top_number: number, similarity: number }
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const getApplicationModel: (
|
||||||
|
application_id: string,
|
||||||
|
loading?: Ref<boolean>
|
||||||
|
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||||
|
return get(`${prefix}/${application_id}/model`, loading)
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getAllAppilcation,
|
getAllAppilcation,
|
||||||
getApplication,
|
getApplication,
|
||||||
@ -232,5 +246,6 @@ export default {
|
|||||||
postAppAuthentication,
|
postAppAuthentication,
|
||||||
getProfile,
|
getProfile,
|
||||||
putChatVote,
|
putChatVote,
|
||||||
getApplicationHitTest
|
getApplicationHitTest,
|
||||||
|
getApplicationModel
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
effect="dark"
|
effect="dark"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
>
|
>
|
||||||
<div ref="tagLabel" class="auto-tooltip">
|
<div ref="tagLabel" :class="['auto-tooltip', className]" :style="style">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -13,6 +13,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, nextTick } from 'vue'
|
import { ref, computed, onMounted, nextTick } from 'vue'
|
||||||
defineOptions({ name: 'AutoTooltip' })
|
defineOptions({ name: 'AutoTooltip' })
|
||||||
|
const props = defineProps({ className: String, style: Object })
|
||||||
const tagLabel = ref()
|
const tagLabel = ref()
|
||||||
const containerWeight = ref(0)
|
const containerWeight = ref(0)
|
||||||
const contentWeight = ref(0)
|
const contentWeight = ref(0)
|
||||||
|
|||||||
@ -8,7 +8,9 @@
|
|||||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||||
</AppAvatar>
|
</AppAvatar>
|
||||||
</slot>
|
</slot>
|
||||||
<h4 class="ellipsis-1" style="width: 65%">{{ title }}</h4>
|
<auto-tooltip :content="title" style="width: 65%">
|
||||||
|
{{ title }}
|
||||||
|
</auto-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
@ -76,6 +78,7 @@ function cardLeave() {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-footer {
|
.card-footer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 8px;
|
bottom: 8px;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs">
|
<el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs">
|
||||||
<AutoTooltip :content="tooltipContent">
|
<auto-tooltip :content="tooltipContent">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</AutoTooltip>
|
</auto-tooltip>
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@ -211,7 +211,7 @@
|
|||||||
<el-col
|
<el-col
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:md="12"
|
:md="24"
|
||||||
:lg="12"
|
:lg="12"
|
||||||
:xl="12"
|
:xl="12"
|
||||||
class="mb-8"
|
class="mb-8"
|
||||||
@ -464,15 +464,27 @@ function getDataset() {
|
|||||||
|
|
||||||
function getModel() {
|
function getModel() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
model
|
if (id) {
|
||||||
.asyncGetModel()
|
applicationApi
|
||||||
.then((res: any) => {
|
.getApplicationModel(id)
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
.then((res: any) => {
|
||||||
loading.value = false
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
loading.value = false
|
||||||
.catch(() => {
|
})
|
||||||
loading.value = false
|
.catch(() => {
|
||||||
})
|
loading.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
model
|
||||||
|
.asyncGetModel()
|
||||||
|
.then((res: any) => {
|
||||||
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProvider() {
|
function getProvider() {
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<el-col
|
<el-col
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="12"
|
:sm="12"
|
||||||
:md="8"
|
:md="12"
|
||||||
:lg="8"
|
:lg="8"
|
||||||
:xl="6"
|
:xl="6"
|
||||||
v-for="(item, index) in paragraphDetail"
|
v-for="(item, index) in paragraphDetail"
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<el-col
|
<el-col
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:md="12"
|
:md="24"
|
||||||
:lg="12"
|
:lg="12"
|
||||||
:xl="12"
|
:xl="12"
|
||||||
class="mb-16"
|
class="mb-16"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user