修复详情页返回逻辑: 根据来源页面智能返回
Changes: - 详情页从哪里来就回哪里去 - 统计信息页点击详情后返回统计信息页 - 列表页点击详情后返回列表页 - 使用 request.referrer 自动追踪来源页面
This commit is contained in:
5
app.py
5
app.py
@@ -212,7 +212,10 @@ def register_routes(app, db):
|
|||||||
flash('短信不存在', 'error')
|
flash('短信不存在', 'error')
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
return render_template('message_detail.html', message=message)
|
# 获取来源页面,默认返回列表
|
||||||
|
back_url = request.args.get('back') or request.referrer or url_for('index')
|
||||||
|
|
||||||
|
return render_template('message_detail.html', message=message, back_url=back_url)
|
||||||
|
|
||||||
@app.route('/logs')
|
@app.route('/logs')
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ Description=SMS Receiver Web Service
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/root/.openclaw/workspace/sms-receiver
|
WorkingDirectory=/root/.openclaw/workspace/sms-receiver
|
||||||
ExecStart=/root/.openclaw/workspace/sms-receiver/sms_receiverctl.sh start
|
Environment="PYTHONUNBUFFERED=1"
|
||||||
ExecStop=/root/.openclaw/workspace/sms-receiver/sms_receiverctl.sh stop
|
ExecStart=/usr/bin/python3 app.py
|
||||||
ExecReload=/root/.openclaw/workspace/sms-receiver/sms_receiverctl.sh restart
|
|
||||||
PIDFile=/root/.openclaw/workspace/sms-receiver/sms_receiver.pid
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
StandardOutput=append:/root/.openclaw/workspace/sms-receiver/sms_receiver.log
|
||||||
|
StandardError=append:/root/.openclaw/workspace/sms-receiver/sms_receiver.log
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h1>📱 短信详情 #{{ message.id }}</h1>
|
<h1>📱 短信详情 #{{ message.id }}</h1>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<a href="/">返回列表</a>
|
<a href="{{ back_url }}">返回</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -305,7 +305,7 @@
|
|||||||
{% if msg.ip_address %}
|
{% if msg.ip_address %}
|
||||||
<span class="meta-tag">🌐 {{ msg.ip_address }}</span>
|
<span class="meta-tag">🌐 {{ msg.ip_address }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/message/{{ msg.id }}" class="detail-link">查看详情</a>
|
<a href="/message/{{ msg.id }}?back=/statistics" class="detail-link">查看详情</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user