mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 15:06:04 +08:00
fix(webui): show WebChat conversations in history lists (#9910)
This commit is contained in:
@@ -119,16 +119,24 @@ class ConversationService:
|
||||
"""
|
||||
history_platform_ids = set(await self.db_helper.get_conversation_platform_ids())
|
||||
configured_platforms = self.core_lifecycle.astrbot_config.get("platform", [])
|
||||
return {
|
||||
"bots": [
|
||||
{
|
||||
"id": str(platform.get("id", "")),
|
||||
"type": str(platform.get("type", "")),
|
||||
}
|
||||
for platform in configured_platforms
|
||||
if platform.get("id") in history_platform_ids
|
||||
]
|
||||
}
|
||||
bots = [
|
||||
{
|
||||
"id": str(platform.get("id", "")),
|
||||
"type": str(platform.get("type", "")),
|
||||
}
|
||||
for platform in configured_platforms
|
||||
if platform.get("id") in history_platform_ids
|
||||
]
|
||||
|
||||
# WebChat is a built-in platform that the platform manager always
|
||||
# starts regardless of config, so expose it as a filterable bot ID even
|
||||
# when it is missing from the configured platform list.
|
||||
if "webchat" in history_platform_ids and not any(
|
||||
bot["id"] == "webchat" for bot in bots
|
||||
):
|
||||
bots.append({"id": "webchat", "type": "webchat"})
|
||||
|
||||
return {"bots": bots}
|
||||
|
||||
async def get_conversation_detail(self, data: object) -> dict:
|
||||
payload = self._payload(data)
|
||||
|
||||
@@ -803,7 +803,6 @@ export default {
|
||||
}
|
||||
|
||||
params.exclude_ids = 'astrbot';
|
||||
params.exclude_platforms = 'webchat';
|
||||
params.include_history = false;
|
||||
|
||||
const response = await conversationApi.list(params, {
|
||||
|
||||
@@ -419,7 +419,6 @@ async function fetchConversations() {
|
||||
params.umo = umoQuery.value.trim();
|
||||
} else {
|
||||
params.exclude_ids = "astrbot";
|
||||
params.exclude_platforms = "webchat";
|
||||
}
|
||||
if (selectedBotIds.value.length) {
|
||||
params.platforms = selectedBotIds.value.join(",");
|
||||
|
||||
Reference in New Issue
Block a user