加入指令数据统计,指令看板内容
This commit is contained in:
162
plugins/stats_dashboard/templates/base.html
Normal file
162
plugins/stats_dashboard/templates/base.html
Normal file
@@ -0,0 +1,162 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}机器人统计看板{% endblock %}</title>
|
||||
<!-- Element UI CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- 图表库 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<!-- Vue.js -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
|
||||
<!-- Element UI JS -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<!-- Axios -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
|
||||
}
|
||||
.app-container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.header {
|
||||
background-color: #409EFF;
|
||||
color: white;
|
||||
padding: 0 20px;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.main-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.sidebar {
|
||||
width: 200px;
|
||||
background-color: #545c64;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
.el-menu {
|
||||
border-right: none;
|
||||
}
|
||||
.chart-container {
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.stats-card {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" class="app-container">
|
||||
<header class="header">
|
||||
<h2>机器人统计看板</h2>
|
||||
</header>
|
||||
|
||||
<div class="main-container">
|
||||
<!-- 左侧菜单 -->
|
||||
<div class="sidebar">
|
||||
<el-menu
|
||||
:default-active="currentView"
|
||||
class="el-menu-vertical-demo"
|
||||
background-color="#545c64"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
@select="handleSelect"
|
||||
router>
|
||||
<el-menu-item index="1" route="/">
|
||||
<i class="el-icon-s-home"></i>
|
||||
<span slot="title">首页概览</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="2" route="/plugins">
|
||||
<i class="el-icon-s-grid"></i>
|
||||
<span slot="title">插件统计</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="3" route="/users">
|
||||
<i class="el-icon-user"></i>
|
||||
<span slot="title">用户统计</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="4" route="/groups">
|
||||
<i class="el-icon-s-cooperation"></i>
|
||||
<span slot="title">群组统计</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="5" route="/errors">
|
||||
<i class="el-icon-warning"></i>
|
||||
<span slot="title">错误日志</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
|
||||
<!-- 右侧内容区 -->
|
||||
<div class="content">
|
||||
<!-- 时间范围选择器 -->
|
||||
<el-row :gutter="20" style="margin-bottom: 20px;">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" size="small">
|
||||
<el-form-item label="统计时间范围">
|
||||
<el-select v-model="timeRange" @change="loadData">
|
||||
<el-option label="最近7天" value="7"></el-option>
|
||||
<el-option label="最近30天" value="30"></el-option>
|
||||
<el-option label="最近90天" value="90"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="loadData">刷新数据</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 基础 Vue 实例 -->
|
||||
<script>
|
||||
const baseApp = {
|
||||
data() {
|
||||
return {
|
||||
currentView: '1',
|
||||
timeRange: '7',
|
||||
charts: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelect(key, keyPath) {
|
||||
this.currentView = key;
|
||||
this.loadData();
|
||||
},
|
||||
loadData() {
|
||||
// 由子组件实现
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user