fix: 优化 Dashboard 页面和类型定义
- Dashboard 页面样式调整 - 添加数据库相关 TypeScript 类型定义 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -192,17 +192,8 @@ const topRequestsTab = ref<'general' | 'errors'>('general')
|
|||||||
<h3 class="font-semibold text-lg">Active Agents</h3>
|
<h3 class="font-semibold text-lg">Active Agents</h3>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<span class="text-sm text-gray-400">Errors</span>
|
<span class="text-sm text-gray-400">Errors</span>
|
||||||
<!-- 开启状态开关 -->
|
<!-- 使用 Element Plus 开关组件 -->
|
||||||
<div
|
<el-switch v-model="agentErrorEnabled" class="error-switch" />
|
||||||
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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-4xl font-bold mb-4">{{ displayStats.activeAgents }}</div>
|
<div class="text-4xl font-bold mb-4">{{ displayStats.activeAgents }}</div>
|
||||||
@@ -394,3 +385,13 @@ const topRequestsTab = ref<'general' | 'errors'>('general')
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</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>
|
||||||
|
|||||||
@@ -43,3 +43,89 @@ export interface DbForm {
|
|||||||
password: string
|
password: string
|
||||||
database: 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
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user