feat(core): 添加按UID清空运行记录功能

- 实现了按UID过滤清空记录的功能
- 在设置中添加了清空运行记录模式选择选项
- 新增"全部"和"UID"两种清空模式
- 当选择UID模式时只清空当前UID对应的记录
- 添加了相应的日志输出显示清空的UID信息
- 更新了配置文件中的设置项定义
This commit is contained in:
yan
2026-01-20 12:17:48 +08:00
parent 7edb663d55
commit 8ac80b9988
3 changed files with 29 additions and 1 deletions

View File

@@ -34,6 +34,16 @@
"label": "配置模式-刷新-清空运行记录",
"default": false
},
{
"name": "refresh_record_mode",
"type": "select",
"label": "清空运行记录模式",
"options": [
"全部",
"UID"
],
"default": "UID"
},
{
"name": "loading_level",
"type": "input-text",

View File

@@ -398,9 +398,17 @@ async function initRefresh(settingsConfig) {
log.error("[PATH] 保存 PATH_JSON_LIST 失败: {0}", e.message);
}
if (settings.refresh_record) {
if (settings.refresh_record_mode === "UID") {
RecordList=RecordList.filter(item => item.uid !== Record.uid)
RecordPathList=RecordPathList.filter(item => item.uid !== Record.uid)
file.writeTextSync(json_path_name.RecordPathText, JSON.stringify(RecordPathList))
file.writeTextSync(json_path_name.RecordText, JSON.stringify(RecordList))
log.info("已清空UID:{0}记录文件",Record.uid)
return
}
file.writeTextSync(json_path_name.RecordPathText, JSON.stringify([]))
file.writeTextSync(json_path_name.RecordText, JSON.stringify([]))
log.info("已清空记录文件")
log.info("已清空全部记录文件")
}
}

View File

@@ -34,6 +34,16 @@
"label": "配置模式-刷新-清空运行记录",
"default": false
},
{
"name": "refresh_record_mode",
"type": "select",
"label": "清空运行记录模式",
"options": [
"全部",
"UID"
],
"default": "UID"
},
{
"name": "loading_level",
"type": "input-text",