优化界面布局: 简化短信列表,增强统计信息详情

Changes:
- 短信列表: 简化为列表视图,只显示号码、时间、完整内容
- 统计信息: 最近接收增加详细参数(签名、IP、详情链接)
- 统计信息: 显示从10条增加到20条
- 优化CSS样式,提升可读性
This commit is contained in:
OpenClaw Agent
2026-02-07 00:18:01 +00:00
parent 2557d5854e
commit b5fce34793
6 changed files with 279 additions and 61 deletions

90
sms_receiverctl.sh Executable file
View File

@@ -0,0 +1,90 @@
#!/bin/bash
# 短信转发接收端 - 启动/停止/重启/状态脚本
APP_DIR="/root/.openclaw/workspace/sms-receiver"
APP_FILE="$APP_DIR/app.py"
PIDFILE="$APP_DIR/sms_receiver.pid"
LOGFILE="$APP_DIR/sms_receiver.log"
case "$1" in
start)
if [ -f "$PIDFILE" ]; then
PID=$(cat "$PIDFILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "服务已在运行 (PID: $PID)"
exit 1
else
rm -f "$PIDFILE"
fi
fi
echo "启动短信转发接收端..."
cd "$APP_DIR"
nohup python3 app.py > "$LOGFILE" 2>&1 &
echo $! > "$PIDFILE"
echo "服务已启动 (PID: $(cat $PIDFILE))"
echo "日志文件: $LOGFILE"
echo "监听地址: http://0.0.0.0:9518"
;;
stop)
if [ ! -f "$PIDFILE" ]; then
echo "服务未运行"
exit 1
fi
PID=$(cat "$PIDFILE")
echo "停止服务 (PID: $PID)..."
kill "$PID" 2>/dev/null
sleep 1
if ps -p "$PID" > /dev/null 2>&1; then
echo "强制停止..."
kill -9 "$PID" 2>/dev/null
fi
rm -f "$PIDFILE"
echo "服务已停止"
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
if [ -f "$PIDFILE" ]; then
PID=$(cat "$PIDFILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "服务正在运行 (PID: $PID)"
echo "启动时间: $(ps -p $PID -o lstart=)"
echo "内存使用: $(ps -p $PID -o rss= | awk '{print int($1/1024)"MB"}')"
exit 0
else
echo "PID 文件存在但进程未运行,清理..."
rm -f "$PIDFILE"
exit 1
fi
else
echo "服务未运行"
exit 1
fi
;;
log)
tail -f "$LOGFILE"
;;
*)
echo "用法: $0 {start|stop|restart|status|log}"
echo ""
echo "命令说明:"
echo " start - 启动服务"
echo " stop - 停止服务"
echo " restart - 重启服务"
echo " status - 查看状态"
echo " log - 查看实时日志"
exit 1
;;
esac