45 lines
1.6 KiB
HTML
45 lines
1.6 KiB
HTML
<!-- templates/base.html -->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>{% block title %}Squid代理用户管理系统{% endblock %}</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<!-- 统一的导航栏 -->
|
|
<nav class="main-nav">
|
|
<a href="{{ url_for('index') }}" class="nav-link {% if request.endpoint == 'index' %}active{% endif %}">首页</a>
|
|
<a href="{{ url_for('clients') }}" class="nav-link {% if request.endpoint == 'clients' %}active{% endif %}">用户管理</a>
|
|
<a href="{{ url_for('settings') }}" class="nav-link {% if request.endpoint == 'settings' %}active{% endif %}">系统设置</a>
|
|
<button id="logoutBtn" class="btn-danger nav-logout">退出系统</button>
|
|
</nav>
|
|
|
|
<!-- 内容区块 -->
|
|
<div class="content">
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 统一的页脚 -->
|
|
<footer>
|
|
由 Flask 重构 - 基于原项目 <a href="https://github.com/ckazi" target="_blank">ckazi</a>
|
|
</footer>
|
|
<!-- 统一的JavaScript -->
|
|
<script>
|
|
// 退出系统功能
|
|
document.getElementById('logoutBtn')?.addEventListener('click', function() {
|
|
if(confirm('确定要退出系统吗?')) {
|
|
fetch('/logout').then(() => {
|
|
window.location.href = '/';
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<!-- 子模板可以添加自己的JavaScript -->
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html> |