feat(console): 添加控制台UI界面及功能组件
实现BLS项目控制台UI界面,包含以下主要功能: - 项目选择器组件,支持项目筛选和选择 - 控制台组件,支持命令输入和日志显示 - 调试区域组件,展示调试信息 - 响应式布局设计,适配PC和移动端 - 日志管理功能,限制最多1000条记录 - 更新路由配置和全局样式
This commit is contained in:
69
src/frontend/views/MainView.vue
Normal file
69
src/frontend/views/MainView.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div class="main-view">
|
||||
<!-- 控制台区域 -->
|
||||
<section class="console-section">
|
||||
<Console />
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import Console from '../components/Console.vue';
|
||||
|
||||
// 选中的项目ID,用于在组件间共享状态
|
||||
const selectedProjectId = ref('all');
|
||||
|
||||
// 接收来自项目选择器的项目选择事件
|
||||
const handleProjectSelected = (project) => {
|
||||
selectedProjectId.value = project.id;
|
||||
console.log('选中项目:', project);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.console-section {
|
||||
background-color: transparent;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.console-section .console {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.main-view {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.console-section {
|
||||
height: 100%;
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
.console-section .console {
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
27
src/frontend/views/SidebarView.vue
Normal file
27
src/frontend/views/SidebarView.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="sidebar-view">
|
||||
<ProjectSelector :selectedProjectId="selectedProjectId" @project-selected="handleProjectSelected" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import ProjectSelector from '../components/ProjectSelector.vue';
|
||||
|
||||
// 选中的项目ID
|
||||
const selectedProjectId = ref('all');
|
||||
|
||||
// 项目选择事件
|
||||
const handleProjectSelected = (project) => {
|
||||
selectedProjectId.value = project.id;
|
||||
console.log('选中项目:', project);
|
||||
// 这里可以通过事件总线或状态管理工具将选中的项目传递给其他组件
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sidebar-view {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user