mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-06 16:16:37 +08:00
refactor(scheduler): 优化定时任务配置和时间处理
- 支持CHECK_INTERVAL_HOURS设置为0以禁用密钥检查任务 - 调整日志清理任务执行时间从凌晨3点改为0点 - 移除timezone依赖,使用本地时间处理 - 优化代码格式和导入顺序 - 为配置编辑器添加CHECK_INTERVAL_HOURS输入验证 - 改进UI布局,为关键配置项添加警告提示
This commit is contained in:
@@ -1416,25 +1416,31 @@ endblock %} {% block head_extra_styles %}
|
||||
</div>
|
||||
|
||||
<!-- 启用代码执行工具 -->
|
||||
<div class="mb-6 flex items-center justify-between">
|
||||
<label
|
||||
for="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
class="font-semibold text-gray-700"
|
||||
>启用代码执行工具</label
|
||||
>
|
||||
<div
|
||||
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
id="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
|
||||
/>
|
||||
<div class="mb-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<label
|
||||
for="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
|
||||
></label>
|
||||
class="font-semibold text-gray-700"
|
||||
>启用代码执行工具</label
|
||||
>
|
||||
<div
|
||||
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
id="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
|
||||
/>
|
||||
<label
|
||||
for="TOOLS_CODE_EXECUTION_ENABLED"
|
||||
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
|
||||
></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="warning-text">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
<span>启用代码执行工具与大多数工具调用冲突,不建议开启</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2007,25 +2013,31 @@ endblock %} {% block head_extra_styles %}
|
||||
</h2>
|
||||
|
||||
<!-- 启用流式输出优化 -->
|
||||
<div class="mb-6 flex items-center justify-between">
|
||||
<label
|
||||
for="STREAM_OPTIMIZER_ENABLED"
|
||||
class="font-semibold text-gray-700"
|
||||
>启用流式输出优化</label
|
||||
>
|
||||
<div
|
||||
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="STREAM_OPTIMIZER_ENABLED"
|
||||
id="STREAM_OPTIMIZER_ENABLED"
|
||||
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
|
||||
/>
|
||||
<div class="mb-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<label
|
||||
for="STREAM_OPTIMIZER_ENABLED"
|
||||
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
|
||||
></label>
|
||||
class="font-semibold text-gray-700"
|
||||
>启用流式输出优化</label
|
||||
>
|
||||
<div
|
||||
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="STREAM_OPTIMIZER_ENABLED"
|
||||
id="STREAM_OPTIMIZER_ENABLED"
|
||||
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
|
||||
/>
|
||||
<label
|
||||
for="STREAM_OPTIMIZER_ENABLED"
|
||||
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
|
||||
></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="warning-text">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
<span>开启流式优化会在一定程度上减速返回,不建议开启</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2185,31 +2197,18 @@ endblock %} {% block head_extra_styles %}
|
||||
for="CHECK_INTERVAL_HOURS"
|
||||
class="block font-semibold mb-2 text-gray-700"
|
||||
>检查间隔(小时)
|
||||
<i class="fas fa-question-circle text-gray-400 ml-1 cursor-help" title="定时检查密钥状态的间隔时间(单位:小时)"></i>
|
||||
<i class="fas fa-question-circle text-gray-400 ml-1 cursor-help" title="定时检查密钥状态的间隔时间(单位:小时),设置为0时不进行定时检查"></i>
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
id="CHECK_INTERVAL_HOURS"
|
||||
name="CHECK_INTERVAL_HOURS"
|
||||
min="1"
|
||||
min="0"
|
||||
step="1"
|
||||
class="w-full px-4 py-3 rounded-lg form-input-themed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 时区 -->
|
||||
<div class="mb-6">
|
||||
<label for="TIMEZONE" class="block font-semibold mb-2 text-gray-700"
|
||||
>时区
|
||||
<i class="fas fa-question-circle text-gray-400 ml-1 cursor-help" title="定时任务使用的时区,格式如 Asia/Shanghai 或 UTC"></i>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="TIMEZONE"
|
||||
name="TIMEZONE"
|
||||
placeholder="例如: Asia/Shanghai"
|
||||
class="w-full px-4 py-3 rounded-lg form-input-themed"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 日志配置 -->
|
||||
|
||||
Reference in New Issue
Block a user