增加新功能

This commit is contained in:
wzj 2025-06-24 14:30:33 +08:00
parent a167c77652
commit 4022dcce1a
3 changed files with 37 additions and 5 deletions

3
app.py
View File

@ -5,6 +5,7 @@ import subprocess
import json
import uuid
from math import ceil
from flask import flash
app = Flask(__name__)
app.secret_key = str(uuid.uuid4())
@ -137,7 +138,6 @@ def settings():
config = load_config()
return render_template('settings.html', config=config)
@app.route('/update_settings', methods=['POST'])
@basic_auth_required
def update_settings():
@ -154,6 +154,7 @@ def update_settings():
config['proxy_port'] = proxy_port
save_config(config)
flash('设置已成功保存!', 'success') # 添加成功提示
return redirect(url_for('settings'))

View File

@ -425,12 +425,34 @@ input:checked + .slider:before {
background-color: #d33426;
}
/* 添加消息提示样式 */
.alert {
padding: 12px 20px;
border-radius: 6px;
margin-bottom: 20px;
font-size: 14px;
}
.alert-success {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
/* 分页样式 */
.pagination {
display: flex;
justify-content: center;
margin-top: 20px;
gap: 5px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding-top: 20px;
background: white;
}
/* 固定分页区域位置 */
.table-container {
min-height: 400px; /* 根据你的需要调整这个高度 */
position: relative;
}
.pagination a, .pagination span {

View File

@ -6,6 +6,15 @@
{% block content %}
<h1>系统设置</h1>
<!-- 添加消息显示区域 -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="alert alert-{{ messages[0][0] }}">
{{ messages[0][1] }}
</div>
{% endif %}
{% endwith %}
<form method="post" action="{{ url_for('update_settings') }}" class="settings-form">
<div class="form-group">
<label for="admin_password">管理员密码</label>