增加新功能

This commit is contained in:
wzj 2025-06-24 12:24:53 +08:00
parent 84e57bc8db
commit 8300d10074

53
templates/settings.html Normal file
View File

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>系统设置 - Squid代理用户管理系统</title>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
<div class="container">
<h1>系统设置</h1>
<div class="header-actions">
<a href="{{ url_for('index') }}" class="btn-primary">返回首页</a>
<button id="logoutBtn" class="btn-danger">退出系统</button>
</div>
<form method="post" action="{{ url_for('update_settings') }}" class="settings-form">
<div class="form-group">
<label for="admin_password">管理员密码</label>
<input type="password" id="admin_password" name="admin_password"
placeholder="留空则不修改" value="{{ config.admin_password }}">
</div>
<div class="form-group">
<label for="proxy_address">代理服务器地址</label>
<input type="text" id="proxy_address" name="proxy_address"
value="{{ config.proxy_address }}" required>
</div>
<div class="form-group">
<label for="proxy_port">代理服务器端口</label>
<input type="text" id="proxy_port" name="proxy_port"
value="{{ config.proxy_port }}" required>
</div>
<div class="form-actions">
<button type="submit" class="btn-success">保存设置</button>
<a href="{{ url_for('index') }}" class="btn-danger">取消</a>
</div>
</form>
</div>
<script>
document.getElementById('logoutBtn').addEventListener('click', function() {
if(confirm('确定要退出系统吗?')) {
fetch('/logout').then(() => {
window.location.href = '/';
});
}
});
</script>
</body>
</html>