Files
abot/admin/dashboard/templates/base.html
2026-02-06 12:10:42 +08:00

310 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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>
<!-- favicon -->
<link rel="icon" href="/static/favicon.ico">
<!-- 极简风格重置 + 全局美化 -->
<style>
/* ------------------------------
GLOBAL RESET
------------------------------ */
body {
margin: 0;
padding: 0;
background: #f7f7f8;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei";
color: #333;
overflow: hidden; /* 禁止 body 出滚动条 */
}
h1,h2,h3,h4,h5,h6 {
font-weight: 600;
margin: 0;
}
/* 动画防闪烁 */
.app-container {
opacity: 0;
transition: opacity .3s ease-in-out;
}
.app-container.loaded {
opacity: 1;
}
/* ------------------------------
TOP HEADER极简顶部导航
------------------------------ */
.header {
height: 58px;
padding: 0 16px;
background: #ffffff;
border-bottom: 1px solid #e5e6eb;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
position: sticky;
top: 0;
z-index: 100;
}
.header-left {
display: flex;
align-items: center;
}
.header-logo {
width: 36px;
height: 36px;
margin-right: 8px;
}
.header-right {
display: flex;
align-items: center;
}
.user-info {
margin-right: 8px;
font-size: 14px;
color: #444;
}
.logout-btn {
color: #444;
font-weight: 500;
transition: 0.2s;
}
.logout-btn:hover {
color: #000;
}
/* ------------------------------
LAYOUT
------------------------------ */
.main-container {
display: flex;
height: calc(100vh - 58px);
}
/* ------------------------------
SIDEBAR极简风侧栏
------------------------------ */
.sidebar {
width: 190px;
background: #fafafa;
border-right: 1px solid #e5e6eb;
box-shadow: 2px 0 4px rgba(0,0,0,0.03);
}
/* Element 菜单自定义美化 */
.el-menu {
border-right: none !important;
}
.el-menu-item {
height: 46px !important;
line-height: 46px !important;
margin: 2px 4px !important;
border-radius: 0 !important;
transition: 0.2s !important;
}
.el-menu-item:hover {
background: #e5e6eb55 !important;
}
.el-menu-item.is-active {
background: #e3e6ff !important;
color: #2f54eb !important;
font-weight: 600;
}
/* ------------------------------
CONTENT内容区
------------------------------ */
.content {
flex: 1;
padding: 16px;
overflow-y: auto;
}
/* 全局卡片样式统一 */
.el-card {
border-radius: 0 !important;
box-shadow: 0 4px 12px rgba(0,0,0,0.04) !important;
border: 1px solid #e5e6eb !important;
}
.el-card__body {
padding: 12px !important;
}
.el-button {
border-radius: 0 !important;
}
.el-input__inner {
border-radius: 0 !important;
}
.el-select .el-input__inner {
border-radius: 0 !important;
}
.el-tag {
border-radius: 0 !important;
}
.el-dialog,
.el-message-box {
border-radius: 0 !important;
}
.el-form--inline .el-form-item {
margin-right: 8px !important;
margin-bottom: 8px !important;
}
</style>
<!-- Element UI CSS -->
<link rel="stylesheet" href="/static/css/element-ui/theme-chalk/index.min.css">
<script src="/static/js/chart.js"></script>
<script src="/static/js/vue.js"></script>
<script src="/static/js/element-ui/index.min.js"></script>
<script src="/static/js/axios.min.js"></script>
{% block head %}{% endblock %}
</head>
<body>
<div id="app" class="app-container">
<!-- HEADER -->
<header class="header">
<div class="header-left">
<img src="/static/logo.png" class="header-logo">
<h2 style="font-size:18px;">机器人管理后台</h2>
</div>
<div class="header-right">
<span class="user-info">管理员</span>
<el-button type="text" class="logout-btn" @click="logout">
<i class="el-icon-switch-button"></i> 退出
</el-button>
</div>
</header>
<!-- MAIN AREA -->
<div class="main-container">
<!-- SIDEBAR -->
<div class="sidebar">
<el-menu
:default-active="currentView"
background-color="#fafafa"
text-color="#555"
active-text-color="#2f54eb"
@select="handleSelect">
<el-menu-item index="1"><i class="el-icon-s-home"></i> 首页概览</el-menu-item>
<el-menu-item index="2"><i class="el-icon-s-grid"></i> 插件统计</el-menu-item>
<el-menu-item index="3"><i class="el-icon-user"></i> 用户统计</el-menu-item>
<el-menu-item index="4"><i class="el-icon-s-cooperation"></i> 群组统计</el-menu-item>
<el-menu-item index="6"><i class="el-icon-setting"></i> 权限管理</el-menu-item>
<el-menu-item index="7"><i class="el-icon-chat-line-square"></i> 消息列表</el-menu-item>
<el-menu-item index="10"><i class="el-icon-notebook-1"></i> 通讯录</el-menu-item>
<el-menu-item index="11"><i class="el-icon-s-tools"></i> 插件管理</el-menu-item>
<el-menu-item index="12"><i class="el-icon-connection"></i> 虚拟群组</el-menu-item>
<el-menu-item index="16"><i class="el-icon-time"></i> 定时推送</el-menu-item>
<el-menu-item index="13"><i class="el-icon-document"></i> 接口文档</el-menu-item>
<el-menu-item index="14"><i class="el-icon-cpu"></i> 资源监控</el-menu-item>
<el-menu-item index="15"><i class="el-icon-folder"></i> 文件浏览</el-menu-item>
<el-menu-item index="9"><i class="el-icon-document"></i> 运行日志</el-menu-item>
<el-menu-item index="5"><i class="el-icon-warning"></i> 错误日志</el-menu-item>
</el-menu>
</div>
<!-- CONTENT -->
<div class="content">
<!-- 时间范围选择器 -->
<el-row v-if="showTimeRangeSelector" :gutter="12" style="margin-bottom:16px;">
<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>
<script>
const baseApp = {
data() {
return {
currentView: '1',
timeRange: '7',
showTimeRangeSelector: false
}
},
created() {
const path = window.location.pathname;
this.showTimeRangeSelector = ['/', '/plugins', '/users', '/groups','/robot','/errors'].includes(path);
},
mounted() {
document.querySelector('.app-container').classList.add('loaded');
},
methods: {
handleSelect(key) {
const routes = {
'1': '/',
'2': '/plugins',
'3': '/users',
'4': '/groups',
'5': '/errors',
'6': '/robot',
'7': '/messages',
'9': '/wx_logs',
'10': '/contacts',
'11': '/plugins_manage',
'12': '/virtual_group',
'13': '/api_docs',
'14': '/system_status',
'15': '/file_browser',
'16': '/message_push'
};
if (routes[key] && window.location.pathname !== routes[key]) {
window.location.href = routes[key];
}
},
logout() {
this.$confirm('确认退出登录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.location.href = '/logout';
});
}
}
};
</script>
{% block scripts %}{% endblock %}
</body>
</html>