v0.0.41: время на конкретный файл в колонке Статус (бэк считает, без общего LLM)
Deploy drhider / validate (push) Canceled after 0s

This commit is contained in:
“Naeel”
2026-08-19 13:46:00 +04:00
parent 020f9d43c6
commit 0453827b8b
5 changed files with 61 additions and 12 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
sys.path.insert(0, _sys_path_root)
# Версия приложения (меняется при изменениях)
VERSION = "0.0.40"
VERSION = "0.0.41"
def create_app():
+4 -4
View File
@@ -79,8 +79,8 @@ def process_stream(sid):
q = queue.Queue()
cancel = threading.Event()
def progress(phase, idx, total_, name):
q.put(("progress", phase, idx, name, total_))
def progress(phase, idx, total_, name, elapsed):
q.put(("progress", phase, idx, name, total_, elapsed))
def worker():
try:
@@ -117,11 +117,11 @@ def process_stream(sid):
kind = evt[0]
if kind == "progress":
_, phase, idx, name, total_ = evt
_, phase, idx, name, total_, elapsed = evt
try:
yield (
f"event: {phase}\n"
f"data: {json.dumps({'idx': idx, 'name': name, 'total': total_})}\n\n"
f"data: {json.dumps({'idx': idx, 'name': name, 'total': total_, 'elapsed': elapsed})}\n\n"
)
except _disconnect_exceptions():
cancel.set()
+5 -2
View File
@@ -484,8 +484,11 @@ async function uploadFiles() {
activeES.addEventListener('done', function(e) {
const d = JSON.parse(e.data);
clearInterval(fileIntervals[d.idx]);
const elapsed = ((performance.now() - (fileTimers[d.idx] || performance.now())) / 1000).toFixed(1);
ss(d.idx, '<span style="color:#22c55e">✓ ' + elapsed + 'с</span>');
// Время на КОНКРЕТНЫЙ файл приходит с бэка (extract_text + замена, без общего LLM)
const sec = (typeof d.elapsed === 'number' && d.elapsed > 0)
? d.elapsed.toFixed(1)
: ((performance.now() - (fileTimers[d.idx] || performance.now())) / 1000).toFixed(1);
ss(d.idx, '<span style="color:#22c55e">✓ ' + sec + 'с</span>');
});
activeES.addEventListener('complete', function(e) {
activeES.close();