mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-03 00:02:28 +08:00
refactor(frontend): 补充优化剩余组件
- 优化 TooltipContent 组件 - 改进 ModelsTab 和 UserModelDetailDrawer 组件
This commit is contained in:
@@ -13,6 +13,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
class: undefined,
|
||||
side: 'top',
|
||||
sideOffset: 4,
|
||||
align: 'center',
|
||||
|
||||
@@ -221,9 +221,9 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'edit-model': [model: Model]
|
||||
'delete-model': [model: Model]
|
||||
'batch-assign': []
|
||||
'editModel': [model: Model]
|
||||
'deleteModel': [model: Model]
|
||||
'batchAssign': []
|
||||
}>()
|
||||
|
||||
const { error: showError, success: showSuccess } = useToast()
|
||||
@@ -350,17 +350,17 @@ function getStatusTitle(model: Model): string {
|
||||
|
||||
// 编辑模型
|
||||
function editModel(model: Model) {
|
||||
emit('edit-model', model)
|
||||
emit('editModel', model)
|
||||
}
|
||||
|
||||
// 删除模型
|
||||
function deleteModel(model: Model) {
|
||||
emit('delete-model', model)
|
||||
emit('deleteModel', model)
|
||||
}
|
||||
|
||||
// 打开批量关联对话框
|
||||
function openBatchAssignDialog() {
|
||||
emit('batch-assign')
|
||||
emit('batchAssign')
|
||||
}
|
||||
|
||||
// 切换模型启用状态
|
||||
|
||||
@@ -370,7 +370,7 @@ const props = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:open': [value: boolean]
|
||||
'toggle-capability': [modelName: string, capName: string]
|
||||
'toggleCapability': [modelName: string, capName: string]
|
||||
}>()
|
||||
|
||||
const { success: showSuccess, error: showError } = useToast()
|
||||
@@ -383,12 +383,6 @@ interface Props {
|
||||
modelCapabilitySettings?: Record<string, Record<string, boolean>>
|
||||
}
|
||||
|
||||
// 根据能力名称获取显示名称
|
||||
function getCapabilityDisplayName(capName: string): string {
|
||||
const cap = props.capabilities?.find(c => c.name === capName)
|
||||
return cap?.display_name || capName
|
||||
}
|
||||
|
||||
// 获取模型支持的用户可配置能力
|
||||
function getModelUserConfigurableCapabilities(): CapabilityDefinition[] {
|
||||
if (!props.model?.supported_capabilities || !props.userConfigurableCapabilities) return []
|
||||
@@ -406,7 +400,7 @@ function isCapabilityEnabled(capName: string): boolean {
|
||||
// 切换能力
|
||||
function handleToggleCapability(capName: string) {
|
||||
if (!props.model) return
|
||||
emit('toggle-capability', props.model.name, capName)
|
||||
emit('toggleCapability', props.model.name, capName)
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
|
||||
Reference in New Issue
Block a user