mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-08 09:26:36 +08:00
Merge branch 'pr/stevessr/160'
This commit is contained in:
@@ -1535,14 +1535,14 @@ function createAndAppendBudgetMapItem(mapKey, mapValue, modelId) {
|
||||
valueInput.value = isNaN(intValue) ? 0 : intValue;
|
||||
valueInput.placeholder = "预算 (整数)";
|
||||
valueInput.className = `${MAP_VALUE_INPUT_CLASS} w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-primary-500 focus:ring focus:ring-primary-200 focus:ring-opacity-50`;
|
||||
valueInput.min = 0;
|
||||
valueInput.max = 24576;
|
||||
valueInput.min = -1;
|
||||
valueInput.max = 32767;
|
||||
valueInput.addEventListener("input", function () {
|
||||
let val = this.value.replace(/[^0-9]/g, "");
|
||||
let val = this.value.replace(/[^0-9-]/g, "");
|
||||
if (val !== "") {
|
||||
val = parseInt(val, 10);
|
||||
if (val < 0) val = 0;
|
||||
if (val > 24576) val = 24576;
|
||||
if (val < -1) val = -1;
|
||||
if (val > 32767) val = 32767;
|
||||
}
|
||||
this.value = val; // Corrected variable name
|
||||
});
|
||||
|
||||
@@ -1299,7 +1299,7 @@ endblock %} {% block head_extra_styles %}
|
||||
</div> -->
|
||||
<small class="text-gray-500 mt-1 block"
|
||||
>为每个思考模型设置预算(整数,最大值
|
||||
24576),此项与上方模型列表自动关联。</small
|
||||
32767),此项与上方模型列表自动关联。</small
|
||||
>
|
||||
</div>
|
||||
<!-- 安全设置 -->
|
||||
@@ -2355,7 +2355,7 @@ endblock %} {% block head_extra_styles %}
|
||||
let val = this.value.replace(/[^0-9]/g, "");
|
||||
if (val !== "") {
|
||||
val = parseInt(val, 10);
|
||||
if (val > 24576) val = 24576;
|
||||
if (val > 32767) val = 32767;
|
||||
}
|
||||
this.value = val;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user