-
{{ extension.author }} /
+
+
+
+
+
-
- {{ extension.name }}
-
-
-
+
+
+
+
+
+
+
+
- {{ tm("card.status.hasUpdate") }}: {{ extension.online_version }}
-
-
-
-
-
- {{ tm("card.status.disabled") }}
-
-
-
-
-
- {{ extension.version }}
-
-
-
- {{ extension.online_version }}
-
-
-
- {{ extension.handlers?.length }}{{ tm("card.status.handlersCount") }}
-
-
- {{ tag === 'danger' ? tm('tags.danger') : tag }}
-
+
+
+ 📄 {{ tm('buttons.viewDocs') }}
+
+
+
+
+ {{ tm('buttons.install') }}
+
+
+
+ {{ tm('status.installed') }}
+
+
+
+
+
+
+
+
+ {{ tm('card.actions.pluginConfig') }}
+
+
+
+ {{ tm('card.actions.uninstallPlugin') }}
+
+
+
+ {{ tm('card.actions.reloadPlugin') }}
+
+
+
+
+ {{ extension.activated ? tm('buttons.disable') : tm('buttons.enable') }}{{
+ tm('card.actions.togglePlugin') }}
+
+
+
+
+ {{ tm('card.actions.viewHandlers') }} ({{ extension.handlers.length
+ }})
+
+
+
+
+ {{ tm('card.actions.updateTo') }} {{ extension.online_version || extension.version }}
+
+
+
+
+
-
- {{ extension.desc }}
+
+
+
+ {{ extension.author }} / {{ extension.name }}
+
+
+ {{ extension.name }}
+
+
+
+
+ {{ tm("card.status.hasUpdate") }}: {{ extension.online_version }}
+
+
+
+
+
+ {{ tm("card.status.disabled") }}
+
+
+
+
+
+
+ {{ extension.version }}
+
+
+
+ {{ extension.online_version }}
+
+
+
+ {{ extension.handlers?.length }}{{ tm("card.status.handlersCount") }}
+
+
+ {{ tag === 'danger' ? tm('tags.danger') : tag }}
+
+
+
+
+ {{ extension.desc }}
+
-
-
![]()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
![]()
-
{{ extension.name }}
-
-
-
-
- {{ tm("card.actions.pluginConfig") }}
-
-
-
- {{ tm("card.actions.uninstallPlugin") }}
-
-
-
- {{ tm("card.actions.reloadPlugin") }}
-
-
-
- {{ extension.activated ? tm('buttons.disable') : tm('buttons.enable') }}{{ tm("card.actions.togglePlugin") }}
-
-
-
- {{ tm("card.actions.viewHandlers") }} ({{ extension.handlers.length }})
-
-
-
- {{ tm("card.actions.updateTo") }} {{ extension.online_version || extension.version }}
-
-
-
-
-
-
-
-
-
diff --git a/dashboard/src/components/shared/ItemCard.vue b/dashboard/src/components/shared/ItemCard.vue
index 0b7c56a59..7c3013239 100644
--- a/dashboard/src/components/shared/ItemCard.vue
+++ b/dashboard/src/components/shared/ItemCard.vue
@@ -127,7 +127,6 @@ export default {
transition: all 0.3s ease;
overflow: hidden;
min-height: 220px;
- margin-bottom: 16px;
display: flex;
flex-direction: column;
justify-content: space-between;
diff --git a/dashboard/src/components/shared/PersonaForm.vue b/dashboard/src/components/shared/PersonaForm.vue
new file mode 100644
index 000000000..d98fad929
--- /dev/null
+++ b/dashboard/src/components/shared/PersonaForm.vue
@@ -0,0 +1,528 @@
+
+
+
+
+ {{ editingPersona ? tm('dialog.edit.title') : tm('dialog.create.title') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-tools
+ {{ tm('form.tools') }}
+
+ {{ personaForm.tools.length }}
+
+
+
+
+
+
+ {{ tm('form.toolsHelp') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ tm('form.mcpServersQuickSelect') }}
+
+
+ mdi-server
+ {{ server.name }}
+
+ ({{ server.tools.length }})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+ {{ item.mcp_server_name }}
+
+
+
+
+ {{ truncateText(item.description, 100) }}
+
+
+
+
+
+
+
+
mdi-tools
+
{{ tm('form.noToolsAvailable')
+ }}
+
+
+
+
+
mdi-magnify
+
{{ tm('form.noToolsFound') }}
+
+
+
+
+
+
+
{{ tm('form.loadingTools')
+ }}
+
+
+
+
+
+
+ {{ tm('form.selectedTools') }}
+
+ ({{ tm('form.allSelected') }})
+
+
+ ({{ personaForm.tools.length }})
+
+
+
+
+ {{ toolName }}
+
+
+
+ {{ tm('form.noToolsSelected') }}
+
+
+
+
+
+
+
+
+
+
+ mdi-chat
+ {{ tm('form.presetDialogs') }}
+
+ {{ personaForm.begin_dialogs.length / 2 }}
+
+
+
+
+
+
+ {{ tm('form.presetDialogsHelp') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ tm('buttons.addDialogPair') }}
+
+
+
+
+
+
+
+
+
+
+ {{ tm('buttons.cancel') }}
+
+
+ {{ tm('buttons.save') }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dashboard/src/components/shared/PersonaSelector.vue b/dashboard/src/components/shared/PersonaSelector.vue
index c4fbfa10d..c90ee2df2 100644
--- a/dashboard/src/components/shared/PersonaSelector.vue
+++ b/dashboard/src/components/shared/PersonaSelector.vue
@@ -18,7 +18,7 @@
选择人格
-
+
@@ -48,6 +48,9 @@
+
+ 创建新人格
+
取消
+
+
+
\ No newline at end of file
diff --git a/dashboard/src/layouts/full/vertical-sidebar/VerticalSidebar.vue b/dashboard/src/layouts/full/vertical-sidebar/VerticalSidebar.vue
index e1c9f62d8..aca21acad 100644
--- a/dashboard/src/layouts/full/vertical-sidebar/VerticalSidebar.vue
+++ b/dashboard/src/layouts/full/vertical-sidebar/VerticalSidebar.vue
@@ -12,7 +12,11 @@ const sidebarMenu = shallowRef(sidebarItems);
const showIframe = ref(false);
-// 默认桌面端 iframe 样式
+const sidebarWidth = ref(235);
+const minSidebarWidth = 200;
+const maxSidebarWidth = 300;
+const isResizing = ref(false);
+
const iframeStyle = ref({
position: 'fixed',
bottom: '16px',
@@ -29,14 +33,13 @@ const iframeStyle = ref({
boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.1)',
});
-// 如果为移动端,则采用百分比尺寸,并设置初始位置
if (window.innerWidth < 768) {
iframeStyle.value = {
position: 'fixed',
top: '10%',
left: '0%',
width: '100%',
- height: '50%',
+ height: '80%',
minWidth: '300px',
minHeight: '200px',
background: 'white',
@@ -46,7 +49,6 @@ if (window.innerWidth < 768) {
borderRadius: '12px',
boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.1)',
};
- // 移动端默认关闭侧边栏
customizer.Sidebar_drawer = false;
}
@@ -74,12 +76,10 @@ function openIframeLink(url) {
}
}
-// 拖拽相关变量与函数
let offsetX = 0;
let offsetY = 0;
let isDragging = false;
-// 辅助函数:限制数值在一定范围内
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
@@ -91,7 +91,6 @@ function startDrag(clientX, clientY) {
offsetX = clientX - rect.left;
offsetY = clientY - rect.top;
document.body.style.userSelect = 'none';
- // 绑定全局鼠标和触摸事件
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', onMouseUp);
document.addEventListener('touchmove', onTouchMove, { passive: false });
@@ -149,6 +148,34 @@ function endDrag() {
document.removeEventListener('touchend', onTouchEnd);
}
+function startSidebarResize(event) {
+ isResizing.value = true;
+ document.body.style.userSelect = 'none';
+ document.body.style.cursor = 'ew-resize';
+
+ const startX = event.clientX;
+ const startWidth = sidebarWidth.value;
+
+ function onMouseMoveResize(event) {
+ if (!isResizing.value) return;
+
+ const deltaX = event.clientX - startX;
+ const newWidth = Math.max(minSidebarWidth, Math.min(maxSidebarWidth, startWidth + deltaX));
+ sidebarWidth.value = newWidth;
+ }
+
+ function onMouseUpResize() {
+ isResizing.value = false;
+ document.body.style.userSelect = '';
+ document.body.style.cursor = '';
+ document.removeEventListener('mousemove', onMouseMoveResize);
+ document.removeEventListener('mouseup', onMouseUpResize);
+ }
+
+ document.addEventListener('mousemove', onMouseMoveResize);
+ document.addEventListener('mouseup', onMouseUpResize);
+}
+
@@ -159,7 +186,7 @@ function endDrag() {
rail-width="80"
app
class="leftSidebar"
- width="220"
+ :width="sidebarWidth"
:rail="customizer.mini_sidebar"
>
+
+
+
-
+
{{ t('core.navigation.drag') }}
-
-
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts b/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts
index 861a51e47..7dfe0d9a8 100644
--- a/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts
+++ b/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts
@@ -18,31 +18,26 @@ export interface menu {
// 在组件中使用时需要通过t()函数进行翻译
// 所有键名都使用 core.navigation.* 格式
const sidebarItem: menu[] = [
- {
- title: 'core.navigation.dashboard',
- icon: 'mdi-view-dashboard',
- to: '/dashboard/default'
- },
{
title: 'core.navigation.platforms',
- icon: 'mdi-message-processing',
- to: '/platforms',
+ icon: 'mdi-robot',
+ to: '/',
},
{
title: 'core.navigation.providers',
icon: 'mdi-creation',
to: '/providers',
},
+ {
+ title: 'core.navigation.config',
+ icon: 'mdi-cog',
+ to: '/config',
+ },
{
title: 'core.navigation.toolUse',
icon: 'mdi-function-variant',
to: '/tool-use'
},
- {
- title: 'core.navigation.persona',
- icon: 'mdi-heart',
- to: '/persona'
- },
{
title: 'core.navigation.extension',
icon: 'mdi-puzzle',
@@ -53,31 +48,42 @@ const sidebarItem: menu[] = [
icon: 'mdi-text-box-search',
to: '/alkaid/knowledge-base',
},
- {
- title: 'core.navigation.config',
- icon: 'mdi-cog',
- to: '/config',
- },
{
title: 'core.navigation.chat',
icon: 'mdi-chat',
to: '/chat'
},
{
- title: 'core.navigation.conversation',
- icon: 'mdi-database',
- to: '/conversation'
- },
- {
- title: 'core.navigation.sessionManagement',
- icon: 'mdi-account-group',
- to: '/session-management'
- },
- {
- title: 'core.navigation.console',
- icon: 'mdi-console',
- to: '/console'
- },
+ title: 'core.navigation.groups.more',
+ icon: 'mdi-dots-horizontal',
+ children: [
+ {
+ title: 'core.navigation.persona',
+ icon: 'mdi-heart',
+ to: '/persona'
+ },
+ {
+ title: 'core.navigation.conversation',
+ icon: 'mdi-database',
+ to: '/conversation'
+ },
+ {
+ title: 'core.navigation.sessionManagement',
+ icon: 'mdi-account-group',
+ to: '/session-management'
+ },
+ {
+ title: 'core.navigation.dashboard',
+ icon: 'mdi-view-dashboard',
+ to: '/dashboard/default'
+ },
+ {
+ title: 'core.navigation.console',
+ icon: 'mdi-console',
+ to: '/console'
+ },
+ ]
+ }
// {
// title: 'Project ATRI',
// icon: 'mdi-grain',
diff --git a/dashboard/src/router/MainRoutes.ts b/dashboard/src/router/MainRoutes.ts
index 29b3bf5e7..8fb328a20 100644
--- a/dashboard/src/router/MainRoutes.ts
+++ b/dashboard/src/router/MainRoutes.ts
@@ -3,13 +3,13 @@ const MainRoutes = {
meta: {
requiresAuth: true
},
- redirect: '/main/dashboard/default',
+ redirect: '/main/platforms',
component: () => import('@/layouts/full/FullLayout.vue'),
children: [
{
- name: 'Dashboard',
+ name: 'MainPage',
path: '/',
- component: () => import('@/views/dashboards/default/DefaultDashboard.vue')
+ component: () => import('@/views/PlatformPage.vue')
},
{
name: 'Extensions',
diff --git a/dashboard/src/views/ConfigPage.vue b/dashboard/src/views/ConfigPage.vue
index ef022d9d7..dbf47f624 100644
--- a/dashboard/src/views/ConfigPage.vue
+++ b/dashboard/src/views/ConfigPage.vue
@@ -11,12 +11,6 @@
-
-
-
-
@@ -37,38 +31,10 @@
-
-
-
- {{ metadata[key]['name'] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -118,7 +84,7 @@
- AstrBot 支持针对不同消息平台实例分别设置配置文件。默认会使用 `default` 配置。
+ AstrBot 支持针对不同机器人分别设置配置文件。默认会使用 `default` 配置。
新建配置文件
@@ -128,8 +94,6 @@
- 当前应用于: {{ formatUmop(config.umop) }}
-
{{ isEditingConfig ? '编辑配置文件' : '新建配置文件' }}
-
-
名称
- 应用于
-
-
-
-
- 指定消息平台...
-
-
-
-
-
-
-
-
-
-
-
-
-
UMO 格式: [platform_id]:[message_type]:[session_id]。通配符 * 或留空表示全部。使用 /sid 查看某个聊天的 UMO。
-
-
-
-
- 可视化
-
-
- 手动编辑
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 添加规则
-
-
-
-
-
-
-
-
-
-
-
-
- 预览:
- 未配置任何规则
-
-
- {{ rule }}
-
-
- 这些规则对应的会话将使用此配置文件。
-
-
-
-
-
-
-
取消
+ :disabled="!configFormData.name">
{{ isEditingConfig ? '更新' : '创建' }}
@@ -308,7 +138,7 @@