mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-11 12:11:45 +00:00
Keep a connected tool card's title to the service name
The server adds the account to a tool's name so pickers can tell accounts apart; the card names the account on its own line already.
This commit is contained in:
1 parent
db63eae93f
commit
52217d43be
2 files changed
+13
-4
No files matched your search
@@ -12,8 +12,8 @@ const TOOLS = [
|
||||
{
|
||||
id: 'tg',
|
||||
name: 'telegram',
|
||||
displayName: 'Telegram',
|
||||
customName: '',
|
||||
displayName: 'Telegram · Alerts bot',
|
||||
customName: 'Telegram · Alerts bot',
|
||||
description: 'Send messages',
|
||||
status: true,
|
||||
config: {},
|
||||
|
||||
@@ -440,6 +440,15 @@ export default function Tools() {
|
||||
: undefined;
|
||||
// A catalog service reads as the catalog describes it;
|
||||
// a custom server keeps the description it came with.
|
||||
// The account is on the card's own line, so the title
|
||||
// drops the " · account" the server adds to tell
|
||||
// accounts apart in pickers.
|
||||
const fullName = tool.customName || tool.displayName;
|
||||
const title =
|
||||
connection &&
|
||||
fullName.startsWith(`${connection.name} · `)
|
||||
? connection.name
|
||||
: fullName;
|
||||
const description =
|
||||
connector && connector.publisher !== 'custom'
|
||||
? connectorDescription(t, connector)
|
||||
@@ -515,10 +524,10 @@ export default function Tools() {
|
||||
<div className="mt-[9px] px-1">
|
||||
<CardTitle
|
||||
as="h2"
|
||||
title={tool.customName || tool.displayName}
|
||||
title={title}
|
||||
className="truncate capitalize"
|
||||
>
|
||||
{tool.customName || tool.displayName}
|
||||
{title}
|
||||
</CardTitle>
|
||||
<CardDescription
|
||||
size="xs"
|
||||
|
||||
Reference in new issue
Block a user