refac: admin model setting include ollama info

This commit is contained in:
Timothy Jaeryang Baek 2024-11-18 07:04:21 -08:00
parent db6858582f
commit 9525d4279c

View File

@ -61,8 +61,10 @@
return workspaceModel; return workspaceModel;
} else { } else {
return { return {
...m,
id: m.id, id: m.id,
name: m.name, name: m.name,
is_active: true is_active: true
}; };
} }
@ -178,14 +180,26 @@
<div class=" flex-1 self-center {(model?.is_active ?? true) ? '' : 'text-gray-500'}"> <div class=" flex-1 self-center {(model?.is_active ?? true) ? '' : 'text-gray-500'}">
<Tooltip <Tooltip
content={marked.parse(model?.meta?.description ?? model.id)} content={marked.parse(
!!model?.meta?.description
? model?.meta?.description
: model?.ollama?.digest
? `${model.id} (${model?.ollama?.digest})`
: model.id
)}
className=" w-fit" className=" w-fit"
placement="top-start" placement="top-start"
> >
<div class=" font-semibold line-clamp-1">{model.name}</div> <div class=" font-semibold line-clamp-1">{model.name}</div>
</Tooltip> </Tooltip>
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1 text-gray-500"> <div class=" text-xs overflow-hidden text-ellipsis line-clamp-1 text-gray-500">
{model?.meta?.description ?? model.id} <span class=" line-clamp-1">
{!!model?.meta?.description
? model?.meta?.description
: model?.ollama?.digest
? `${model.id} (${model?.ollama?.digest})`
: model.id}
</span>
</div> </div>
</div> </div>
</button> </button>