feat(activity): promote Activity to top-level navigation

This commit is contained in:
matevip 2026-05-01 09:48:53 +08:00
parent 169a09506b
commit 91e231e7a5
6 changed files with 41 additions and 21 deletions

View File

@ -247,6 +247,7 @@ export default {
mcpServers: 'MCP Connections',
mcpConnections: 'MCP Connections',
toolsCatalog: 'Tools (Catalog)',
activity: 'Activity',
settingsGroup: 'Settings',
agents: 'Agents',
security: 'Security',

View File

@ -247,6 +247,7 @@ export default {
mcpServers: 'MCP 连接',
mcpConnections: 'MCP 连接',
toolsCatalog: '工具目录',
activity: '活动记录',
settingsGroup: '设置',
agents: '智能体',
security: '安全',

View File

@ -57,6 +57,12 @@ const router = createRouter({
},
// Tools 顶层入口已降级到 Settings ▸ Tools (Catalog) (RFC-090 Phase 1)
// 旧路径 /tools 由下方 redirect 兼容
{
path: 'activity',
name: 'Activity',
component: () => import('@/views/Security/Activity/index.vue'),
meta: { title: 'Activity' },
},
{
path: 'plugins',
name: 'Plugins',
@ -124,12 +130,8 @@ const router = createRouter({
component: () => import('@/views/Security/Members/index.vue'),
meta: { title: 'Settings - Members' },
},
{
path: 'activity',
name: 'SettingsActivity',
component: () => import('@/views/Security/Activity/index.vue'),
meta: { title: 'Settings - Activity' },
},
// RFC-090 Phase 4: Activity 提升到顶层 /activity下方 children-out
// 的 settings/activity redirect 兼容旧链接,此处不再注册子路由)
// Advanced (absorbed from top-level nav)
{
path: 'agent-context',
@ -206,7 +208,9 @@ const router = createRouter({
{ path: 'workspace', redirect: '/settings/agent-context' },
{ path: 'security/workspaces', redirect: '/settings/workspaces' },
{ path: 'security/members', redirect: '/settings/members' },
{ path: 'security/activity', redirect: '/settings/activity' },
// RFC-090 Phase 4: Activity 提升到顶层
{ path: 'security/activity', redirect: '/activity' },
{ path: 'settings/activity', redirect: '/activity' },
{ path: 'cron-jobs', redirect: '/settings/cron-jobs' },
{ path: 'datasources', redirect: '/settings/datasources' },
{ path: 'mcp-servers', redirect: '/settings/mcp-servers' },

View File

@ -1,12 +1,18 @@
<template>
<div class="settings-section">
<div class="section-header">
<div>
<h2 class="section-title">{{ t('security.activity.title') }}</h2>
<p class="section-desc">{{ t('security.activity.desc') }}</p>
</div>
</div>
<!-- RFC-090 Phase 4: Activity 提升到顶层路由 /activity但本组件
既保留 settings-section 内层结构以便旧 Settings 引用兼容
又用 mc-page-shell 包一层在顶层路由下显示完整页框 -->
<div class="mc-page-shell">
<div class="mc-page-frame">
<div class="mc-page-inner activity-page">
<div class="mc-page-header">
<div>
<div class="mc-page-kicker">{{ t('nav.activity') }}</div>
<h1 class="mc-page-title">{{ t('security.activity.title') }}</h1>
<p class="mc-page-desc">{{ t('security.activity.desc') }}</p>
</div>
</div>
<div class="settings-section activity-inner mc-surface-card">
<!-- Filters -->
<div class="filter-row">
<select v-model="filters.action" class="filter-select" @change="loadEvents">
@ -75,6 +81,9 @@
<button class="btn-secondary btn-sm" :disabled="page <= 1" @click="page--; loadEvents()">&laquo;</button>
<span class="page-info">{{ page }} / {{ Math.ceil(total / pageSize) }}</span>
<button class="btn-secondary btn-sm" :disabled="page >= Math.ceil(total / pageSize)" @click="page++; loadEvents()">&raquo;</button>
</div>
</div>
</div>
</div>
</div>
</template>
@ -127,6 +136,10 @@ onMounted(() => {
</style>
<style scoped>
/* RFC-090 Phase 4 — top-level standalone shell */
.activity-page { gap: 18px; }
.activity-inner { padding: 18px; }
.filter-row {
display: flex;
gap: 8px;

View File

@ -142,12 +142,7 @@ const sections = computed(() => [
label: t('security.sections.members', 'Members'),
icon: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>',
},
{
id: 'activity',
path: '/settings/activity',
label: t('security.sections.activity', 'Activity'),
icon: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>',
},
// RFC-090 Phase 4: Activity /activity
// Divider: Advanced
{ id: 'divider-advanced', path: '', label: t('settings.sections.advanced'), icon: '', isDivider: true },
{

View File

@ -343,6 +343,12 @@ const navGroups = computed(() => [
label: t('nav.plugins'),
icon: `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 3h-8v4h8V3z"/></svg>`,
},
// RFC-090 Phase 4: Activity
{
path: '/activity',
label: t('nav.activity'),
icon: `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>`,
},
],
},
{