feat: 管理员页面整合与侧边栏导航优化
- 完成系统管理页面与导航整合 - 在 users.html/topics.html/logs.html 侧边栏与移动导航添加系统管理入口 - 创建 admin.html 管理页面(案例/任务日志/LLM配置/系统配置) - 新增核心模块:collector.py(数据采集器)、scheduler.py(任务调度器) - 新增脚本:collector_db_integration.py(采集器数据库整合) - 更新项目文档并验证路由注册
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
<el-date-picker v-model="logDate" type="date" placeholder="选择日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default"></el-date-picker>
|
||||
<el-button type="primary" @click="fetchLogs" :loading="loadingLogs">加载日志</el-button>
|
||||
</div>
|
||||
<el-card v-if="logContent" class="font-mono text-sm bg-gray-50" style="max-height: 600px; overflow-y: auto; background: #f9fafb; border: 1px solid #e5e7eb;"><pre style="margin: 0; white-space: pre-wrap; word-wrap: break-word;">{{ logContent }}</pre></el-card>
|
||||
<el-card v-if="logContent" ref="logContainer" class="font-mono text-sm bg-gray-50" style="max-height: 600px; overflow-y: auto; background: #f9fafb; border: 1px solid #e5e7eb;"><pre style="margin: 0; white-space: pre-wrap; word-wrap: break-word;">{{ logContent }}</pre></el-card>
|
||||
<el-empty v-else description="请先选择类型和日期,然后点击加载"></el-empty>
|
||||
</div>
|
||||
</main>
|
||||
@@ -88,7 +88,17 @@
|
||||
<script src="element-plus.full.js"></script>
|
||||
<script>
|
||||
const LogsApp = {
|
||||
data() { return { isLoggedIn: false, isAdmin: false, currentUser: { username: '' }, logType: 'creator', logDate: '', logContent: '', loadingLogs: false } },
|
||||
data() {
|
||||
const today = new Date().toISOString().split('T')[0]; // YYYY-MM-DD
|
||||
return {
|
||||
isLoggedIn: false,
|
||||
isAdmin: false,
|
||||
currentUser: { username: '' },
|
||||
logType: 'creator',
|
||||
logDate: today,
|
||||
logContent: '',
|
||||
loadingLogs: false
|
||||
} },
|
||||
methods: {
|
||||
async fetchLogs() {
|
||||
// 验证输入
|
||||
@@ -113,6 +123,12 @@
|
||||
// 后端返回: { type, date, content }
|
||||
this.logContent = `日志类型:${data.type}\n日期:${data.date}\n\n${data.content || '(日志文件为空)'}`;
|
||||
this.$message.success('日志加载成功');
|
||||
this.$nextTick(() => {
|
||||
const container = this.$refs.logContainer;
|
||||
if (container && container.$el) {
|
||||
container.$el.scrollTop = container.$el.scrollHeight;
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取日志失败:', error);
|
||||
this.$message.error(`获取日志失败: ${error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user