2026-05-12 15:03:47 +08:00
|
|
|
|
<template>
|
2026-05-09 22:01:28 +08:00
|
|
|
|
<el-dialog v-model="visible" title="选择模型" width="1000px" :close-on-click-modal="false" @close="handleClose">
|
|
|
|
|
|
<div class="model-selector-header">
|
|
|
|
|
|
<div class="search-bar">
|
2026-05-11 13:48:20 +08:00
|
|
|
|
<el-input v-model="searchParams.modelName" placeholder="搜索模型名称" clearable @clear="handleSearch">
|
|
|
|
|
|
<template #prefix
|
|
|
|
|
|
><el-icon><Search /></el-icon
|
|
|
|
|
|
></template>
|
2026-05-09 22:01:28 +08:00
|
|
|
|
</el-input>
|
|
|
|
|
|
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-button type="success" @click="handleAddModel">+ 新建模型</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="model-list" v-loading="loading">
|
|
|
|
|
|
<el-empty v-if="!loading && modelList.length === 0" description="暂无模型数据" :image-size="100" />
|
|
|
|
|
|
<div v-else class="model-grid">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="model in modelList"
|
|
|
|
|
|
:key="model.id"
|
|
|
|
|
|
class="model-card"
|
2026-05-12 13:52:24 +08:00
|
|
|
|
:class="{ selected: selectedModel?.id === model.id, 'builtin-model': !model.apiKey }"
|
2026-05-09 22:01:28 +08:00
|
|
|
|
@click="handleSelectModel(model)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="model-card-header">
|
2026-05-12 16:43:46 +08:00
|
|
|
|
<div class="model-type">{{ getModelTypeName(model.modelType) }}</div>
|
2026-05-11 20:01:03 +08:00
|
|
|
|
<div class="model-badges">
|
2026-05-12 13:52:24 +08:00
|
|
|
|
<el-tag v-if="!model.apiKey" type="warning" size="small">内置模型</el-tag>
|
2026-05-11 20:01:03 +08:00
|
|
|
|
<el-icon v-if="selectedModel?.id === model.id" class="check-icon" color="#67c23a"><CircleCheck /></el-icon>
|
|
|
|
|
|
</div>
|
2026-05-09 22:01:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="model-card-body">
|
|
|
|
|
|
<h3 class="model-name">{{ model.modelName }}</h3>
|
|
|
|
|
|
<p class="model-url">{{ model.baseUrl }}</p>
|
|
|
|
|
|
<div class="model-status">
|
|
|
|
|
|
<el-tag :type="model.enabled === 1 ? 'success' : 'info'" size="small">
|
|
|
|
|
|
{{ model.enabled === 1 ? '已启用' : '已禁用' }}
|
|
|
|
|
|
</el-tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="pagination.total > 0" class="pagination-wrap">
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
|
v-model:current-page="pagination.pageNum"
|
|
|
|
|
|
v-model:page-size="pagination.pageSize"
|
|
|
|
|
|
:total="pagination.total"
|
|
|
|
|
|
:page-sizes="[10, 20, 50]"
|
|
|
|
|
|
layout="total, prev, pager, next"
|
|
|
|
|
|
small
|
|
|
|
|
|
@current-change="handlePageChange"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
|
<el-button @click="handleClose">取消</el-button>
|
|
|
|
|
|
<el-button type="primary" @click="handleConfirm" :disabled="!selectedModel">确定</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 新建模型弹窗 -->
|
2026-05-13 10:45:12 +08:00
|
|
|
|
<EditModule ref="editModuleRef" :model-types="modelTypes" :is-super-admin="isSuperAdmin" @refresh="handleRefresh" />
|
2026-05-11 20:01:03 +08:00
|
|
|
|
|
2026-05-12 13:52:24 +08:00
|
|
|
|
<!-- 内置模型 API Key 输入弹窗 -->
|
|
|
|
|
|
<el-dialog v-model="apiKeyDialogVisible" title="配置内置模型" width="500px" :close-on-click-modal="false" append-to-body>
|
2026-05-11 20:01:03 +08:00
|
|
|
|
<el-alert type="info" :closable="false" style="margin-bottom: 16px">
|
|
|
|
|
|
<template #title>
|
|
|
|
|
|
<div style="line-height: 1.6">
|
2026-05-12 13:52:24 +08:00
|
|
|
|
您选择的是内置模型,需要配置您自己的 API Key。<br />
|
2026-05-11 20:01:03 +08:00
|
|
|
|
系统将为您创建一个模型副本。
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-alert>
|
|
|
|
|
|
<el-form :model="apiKeyForm" :rules="apiKeyRules" ref="apiKeyFormRef" label-width="100px">
|
|
|
|
|
|
<el-form-item label="模型名称" prop="modelName">
|
|
|
|
|
|
<el-input v-model="apiKeyForm.modelName" placeholder="请输入模型名称" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="API Key" prop="apiKey">
|
|
|
|
|
|
<el-input v-model="apiKeyForm.apiKey" type="password" show-password placeholder="请输入您的 API Key" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
|
<el-button @click="apiKeyDialogVisible = false">取消</el-button>
|
|
|
|
|
|
<el-button type="primary" @click="handleCreatePrivateModel" :loading="creatingModel">确定</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dialog>
|
2026-05-09 22:01:28 +08:00
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-05-12 13:52:24 +08:00
|
|
|
|
import { ref, reactive, watch, onMounted } from 'vue';
|
2026-05-11 20:01:03 +08:00
|
|
|
|
import { ElMessage, type FormInstance, type FormRules } from 'element-plus';
|
2026-05-09 22:01:28 +08:00
|
|
|
|
import { Search, CircleCheck } from '@element-plus/icons-vue';
|
2026-05-13 16:00:52 +08:00
|
|
|
|
import { getModelModuleList, addModelModule, getModelTypeList, normalizeModelTypeOptions } from '/@/api/settings/modelConfig/modelModule';
|
2026-05-12 13:52:24 +08:00
|
|
|
|
import { checkIsSuperAdmin } from '/@/api/system/user/index';
|
2026-05-11 20:01:03 +08:00
|
|
|
|
import { getApiErrorMessage } from '/@/utils/request';
|
2026-05-13 16:00:52 +08:00
|
|
|
|
import EditModule from '/@/views/settings/modelConfig/modelModule/component/editModule.vue';
|
2026-05-09 22:01:28 +08:00
|
|
|
|
|
|
|
|
|
|
interface ModelItem {
|
|
|
|
|
|
id: string;
|
2026-05-11 20:01:03 +08:00
|
|
|
|
tenantId?: number;
|
2026-05-09 22:01:28 +08:00
|
|
|
|
modelName: string;
|
2026-05-12 16:43:46 +08:00
|
|
|
|
modelType: number;
|
2026-05-09 22:01:28 +08:00
|
|
|
|
baseUrl: string;
|
|
|
|
|
|
route: string;
|
|
|
|
|
|
httpMethod: string;
|
|
|
|
|
|
enabled: number;
|
2026-05-11 20:01:03 +08:00
|
|
|
|
apiKey?: string;
|
|
|
|
|
|
isPrivate?: number;
|
|
|
|
|
|
isChatModel?: number;
|
|
|
|
|
|
headMsg?: string;
|
|
|
|
|
|
form?: any;
|
|
|
|
|
|
requestMapping?: any;
|
|
|
|
|
|
responseMapping?: any;
|
|
|
|
|
|
maxConcurrency?: number;
|
|
|
|
|
|
queueLimit?: number;
|
|
|
|
|
|
timeoutSeconds?: number;
|
|
|
|
|
|
expectedSeconds?: number;
|
|
|
|
|
|
retryTimes?: number;
|
|
|
|
|
|
retryQueueMaxSeconds?: number;
|
|
|
|
|
|
autoCleanSeconds?: number;
|
|
|
|
|
|
remark?: string;
|
2026-05-09 22:01:28 +08:00
|
|
|
|
[key: string]: any;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
|
modelValue: boolean;
|
|
|
|
|
|
defaultModel?: ModelItem | null;
|
2026-05-12 15:03:47 +08:00
|
|
|
|
modelType?: number;
|
2026-05-09 22:01:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface Emits {
|
|
|
|
|
|
(e: 'update:modelValue', value: boolean): void;
|
|
|
|
|
|
(e: 'confirm', model: ModelItem): void;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
|
|
|
modelValue: false,
|
|
|
|
|
|
defaultModel: null,
|
2026-05-12 15:03:47 +08:00
|
|
|
|
modelType: 1,
|
2026-05-09 22:01:28 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<Emits>();
|
|
|
|
|
|
|
|
|
|
|
|
const visible = ref(false);
|
2026-05-11 13:48:20 +08:00
|
|
|
|
const searchParams = reactive({ modelName: '' });
|
2026-05-09 22:01:28 +08:00
|
|
|
|
const pagination = reactive({ pageNum: 1, pageSize: 10, total: 0 });
|
|
|
|
|
|
const modelList = ref<ModelItem[]>([]);
|
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
|
const selectedModel = ref<ModelItem | null>(null);
|
|
|
|
|
|
const editModuleRef = ref();
|
2026-05-13 10:45:12 +08:00
|
|
|
|
const isSuperAdmin = ref(false); // 鏄惁涓虹鐞嗗憳
|
|
|
|
|
|
const modelTypes = ref<Array<{ id: number | string; label: string }>>([]); // 妯″瀷绫诲瀷鍒楄〃
|
2026-05-09 22:01:28 +08:00
|
|
|
|
|
2026-05-12 13:52:24 +08:00
|
|
|
|
// 内置模型 API Key 配置
|
2026-05-11 20:01:03 +08:00
|
|
|
|
const apiKeyDialogVisible = ref(false);
|
|
|
|
|
|
const apiKeyFormRef = ref<FormInstance>();
|
|
|
|
|
|
const apiKeyForm = reactive({
|
|
|
|
|
|
modelName: '',
|
|
|
|
|
|
apiKey: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const apiKeyRules: FormRules = {
|
|
|
|
|
|
modelName: [{ required: true, message: '请输入模型名称', trigger: 'blur' }],
|
|
|
|
|
|
apiKey: [{ required: true, message: '请输入 API Key', trigger: 'blur' }],
|
|
|
|
|
|
};
|
|
|
|
|
|
const creatingModel = ref(false);
|
|
|
|
|
|
const systemModelToClone = ref<ModelItem | null>(null);
|
|
|
|
|
|
|
2026-05-12 13:52:24 +08:00
|
|
|
|
// 检查是否为管理员
|
|
|
|
|
|
const checkAdminStatus = async () => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const res: any = await checkIsSuperAdmin();
|
|
|
|
|
|
isSuperAdmin.value = res.data?.isSuperAdmin || false;
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
isSuperAdmin.value = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-09 22:01:28 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => props.modelValue,
|
|
|
|
|
|
(val) => {
|
|
|
|
|
|
visible.value = val;
|
|
|
|
|
|
if (val) {
|
|
|
|
|
|
selectedModel.value = props.defaultModel || null;
|
|
|
|
|
|
fetchModelList();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
watch(visible, (val) => {
|
|
|
|
|
|
if (!val) {
|
|
|
|
|
|
emit('update:modelValue', false);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const getModelTypeName = (type: number) => {
|
|
|
|
|
|
const typeMap: Record<number, string> = {
|
2026-05-11 20:01:03 +08:00
|
|
|
|
1: '推理模型',
|
|
|
|
|
|
2: '图片模型',
|
|
|
|
|
|
3: '音频模型',
|
2026-05-09 22:01:28 +08:00
|
|
|
|
};
|
|
|
|
|
|
return typeMap[type] || '未知类型';
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const fetchModelList = async () => {
|
|
|
|
|
|
loading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
pageNum: pagination.pageNum,
|
|
|
|
|
|
pageSize: pagination.pageSize,
|
2026-05-11 13:48:20 +08:00
|
|
|
|
modelName: searchParams.modelName || undefined,
|
2026-05-12 15:03:47 +08:00
|
|
|
|
modelType: props.modelType, // 使用传入的 modelType
|
2026-05-09 22:01:28 +08:00
|
|
|
|
};
|
2026-05-11 20:01:03 +08:00
|
|
|
|
const res: any = await getModelModuleList(params);
|
2026-05-09 22:01:28 +08:00
|
|
|
|
modelList.value = res.data?.list || [];
|
|
|
|
|
|
pagination.total = res.data?.total || 0;
|
2026-05-11 20:01:03 +08:00
|
|
|
|
} catch {
|
|
|
|
|
|
// 接口错误由 request 全局提示后端 message
|
2026-05-09 22:01:28 +08:00
|
|
|
|
modelList.value = [];
|
|
|
|
|
|
pagination.total = 0;
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
loading.value = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
|
|
|
pagination.pageNum = 1;
|
|
|
|
|
|
fetchModelList();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handlePageChange = () => {
|
|
|
|
|
|
fetchModelList();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSelectModel = (model: ModelItem) => {
|
2026-05-12 13:52:24 +08:00
|
|
|
|
// 如果是管理员,直接选中任何模型,不需要配置 API Key
|
|
|
|
|
|
if (isSuperAdmin.value) {
|
|
|
|
|
|
selectedModel.value = model;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 非管理员:判断是否是内置模型(apiKey 为空)
|
|
|
|
|
|
if (!model.apiKey) {
|
|
|
|
|
|
// 内置模型,需要用户配置 API Key
|
2026-05-11 20:01:03 +08:00
|
|
|
|
systemModelToClone.value = model;
|
2026-05-12 11:24:42 +08:00
|
|
|
|
apiKeyForm.modelName = model.modelName;
|
2026-05-11 20:01:03 +08:00
|
|
|
|
apiKeyForm.apiKey = '';
|
|
|
|
|
|
apiKeyDialogVisible.value = true;
|
|
|
|
|
|
} else {
|
2026-05-12 13:52:24 +08:00
|
|
|
|
// 用户模型,直接选中
|
2026-05-11 20:01:03 +08:00
|
|
|
|
selectedModel.value = model;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleCreatePrivateModel = async () => {
|
|
|
|
|
|
if (!apiKeyFormRef.value || !systemModelToClone.value) return;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
await apiKeyFormRef.value.validate();
|
|
|
|
|
|
|
|
|
|
|
|
creatingModel.value = true;
|
|
|
|
|
|
|
2026-05-12 13:52:24 +08:00
|
|
|
|
// 基于内置模型创建新模型(继承原模型的所有配置,只替换 apiKey)
|
2026-05-11 20:01:03 +08:00
|
|
|
|
const systemModel = systemModelToClone.value;
|
|
|
|
|
|
const createParams = {
|
|
|
|
|
|
modelName: apiKeyForm.modelName,
|
2026-05-12 16:43:46 +08:00
|
|
|
|
modelType: systemModel.modelType,
|
2026-05-11 20:01:03 +08:00
|
|
|
|
baseUrl: systemModel.baseUrl,
|
|
|
|
|
|
httpMethod: systemModel.httpMethod || 'POST',
|
|
|
|
|
|
headMsg: systemModel.headMsg || '',
|
|
|
|
|
|
isPrivate: systemModel.isPrivate ?? 1, // 继承原模型的公有/私有属性
|
|
|
|
|
|
enabled: systemModel.enabled ?? 1,
|
|
|
|
|
|
isChatModel: systemModel.isChatModel || 0,
|
|
|
|
|
|
apiKey: apiKeyForm.apiKey, // 使用用户输入的新 API Key
|
|
|
|
|
|
form: systemModel.form || {},
|
|
|
|
|
|
requestMapping: systemModel.requestMapping || {},
|
|
|
|
|
|
responseMapping: systemModel.responseMapping || {},
|
2026-05-13 10:45:12 +08:00
|
|
|
|
responseBody: systemModel.responseBody || {}, // 杩斿洖涓讳綋瀛楁
|
2026-05-11 20:01:03 +08:00
|
|
|
|
maxConcurrency: systemModel.maxConcurrency || 10,
|
|
|
|
|
|
queueLimit: systemModel.queueLimit || 100,
|
|
|
|
|
|
timeoutSeconds: systemModel.timeoutSeconds || 30,
|
|
|
|
|
|
expectedSeconds: systemModel.expectedSeconds || 15,
|
|
|
|
|
|
retryTimes: systemModel.retryTimes || 3,
|
|
|
|
|
|
retryQueueMaxSeconds: systemModel.retryQueueMaxSeconds || 60,
|
|
|
|
|
|
autoCleanSeconds: systemModel.autoCleanSeconds || 300,
|
|
|
|
|
|
remark: systemModel.remark || '',
|
2026-05-13 10:45:12 +08:00
|
|
|
|
tokenMapping: systemModel.tokenMapping || '', // Token鏄犲皠瀛楁
|
2026-05-11 20:01:03 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const res: any = await addModelModule(createParams);
|
|
|
|
|
|
|
|
|
|
|
|
ElMessage.success('模型创建成功');
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭对话框
|
|
|
|
|
|
apiKeyDialogVisible.value = false;
|
|
|
|
|
|
|
|
|
|
|
|
// 刷新列表
|
|
|
|
|
|
await fetchModelList();
|
|
|
|
|
|
|
|
|
|
|
|
// 选中新创建的模型
|
|
|
|
|
|
const newModelId = res.data?.id || res.data;
|
|
|
|
|
|
if (newModelId) {
|
|
|
|
|
|
const newModel = modelList.value.find((m) => m.id === String(newModelId));
|
|
|
|
|
|
if (newModel) {
|
|
|
|
|
|
selectedModel.value = newModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (error: any) {
|
|
|
|
|
|
if (error !== 'cancel') {
|
|
|
|
|
|
ElMessage.error(getApiErrorMessage(error, '创建模型失败'));
|
|
|
|
|
|
}
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
creatingModel.value = false;
|
|
|
|
|
|
}
|
2026-05-09 22:01:28 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleAddModel = () => {
|
|
|
|
|
|
editModuleRef.value?.openDialog('add');
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleRefresh = () => {
|
|
|
|
|
|
fetchModelList();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleConfirm = () => {
|
|
|
|
|
|
if (selectedModel.value) {
|
|
|
|
|
|
emit('confirm', selectedModel.value);
|
|
|
|
|
|
handleClose();
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
|
visible.value = false;
|
|
|
|
|
|
selectedModel.value = null;
|
2026-05-11 20:01:03 +08:00
|
|
|
|
apiKeyDialogVisible.value = false;
|
|
|
|
|
|
systemModelToClone.value = null;
|
2026-05-09 22:01:28 +08:00
|
|
|
|
};
|
2026-05-12 13:52:24 +08:00
|
|
|
|
|
2026-05-13 10:45:12 +08:00
|
|
|
|
// 鍔犺浇妯″瀷绫诲瀷鍒楄〃
|
|
|
|
|
|
const loadModelTypes = async () => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const res: any = await getModelTypeList();
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
modelTypes.value = normalizeModelTypeOptions(res);
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
// 鎺ュ彛閿欒鐢?request 鍏ㄥ眬鎻愮ず鍚庣 message
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2026-05-12 13:52:24 +08:00
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
checkAdminStatus();
|
2026-05-13 10:45:12 +08:00
|
|
|
|
loadModelTypes();
|
2026-05-12 13:52:24 +08:00
|
|
|
|
});
|
2026-05-09 22:01:28 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
.model-selector-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search-bar {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-list {
|
|
|
|
|
|
min-height: 300px;
|
|
|
|
|
|
max-height: 400px;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-grid {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
|
|
|
|
gap: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-card {
|
|
|
|
|
|
background: #f8fafc;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 16px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
|
border: 2px solid transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-card:hover {
|
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
transform: translateY(-2px);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-card.selected {
|
|
|
|
|
|
border-color: #67c23a;
|
|
|
|
|
|
background: #f0f9ff;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-12 13:52:24 +08:00
|
|
|
|
.model-card.builtin-model {
|
2026-05-11 20:01:03 +08:00
|
|
|
|
border-color: #fbbf24;
|
|
|
|
|
|
background: #fffbeb;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-12 13:52:24 +08:00
|
|
|
|
.model-card.builtin-model:hover {
|
2026-05-11 20:01:03 +08:00
|
|
|
|
border-color: #f59e0b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-09 22:01:28 +08:00
|
|
|
|
.model-card-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-type {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
padding: 2px 8px;
|
|
|
|
|
|
background: #eff6ff;
|
|
|
|
|
|
color: #3b82f6;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-11 20:01:03 +08:00
|
|
|
|
.model-badges {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-09 22:01:28 +08:00
|
|
|
|
.check-icon {
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-card-body {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-name {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #1f2937;
|
|
|
|
|
|
margin: 0 0 8px 0;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-url {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
color: #64748b;
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
margin: 0 0 8px 0;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-status {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pagination-wrap {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|