qinglong c07cea4ff7 Fix page loader: execute inline scripts, JS module loading optional
- innerHTML strips script tags, now extract and eval them
- External .js module: 404 = skip gracefully (no error)
- Progress bar: completes regardless of JS module
- Proxy/projects pages now render with CSS + inline JS executes
2026-06-11 14:43:24 +08:00
2026-06-10 12:28:05 +08:00
2026-06-10 12:28:05 +08:00
2026-06-10 12:28:05 +08:00
2026-06-10 12:29:31 +08:00

🐱 SenSu

万能 Python TUI 项目管理器 — 插件化架构,任何项目都能挂载运行。

License Python


特性

  • 🎨 Textual TUI — 系统监控面板 + 命令补全 + CLI 回退
  • 🔌 插件系统 — 热加载、权限隔离、依赖解析、进程隔离
  • 🗄️ 项目引擎 — 接管任何 Python/命令行项目 (subprocess + 日志 + stdin)
  • 🔀 反向代理 — HTTP/WS 代理,本地/局域网/公网端口映射
  • 📊 SQLite 持久化 — 插件状态、权限、审计日志统一存储
  • 🌐 Web 管理面板 — aiohttp + SSE,项目管理/代理/插件控制页
  • 🔐 安全认证 — PBKDF2-SHA256、环境变量密码
  • 🐳 Docker 部署 — Alpine 镜像,systemd 服务文件
  • 🧪 28 个回归测试 — pytest,零失败
  • 🛠️ 插件 SDK — 命令装饰器 + Web 面板 + API + SSE 推送

🚀 快速开始

pip install -r requirements.txt
python main.py                 # TUI 模式
python main.py --headless      # 后台模式
python -m pytest tests/ -v     # 运行测试

🏗️ 架构

main.py → SenSuFramework (15 服务)
├── ProjectEngine     ← 接管任何项目 (subprocess + 日志)
├── ProxyService      ← 反向代理 (HTTP+WS)
├── PyEnvManager      ← Python 版本 + venv + git clone
├── PluginWebMixin    ← 插件 Web 控制面板 SDK
├── PluginService     ← 热加载 + 状态追踪
├── SenSuDB           ← SQLite 5 表
├── TuiService        ← Textual + 系统监控
├── InternetService   ← HTTP :4200 + WS :4240
└── WebPanelManager   ← /SenSu 管理面板

📁 目录

SenSu-Alpha/
├── main.py, service_manager.py
├── sdk/          plugin_command, plugin_status, plugin_error, plugin_web
├── services/     15 个核心服务
├── bridges/      CoreBridge + PluginBridge + NetworkBridge
├── plugins/      插件目录 + example_plugin (含 Web 面板)
├── deploy/       systemd + Dockerfile
├── tests/        28 个测试
└── docs/         开发文档

🌐 Web 面板

http://0.0.0.0:4200/SenSu/
├── /dashboard          仪表盘
├── /pages/projects     项目管理 (添加/启动/Git部署)   ← NEW
├── /pages/proxy        反向代理管理                   ← NEW
├── /plugin/{name}      插件控制面板                   ← NEW
├── /console            Web 终端
├── /logs               实时日志
└── /plugins            插件列表

🔌 插件开发

from sdk.plugin_command_decorator import plugin_command
from sdk.plugin_web import PluginWebMixin

class Plugin(PluginWebMixin):
    def __init__(self, plugin_name=None, config=None, bridge=None):
        PluginWebMixin.__init__(self)
        self.plugin_name = plugin_name

    async def initialize(self):
        self.register_web_page("my_plugin", "My Panel", "<h1>Hello</h1>")

    @plugin_command(name="hello")
    async def cmd_hello(self, *args):
        return "Hello World!"

🔧 环境变量

变量 默认值
SENSU_ADMIN_PASSWORD admin123
SENSU_API_PASSWORD api123
SENSU_PANEL_USER admin
SENSU_PANEL_PASS admin

📄 许可证

Apache License 2.0 · Copyright 2026 AskaEth

S
Description
一个轻量化 Python TUI 插件框架。
Readme Apache-2.0 3.5 MiB
Languages
Python 68%
HTML 14.8%
JavaScript 12.3%
CSS 4.1%
Batchfile 0.4%
Other 0.4%