mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-05 23:56:37 +08:00
refactor(scheduler): 优化定时任务配置和时间处理
- 支持CHECK_INTERVAL_HOURS设置为0以禁用密钥检查任务 - 调整日志清理任务执行时间从凌晨3点改为0点 - 移除timezone依赖,使用本地时间处理 - 优化代码格式和导入顺序 - 为配置编辑器添加CHECK_INTERVAL_HOURS输入验证 - 改进UI布局,为关键配置项添加警告提示
This commit is contained in:
@@ -104,6 +104,24 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
}
|
||||
|
||||
// 检查间隔小时数输入控制
|
||||
const checkIntervalInput = document.getElementById("CHECK_INTERVAL_HOURS");
|
||||
if (checkIntervalInput) {
|
||||
checkIntervalInput.addEventListener("input", function () {
|
||||
let value = parseFloat(this.value);
|
||||
if (isNaN(value) || value < 0) {
|
||||
this.value = 0;
|
||||
}
|
||||
});
|
||||
|
||||
checkIntervalInput.addEventListener("change", function () {
|
||||
let value = parseFloat(this.value);
|
||||
if (isNaN(value) || value < 0) {
|
||||
this.value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Toggle switch events
|
||||
const toggleSwitches = document.querySelectorAll(".toggle-switch");
|
||||
toggleSwitches.forEach((toggleSwitch) => {
|
||||
|
||||
Reference in New Issue
Block a user