fix: 移除遗留fmfuncs目录创建 + 清理init_service无用导入 + 文件管理器SVG图标 + 示例插件MD3改造

- init_service: 删除_load_fmfuncs方法和fmfuncs目录创建(已迁移到sdk/)
- init_service: 清理未使用的importlib.util和sys导入
- 文件管理器: 全部emoji替换为MD3 SVG矢量图标(文件夹/文件类型/右键菜单)
- 示例插件: dashboard.html改为MD3风格 CSS变量自动适配日夜主题
- 面包屑: 加底色+模糊+左右外边距
- CSS: .btn::after加pointer-events:none
- 插件开发指南: 更新2.6节MD3主题同步和完善的CSS变量/组件类参考表

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
qinglong
2026-06-12 19:00:19 +08:00
parent 9b997d8bda
commit 9de094ea54
16 changed files with 283 additions and 308 deletions
+2 -44
View File
@@ -6,8 +6,6 @@ import asyncio
from pathlib import Path
from typing import Dict, Any
import yaml
import importlib.util
import sys
import os
logger = logging.getLogger(__name__)
@@ -18,7 +16,6 @@ class InitService:
def __init__(self, config_path: str = "config/framework"):
self.config_path = Path(config_path)
self.configs: Dict[str, Any] = {}
self.fmfuncs_loaded = False
logger.debug("InitService初始化开始")
async def initialize_framework(self):
@@ -32,10 +29,7 @@ class InitService:
# 2. 创建必要目录
await self._create_directories()
# 3. 加载框架功能集
await self._load_fmfuncs()
# 4. 验证初始化状态
# 3. 验证初始化状态
await self._validate_init()
logger.info("框架初始化完成")
@@ -94,8 +88,7 @@ class InitService:
"logs/runtime",
"logs/debug",
"plugins",
"utils",
"fmfuncs"
"utils"
]
for dir_path in directories:
@@ -109,41 +102,6 @@ class InitService:
logger.error(f"创建目录时出错: {str(e)}", exc_info=True)
raise
async def _load_fmfuncs(self):
"""加载框架功能集"""
try:
logger.debug("开始加载框架功能集")
fmfuncs_path = Path(os.getenv("SENSU_CODE_DIR", ".")) / "fmfuncs"
if not fmfuncs_path.exists():
logger.warning("fmfuncs目录不存在,跳过加载")
return
# 动态加载所有Python文件
for py_file in fmfuncs_path.glob("*.py"):
if py_file.name == "__init__.py":
continue
try:
module_name = f"fmfuncs.{py_file.stem}"
spec = importlib.util.spec_from_file_location(module_name, py_file)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
spec.loader.exec_module(module)
logger.debug(f"加载框架功能: {module_name}")
except Exception as e:
logger.error(f"加载框架功能 {py_file} 时出错: {str(e)}", exc_info=True)
continue
self.fmfuncs_loaded = True
logger.debug("框架功能集加载完成")
except Exception as e:
logger.error(f"加载框架功能集时出错: {str(e)}", exc_info=True)
raise
async def _validate_init(self):
"""验证初始化状态"""
try: