这次提交的标题 ### Changes made to the code/files: Title: Remove PHP dependencies and refactor UI rendering to pure HTML templates Key features implemented: - Refactored dashboard plugin to remove PHP dependency and implement pure HTML/CSS/JS template rendering - Updated log-terminal plugin to replace PHP-based UI with native Python HTML template generation - Modified package manager plugin to eliminate PHP view files and use direct HTML string construction - Removed all PHP view template files across dashboard, log-terminal, and package manager plugins - Updated .gitignore to include additional build artifacts and environment files - Enhanced dashboard with real-time metrics, system information, and network statistics without external PHP processing The overall change migrates the system from requiring PHP for UI rendering to using pure Python-based HTML template generation, simplifying deployment and removing external dependencies.
plugin-storage 插件存储
为所有插件提供隔离的键值存储服务。
功能
- 隔离存储:每个插件有独立的命名空间
- 持久化:数据自动保存到 JSON 文件
- 线程安全:支持并发访问
- 共享访问:通过 plugin-bridge 可跨插件访问
基本使用
storage_plugin = plugin_mgr.get("plugin-storage")
# 获取插件的隔离存储
storage = storage_plugin.get_storage("my-plugin")
# 设置值
storage.set("key", "value")
storage.set("config", {"theme": "dark", "lang": "zh"})
# 获取值
value = storage.get("key")
config = storage.get("config", default={})
# 检查键
if storage.has("key"):
print("存在")
# 删除
storage.delete("key")
# 批量设置
storage.set_many({"a": 1, "b": 2, "c": 3})
# 获取所有数据
all_data = storage.get_all()
# 清空
storage.clear()
通过 plugin-bridge 访问
bridge = plugin_mgr.get("plugin-bridge")
shared_storage = bridge.storage # 假设 bridge 集成了 storage
# 获取其他插件的存储(需要权限)
other_storage = shared_storage.get_plugin_storage("other-plugin")
data = other_storage.get("some_key")
存储位置
./data/storage/
├── plugin-a/
│ └── data.json
├── plugin-b/
│ └── data.json
└── ...
元信息
meta = storage.get_meta()
# {"plugin": "my-plugin", "keys": 5, "path": "./data/storage/my-plugin"}