更新readme
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<img width="1910" height="923" alt="image" src="https://github.com/user-attachments/assets/b482a2bf-6349-476c-9ba4-237960cc632a" />
|
||||
<img width="1910" height="923" alt="image" src="https://github.com/user-attachments/assets/b2ac735b-5a3a-478c-955d-1a37eb705bb1" />
|
||||
|
||||
# 注意!!!右侧官方测试网站,请在环境配置中设置deepseek临时apikey,测试结束后请尽快删除或禁用!!否则会有泄露风险
|
||||
|
||||
|
||||
## ✨ 更新说明
|
||||
### 1006增加跟踪主力资金mcp,增加环境配置功能
|
||||
@@ -89,7 +89,8 @@
|
||||
## 🚀 快速开始
|
||||
|
||||
### 1. 环境要求
|
||||
- Python 3.8+
|
||||
- Python 3.8+(微软store或官网,推荐3.12)
|
||||
- Node.js 16+ (微软store或官网)
|
||||
- 稳定的网络连接
|
||||
- DeepSeek API Key
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
# 1. 删除带 \r 的旧文件
|
||||
rm -f /www/wwwroot/aiagents-stock/stm /www/wwwroot/aiagents-stock/stm.py
|
||||
|
||||
# 2. 重新写入(纯 Unix 换行)
|
||||
cat > /www/wwwroot/aiagents-stock/stm << 'EOF'
|
||||
#!/usr/bin/env python3
|
||||
import os, time, signal, subprocess, psutil
|
||||
|
||||
APP_NAME = "app.py"
|
||||
VENV_PATH = "/www/wwwroot/aiagents-stock/venv"
|
||||
APP_PATH = "/www/wwwroot/aiagents-stock"
|
||||
PORT = 8501
|
||||
STR = os.path.join(VENV_PATH, "bin", "streamlit")
|
||||
LOG = os.path.join(APP_PATH, "app.log")
|
||||
|
||||
def is_run():
|
||||
for p in psutil.process_iter(['cmdline']):
|
||||
if p.info['cmdline'] and 'streamlit' in ' '.join(p.info['cmdline']) and 'run' in p.info['cmdline']:
|
||||
return p.pid
|
||||
return None
|
||||
|
||||
def start():
|
||||
if is_run():
|
||||
print("⚠️ 已在运行"); return
|
||||
os.chdir(APP_PATH)
|
||||
with open(LOG, "a") as f:
|
||||
subprocess.Popen(["nohup", STR, "run", APP_NAME,
|
||||
"--server.port", str(PORT),
|
||||
"--server.address", "0.0.0.0",
|
||||
"--server.headless", "true"],
|
||||
stdout=f, stderr=f, preexec_fn=os.setsid)
|
||||
time.sleep(3)
|
||||
print("✅ 启动成功 | http://服务器IP:8501")
|
||||
|
||||
def stop():
|
||||
pid = is_run()
|
||||
if not pid:
|
||||
print("⚠️ 未运行"); return
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
time.sleep(2)
|
||||
if is_run():
|
||||
os.kill(pid, signal.SIGKILL)
|
||||
print("✅ 已停止")
|
||||
|
||||
menu = """1) 启动 2) 停止 3) 重启 4) 状态 5) 日志 0) 退出"""
|
||||
def main():
|
||||
while True:
|
||||
print(menu)
|
||||
c = input("选 > ").strip()
|
||||
if c == '1': start()
|
||||
elif c == '2': stop()
|
||||
elif c == '3': stop(); time.sleep(2); start()
|
||||
elif c == '4':
|
||||
pid = is_run()
|
||||
print("✅ 运行中" if pid else "❌ 未运行")
|
||||
elif c == '5': os.system("tail -n 50 " + LOG)
|
||||
elif c == '0': break
|
||||
else: print("无效")
|
||||
input("\n回车继续 …")
|
||||
|
||||
if __name__ == "__main__": main()
|
||||
EOF
|
||||
|
||||
# 3. 赋可执行权限
|
||||
chmod +x /www/wwwroot/aiagents-stock/stm
|
||||
|
||||
# 4. 确保 PATH 包含当前目录(已加可忽略)
|
||||
echo 'export PATH="/www/wwwroot/aiagents-stock:$PATH"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
|
||||
# 5. 运行
|
||||
stm
|
||||
Reference in New Issue
Block a user