refac
This commit is contained in:
1 parent
422a4768ea
commit
8927c9bb3d
3 files changed
+10
-4
No files matched your search
@@ -556,7 +556,7 @@ async def initialize_runtime_config(app: FastAPI):
|
|||||||
|
|
||||||
for tool_server_connection in connections:
|
for tool_server_connection in connections:
|
||||||
if tool_server_connection.get('type', 'openapi') == 'mcp':
|
if tool_server_connection.get('type', 'openapi') == 'mcp':
|
||||||
server_id = tool_server_connection.get('info', {}).get('id')
|
server_id = (tool_server_connection.get('info') or {}).get('id')
|
||||||
auth_type = tool_server_connection.get('auth_type', 'none')
|
auth_type = tool_server_connection.get('auth_type', 'none')
|
||||||
|
|
||||||
if server_id and auth_type in ('oauth_2.1', 'oauth_2.1_static'):
|
if server_id and auth_type in ('oauth_2.1', 'oauth_2.1_static'):
|
||||||
@@ -2257,7 +2257,7 @@ async def register_client(request, client_id: str) -> bool:
|
|||||||
tool_server_connections = await Config.get('tool_server.connections', []) or []
|
tool_server_connections = await Config.get('tool_server.connections', []) or []
|
||||||
for idx, conn in enumerate(tool_server_connections):
|
for idx, conn in enumerate(tool_server_connections):
|
||||||
if conn.get('type', 'openapi') == server_type:
|
if conn.get('type', 'openapi') == server_type:
|
||||||
info = conn.get('info', {})
|
info = conn.get('info') or {}
|
||||||
if info.get('id') == server_id:
|
if info.get('id') == server_id:
|
||||||
connection = conn
|
connection = conn
|
||||||
connection_idx = idx
|
connection_idx = idx
|
||||||
@@ -2275,7 +2275,7 @@ async def register_client(request, client_id: str) -> bool:
|
|||||||
try:
|
try:
|
||||||
if auth_type == 'oauth_2.1_static':
|
if auth_type == 'oauth_2.1_static':
|
||||||
# Static credentials: rebuild from admin-provided credentials + fresh metadata
|
# Static credentials: rebuild from admin-provided credentials + fresh metadata
|
||||||
info = connection.get('info', {})
|
info = connection.get('info') or {}
|
||||||
oauth_client_id = info.get('oauth_client_id') or ''
|
oauth_client_id = info.get('oauth_client_id') or ''
|
||||||
oauth_client_secret = info.get('oauth_client_secret') or ''
|
oauth_client_secret = info.get('oauth_client_secret') or ''
|
||||||
if not oauth_client_id or not oauth_client_secret:
|
if not oauth_client_id or not oauth_client_secret:
|
||||||
@@ -2312,7 +2312,7 @@ async def register_client(request, client_id: str) -> bool:
|
|||||||
connections[connection_idx] = {
|
connections[connection_idx] = {
|
||||||
**connection,
|
**connection,
|
||||||
'info': {
|
'info': {
|
||||||
**connection.get('info', {}),
|
**(connection.get('info') or {}),
|
||||||
'oauth_client_info': encrypt_data(oauth_client_info.model_dump(mode='json')),
|
'oauth_client_info': encrypt_data(oauth_client_info.model_dump(mode='json')),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ class ChatTitleIdResponse(BaseModel):
|
|||||||
updated_at: int
|
updated_at: int
|
||||||
created_at: int
|
created_at: int
|
||||||
last_read_at: int | None = None
|
last_read_at: int | None = None
|
||||||
|
snippet: str | None = None
|
||||||
|
|
||||||
|
|
||||||
class SharedChatResponse(BaseModel):
|
class SharedChatResponse(BaseModel):
|
||||||
|
|||||||
@@ -697,6 +697,11 @@
|
|||||||
<div class="text-ellipsis line-clamp-1 w-full">
|
<div class="text-ellipsis line-clamp-1 w-full">
|
||||||
{chat?.title}
|
{chat?.title}
|
||||||
</div>
|
</div>
|
||||||
|
{#if chat?.snippet}
|
||||||
|
<div class="text-xs text-gray-500 dark:text-gray-400 line-clamp-2 mt-0.5">
|
||||||
|
{chat.snippet}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user