From 09b31c460dbb78af173e0b3b905844dd25a3c47f Mon Sep 17 00:00:00 2001
From: Soulter <905617992@qq.com>
Date: Sun, 1 Mar 2026 19:37:26 +0800
Subject: [PATCH] feat: add ConfigRouteManagerDialog component for managing
routing configurations
- Implemented a new dialog component for managing routes associated with configurations, allowing users to view, delete, and save routes.
- Enhanced the ProviderSelector component with improved styling for better readability.
- Updated English and Chinese localization files to include new strings for the route manager and profile sidebar.
- Refactored ConfigPage.vue to integrate the new route management dialog and improve layout responsiveness.
- Added methods for handling route management, including fetching, saving, and removing routes.
---
astrbot/core/platform/astrbot_message.py | 35 +-
.../config/ConfigProfileSidebar.vue | 213 ++++++
.../config/ConfigRouteManagerDialog.vue | 236 +++++++
.../components/shared/ProviderSelector.vue | 1 +
.../i18n/locales/en-US/features/config.json | 20 +
.../i18n/locales/zh-CN/features/config.json | 20 +
dashboard/src/views/ConfigPage.vue | 666 +++++++++++++-----
7 files changed, 1016 insertions(+), 175 deletions(-)
create mode 100644 dashboard/src/components/config/ConfigProfileSidebar.vue
create mode 100644 dashboard/src/components/config/ConfigRouteManagerDialog.vue
diff --git a/astrbot/core/platform/astrbot_message.py b/astrbot/core/platform/astrbot_message.py
index 3db53fd48..e9f2267a8 100644
--- a/astrbot/core/platform/astrbot_message.py
+++ b/astrbot/core/platform/astrbot_message.py
@@ -48,18 +48,29 @@ class Group:
class AstrBotMessage:
- """AstrBot 的消息对象"""
+ """Represents a message received from the platform, after parsing and normalization.
+ This is the main message object that will be passed to plugins and handlers."""
- type: MessageType # 消息类型
- self_id: str # 机器人的识别id
- session_id: str # 会话id。取决于 unique_session 的设置。
- message_id: str # 消息id
- group: Group | None # 群组
- sender: MessageMember # 发送者
- message: list[BaseMessageComponent] # 消息链使用 Nakuru 的消息链格式
- message_str: str # 最直观的纯文本消息字符串
+ type: MessageType
+ """GroupMessage, FriendMessage, etc"""
+ self_id: str
+ """Bot's ID"""
+ session_id: str
+ """Session ID, which is the last part of UMO"""
+ message_id: str
+ """Message ID"""
+ group: Group | None
+ """The group info, None if it's a friend message"""
+ sender: MessageMember
+ """The sender info"""
+ message: list[BaseMessageComponent]
+ """Sorted list of message components after parsing"""
+ message_str: str
+ """The parsed message text after parsing, without any formatting or special components"""
raw_message: object
- timestamp: int # 消息时间戳
+ """The raw message object, the specific type depends on the platform"""
+ timestamp: int
+ """The timestamp when the message is received, in seconds"""
def __init__(self) -> None:
self.timestamp = int(time.time())
@@ -70,16 +81,12 @@ class AstrBotMessage:
@property
def group_id(self) -> str:
- """向后兼容的 group_id 属性
- 群组id,如果为私聊,则为空
- """
if self.group:
return self.group.group_id
return ""
@group_id.setter
def group_id(self, value: str | None) -> None:
- """设置 group_id"""
if value:
if self.group:
self.group.group_id = value
diff --git a/dashboard/src/components/config/ConfigProfileSidebar.vue b/dashboard/src/components/config/ConfigProfileSidebar.vue
new file mode 100644
index 000000000..4d5c6304d
--- /dev/null
+++ b/dashboard/src/components/config/ConfigProfileSidebar.vue
@@ -0,0 +1,213 @@
+
+