feat: 代码格式化, 改进仪表盘, 新增多CSS支持

This commit is contained in:
2026-04-20 16:30:04 +08:00
parent 845a505ca1
commit 65fbdec0a9
43 changed files with 551 additions and 349 deletions

View File

@@ -8,7 +8,8 @@ logger = get_logger(__name__)
class BaseAlgorithm:
algo_name = "BaseAlgorithm"
desc = '算法基类'
desc = "算法基类"
class AlgodataDict(TypedDict):
real_rept: int
rept: int

View File

@@ -10,7 +10,8 @@ logger = get_logger(__name__)
class NSP0Algorithm(BaseAlgorithm):
algo_name = "NSP-0"
desc = '快速筛选用特殊调度器'
desc = "快速筛选用特殊调度器"
class AlgodataDict(TypedDict):
real_rept: int
rept: int
@@ -23,7 +24,7 @@ class NSP0Algorithm(BaseAlgorithm):
defaults = {
"real_rept": 0,
'important': 0,
"important": 0,
"rept": 0,
"interval": 0,
"last_date": 0,
@@ -52,8 +53,10 @@ class NSP0Algorithm(BaseAlgorithm):
if feedback == -1:
logger.debug("feedback 为 -1, 跳过更新")
return
algodata[cls.algo_name]["interval"] = (1 if feedback <= 3 else float('inf'))
algodata[cls.algo_name]["important"] = (1 if feedback <= 3 else algodata[cls.algo_name]["important"])
algodata[cls.algo_name]["interval"] = 1 if feedback <= 3 else float("inf")
algodata[cls.algo_name]["important"] = (
1 if feedback <= 3 else algodata[cls.algo_name]["important"]
)
algodata[cls.algo_name]["last_date"] = timer.get_daystamp()
algodata[cls.algo_name]["next_date"] = (
timer.get_daystamp() + algodata[cls.algo_name]["interval"]

View File

@@ -27,7 +27,7 @@ from heurams.kernel.algorithms.sm15m_calc import (
# 全局状态文件路径
_GLOBAL_STATE_FILE = os.path.expanduser(
pathlib.Path(config_var.get()['global']["paths"]["data"])
pathlib.Path(config_var.get()["global"]["paths"]["data"])
/ "global"
/ "sm15m_global_state.json"
)

View File

@@ -10,7 +10,8 @@ logger = get_logger(__name__)
class SM2Algorithm(BaseAlgorithm):
algo_name = "SM-2"
desc = '经典间隔重复算法'
desc = "经典间隔重复算法"
class AlgodataDict(TypedDict):
efactor: float
real_rept: int