small fix lite (+1 squashed commits)

Squashed commits:

[f22db79a] updated lite
This commit is contained in:
Concedo 2024-02-10 22:08:12 +08:00
parent 6f3196ad8e
commit afa41c24f5

View file

@ -6,7 +6,7 @@ It requires no dependencies, installation or setup.
Just copy this single static HTML file anywhere and open it in a browser, or from a webserver.
Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite.
Kobold Lite is under the AGPL v3.0 License unless otherwise exempted. Please do not remove this line.
Current version: 110
Current version: 111
-Concedo
-->
@ -10318,9 +10318,20 @@ Current version: 110
//runs every second
var idle_timer = 0; //used in chat mode to send multi replies
var idle_triggered_counter = 0;
var idle_backoff_array = [15000,60000,300000,120000];
function poll_background_tasks()
{
let idle_timer_max = localsettings.idle_duration*1000;
let idle_timer_max = 0;
if(localsettings.idle_duration>0)
{
idle_timer_max = localsettings.idle_duration*1000;
}
else
{
//smart idle timer
idle_timer_max = idle_backoff_array[idle_triggered_counter>=idle_backoff_array.length?idle_backoff_array.length-1:idle_triggered_counter];
}
let newgenempty = (document.getElementById("input_text").value == "");
let chatinputempty = (document.getElementById("cht_inp").value == "");
if ((localsettings.opmode == 1 || localsettings.opmode == 2 || localsettings.opmode == 3 || localsettings.opmode == 4)
@ -11147,7 +11158,7 @@ Current version: 110
// Show the 'AI is typing' message if an answer is pending, and prevent the 'send button' from being clicked again.
if (pending_response_id=="") { document.getElementById("chatistyping").classList.add("hidden"); }
else {
let aiName = ((pending_context_preinjection && pending_context_preinjection.includes(":")) ? pending_context_preinjection.split(":")[0] : "The AI");
let aiName = ((localsettings.opmode==3 && pending_context_preinjection && pending_context_preinjection.includes(":")) ? pending_context_preinjection.split(":")[0] : "The AI");
document.getElementById("chataityping").innerText = aiName + " is typing...";
document.getElementById("chatistyping").classList.remove("hidden");
}
@ -13274,6 +13285,7 @@ Current version: 110
<option value="120">2m</option>
<option value="300">5m</option>
<option value="600">10m</option>
<option value="-1">Auto</option>
</select>
</div>