fix: 优化 Dashboard 页面和类型定义

- Dashboard 页面样式调整
- 添加数据库相关 TypeScript 类型定义

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 13:53:53 +08:00
parent 7e2bf7b508
commit b894e9b21c
2 changed files with 98 additions and 11 deletions

View File

@@ -192,17 +192,8 @@ const topRequestsTab = ref<'general' | 'errors'>('general')
<h3 class="font-semibold text-lg">Active Agents</h3>
<div class="flex items-center gap-2">
<span class="text-sm text-gray-400">Errors</span>
<!-- 开启状态开关 -->
<div
class="w-10 h-5 rounded-full relative cursor-pointer transition-colors"
:class="agentErrorEnabled ? 'bg-primary-orange' : 'bg-dark-500'"
@click="agentErrorEnabled = !agentErrorEnabled"
>
<div
class="absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform"
:class="agentErrorEnabled ? 'right-0.5' : 'left-0.5'"
></div>
</div>
<!-- 使用 Element Plus 开关组件 -->
<el-switch v-model="agentErrorEnabled" class="error-switch" />
</div>
</div>
<div class="text-4xl font-bold mb-4">{{ displayStats.activeAgents }}</div>
@@ -394,3 +385,13 @@ const topRequestsTab = ref<'general' | 'errors'>('general')
</div>
</div>
</template>
<style scoped>
.error-switch {
--el-switch-on-color: #f97316;
--el-switch-off-color: #374151;
}
.error-switch :deep(.el-switch__action) {
background-color: white;
}
</style>

View File

@@ -43,3 +43,89 @@ export interface DbForm {
password: string
database: string
}
// Neo4j 图谱相关类型
export interface Neo4jLabel {
name: string
count: number
}
export interface Neo4jRelType {
name: string
count: number
}
export interface Neo4jGraphData {
labels: Neo4jLabel[]
relationshipTypes: Neo4jRelType[]
}
export interface Neo4jCheckResponse {
success: boolean
message: string
version?: string
databases?: string[]
databaseId?: string
name?: string
description?: string
graphs?: Neo4jGraphData
}
export interface Neo4jNodeProperty {
label: string
properties: {
name: string
type: string
}[]
}
export interface Neo4jRelProperty {
type: string
properties: {
name: string
type: string
}[]
}
export interface Neo4jNodeRequest {
uri?: string
host?: string
port?: number
username: string
password: string
database: string
label: string
limit?: number
}
export interface Neo4jNodesResponse {
success: boolean
message: string
nodes: any[]
properties: {
name: string
type: string
}[]
}
export interface Neo4jRelRequest {
uri?: string
host?: string
port?: number
username: string
password: string
database: string
relationshipType: string
limit?: number
}
export interface Neo4jRelationshipsResponse {
success: boolean
message: string
relationships: {
id: string
source: string
target: string
properties: any
}[]
}