|
@@ -69,19 +69,19 @@
|
|
/>
|
|
/>
|
|
<div class="flex flex-1 flex-col justify-around overflow-hidden">
|
|
<div class="flex flex-1 flex-col justify-around overflow-hidden">
|
|
<div class="text-[1.25rem] font-bold text-[#2E3238]" v-title>
|
|
<div class="text-[1.25rem] font-bold text-[#2E3238]" v-title>
|
|
- {{ row.basicConfigs.model }}
|
|
|
|
|
|
+ {{ row.name }}
|
|
</div>
|
|
</div>
|
|
<div class="flex">
|
|
<div class="flex">
|
|
<div
|
|
<div
|
|
class="flex h-[1.25rem] items-center justify-center rounded-[0.13rem] bg-gradient-to-r from-[#FF9E2D] to-[#FFB92D] px-[0.38rem] text-[0.63rem] font-bold text-[#ffffff]"
|
|
class="flex h-[1.25rem] items-center justify-center rounded-[0.13rem] bg-gradient-to-r from-[#FF9E2D] to-[#FFB92D] px-[0.38rem] text-[0.63rem] font-bold text-[#ffffff]"
|
|
>
|
|
>
|
|
- 大预言模型
|
|
|
|
|
|
+ {{ DictionaryStore.modelTypes.map.get(row.type) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mt-[0.25rem] ml-auto">
|
|
<div class="mt-[0.25rem] ml-auto">
|
|
<div
|
|
<div
|
|
- v-if="row.enable"
|
|
|
|
|
|
+ v-if="row.status == 1"
|
|
class="flex h-[1.56rem] w-[3.75rem] items-center justify-center rounded-[1.25rem] bg-gradient-to-r from-[#D5F9FE] to-[#E0DAFF] text-[0.75rem] font-bold text-[#1E3F92]"
|
|
class="flex h-[1.56rem] w-[3.75rem] items-center justify-center rounded-[1.25rem] bg-gradient-to-r from-[#D5F9FE] to-[#E0DAFF] text-[0.75rem] font-bold text-[#1E3F92]"
|
|
>
|
|
>
|
|
已启用
|
|
已启用
|
|
@@ -93,49 +93,52 @@
|
|
style="line-height: 1.4rem"
|
|
style="line-height: 1.4rem"
|
|
v-title="{ lines: 2 }"
|
|
v-title="{ lines: 2 }"
|
|
>
|
|
>
|
|
- {{ row.p3 }}
|
|
|
|
|
|
+ {{ row.description }}
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="mt-[0.5rem] flex items-center gap-[var(--czr-gap)] text-[0.75rem] text-[#6F7889]"
|
|
class="mt-[0.5rem] flex items-center gap-[var(--czr-gap)] text-[0.75rem] text-[#6F7889]"
|
|
>
|
|
>
|
|
- <div>(模型厂商)</div>
|
|
|
|
- <div>|</div>
|
|
|
|
- <div>上下文长度:{{ row.p5 }}</div>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ {{ DictionaryStore.modelProvides.map.get(row.pluginClass) }}
|
|
|
|
+ </div>
|
|
<div>|</div>
|
|
<div>|</div>
|
|
<div>(创建单位)</div>
|
|
<div>(创建单位)</div>
|
|
<div>|</div>
|
|
<div>|</div>
|
|
<div>(创建人)</div>
|
|
<div>(创建人)</div>
|
|
<div>|</div>
|
|
<div>|</div>
|
|
- <div>(更新时间)</div>
|
|
|
|
|
|
+ <div>{{ YMDHms(row.updateTime) }}</div>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="mt-[0.5rem] flex items-center gap-[var(--czr-gap)] text-[0.75rem] text-[#6F7889]"
|
|
class="mt-[0.5rem] flex items-center gap-[var(--czr-gap)] text-[0.75rem] text-[#6F7889]"
|
|
>
|
|
>
|
|
- <div>URL:74.10.28.118:8080</div>
|
|
|
|
- <div class="ml-auto" @click.stop="onSwitch(row)">
|
|
|
|
|
|
+ <div class="ml-auto" @click.capture.stop="onSwitch(row)">
|
|
<a-switch
|
|
<a-switch
|
|
- v-model:checked="row.enable"
|
|
|
|
|
|
+ v-model:checked="row.status"
|
|
checked-children="启用"
|
|
checked-children="启用"
|
|
un-checked-children="停用"
|
|
un-checked-children="停用"
|
|
|
|
+ :checked-value="1"
|
|
|
|
+ :un-checked-value="0"
|
|
size="small"
|
|
size="small"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- <el-tooltip content="编辑" effect="light" placement="top">
|
|
|
|
- <SvgIcon
|
|
|
|
- name="czr_edit"
|
|
|
|
- size="14"
|
|
|
|
- class="__hover"
|
|
|
|
- @click.stop="onEdit(row)"
|
|
|
|
- />
|
|
|
|
- </el-tooltip>
|
|
|
|
- <el-tooltip content="删除" effect="light" placement="top">
|
|
|
|
- <SvgIcon
|
|
|
|
- name="czr_del"
|
|
|
|
- size="16"
|
|
|
|
- class="__hover"
|
|
|
|
- @click.stop="onDel(row)"
|
|
|
|
- />
|
|
|
|
- </el-tooltip>
|
|
|
|
|
|
+ <template v-if="row.status == 0">
|
|
|
|
+ <el-tooltip content="编辑" effect="light" placement="top">
|
|
|
|
+ <SvgIcon
|
|
|
|
+ name="czr_edit"
|
|
|
|
+ size="14"
|
|
|
|
+ class="__hover"
|
|
|
|
+ @click.stop="onEdit(row)"
|
|
|
|
+ />
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ <el-tooltip content="删除" effect="light" placement="top">
|
|
|
|
+ <SvgIcon
|
|
|
|
+ name="czr_del"
|
|
|
|
+ size="16"
|
|
|
|
+ class="__hover"
|
|
|
|
+ @click.stop="onDel(row)"
|
|
|
|
+ />
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -156,7 +159,12 @@ import { debounce } from 'lodash'
|
|
import { useAppStore, useDialogStore, useDictionaryStore } from '@/stores'
|
|
import { useAppStore, useDialogStore, useDictionaryStore } from '@/stores'
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
import detailCom from './detail.vue'
|
|
import detailCom from './detail.vue'
|
|
-import { pluginGetInstanceList } from '@/api/modules/model'
|
|
|
|
|
|
+import {
|
|
|
|
+ pluginDel,
|
|
|
|
+ pluginGetInstanceList,
|
|
|
|
+ pluginUpdateStatus,
|
|
|
|
+} from '@/api/modules/model'
|
|
|
|
+import { YMDHms } from '@/utils/czr-util'
|
|
|
|
|
|
const AppStore = useAppStore()
|
|
const AppStore = useAppStore()
|
|
const DialogStore = useDialogStore()
|
|
const DialogStore = useDialogStore()
|
|
@@ -264,27 +272,49 @@ const onDel = (row: any) => {
|
|
title: '删除确认',
|
|
title: '删除确认',
|
|
content: `${row.p6}个应用正在使用该大模型,删除将导致不可用,请确认是否删除`,
|
|
content: `${row.p6}个应用正在使用该大模型,删除将导致不可用,请确认是否删除`,
|
|
onSubmit: () => {
|
|
onSubmit: () => {
|
|
- ElMessage.success('删除成功!')
|
|
|
|
- onSearch()
|
|
|
|
|
|
+ pluginDel(row.id)
|
|
|
|
+ .then(() => {
|
|
|
|
+ ElMessage.success('删除成功!')
|
|
|
|
+ })
|
|
|
|
+ .catch(({ message }: any) => {
|
|
|
|
+ ElMessage.error(message)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ onSearch()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const onSwitch = (row) => {
|
|
const onSwitch = (row) => {
|
|
- if (!row.enable) {
|
|
|
|
|
|
+ if (row.status == 1) {
|
|
DialogStore.confirm({
|
|
DialogStore.confirm({
|
|
title: '停用确认',
|
|
title: '停用确认',
|
|
content: `${row.p6}个应用正在使用该大模型,停用将导致不可用,请确认是否停用`,
|
|
content: `${row.p6}个应用正在使用该大模型,停用将导致不可用,请确认是否停用`,
|
|
onSubmit: () => {
|
|
onSubmit: () => {
|
|
- ElMessage.success('停用成功!')
|
|
|
|
- onSearch()
|
|
|
|
- },
|
|
|
|
- onCancel: () => {
|
|
|
|
- row.enable = !row.enable
|
|
|
|
|
|
+ pluginUpdateStatus({ ids: [row.id], status: 0 })
|
|
|
|
+ .then(() => {
|
|
|
|
+ ElMessage.success('停用成功!')
|
|
|
|
+ })
|
|
|
|
+ .catch(({ message }: any) => {
|
|
|
|
+ ElMessage.error(message)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ onSearch()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
+ onCancel: () => {},
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- ElMessage.success('启用成功!')
|
|
|
|
- onSearch()
|
|
|
|
|
|
+ pluginUpdateStatus({ ids: [row.id], status: 1 })
|
|
|
|
+ .then(() => {
|
|
|
|
+ ElMessage.success('启用成功!')
|
|
|
|
+ })
|
|
|
|
+ .catch(({ message }: any) => {
|
|
|
|
+ ElMessage.error(message)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ onSearch()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -293,6 +323,7 @@ onMounted(() => {
|
|
})
|
|
})
|
|
const initDictionary = () => {
|
|
const initDictionary = () => {
|
|
DictionaryStore.initModelTypes()
|
|
DictionaryStore.initModelTypes()
|
|
|
|
+ DictionaryStore.initModelProvides()
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|