v1.0.75: keep displayName in operation status

This commit is contained in:
2026-07-27 13:04:38 +04:00
parent 0248c78931
commit 656ad4c893
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -222,6 +222,7 @@ def _finish_op(client, op_uid, instance_uid, svc_id, display_name, op_name, svc_
# Обновляем stages по мере появления
_op_results[op_uid] = {
"status": "RUNNING",
"displayName": display_name,
"stages": op.get("stages", []),
"duration": round(time.time() - t0, 1),
}
@@ -234,6 +235,7 @@ def _finish_op(client, op_uid, instance_uid, svc_id, display_name, op_name, svc_
tracker_remove(instance_uid)
_op_results[op_uid] = {
"status": "OK" if is_ok else "FAIL",
"displayName": display_name,
"error": str(err) if err else "",
"stages": op.get("stages", []),
"duration": round(time.time() - t0, 1),
@@ -244,7 +246,7 @@ def _finish_op(client, op_uid, instance_uid, svc_id, display_name, op_name, svc_
import traceback
print(f"[ERROR] _finish_op crashed: {traceback.format_exc()}", flush=True)
time.sleep(5)
_op_results[op_uid] = {"status": "TIMEOUT", "duration": round(time.time() - t0, 1)}
_op_results[op_uid] = {"status": "TIMEOUT", "displayName": display_name, "duration": round(time.time() - t0, 1)}
@bp.route("/api/test/status/<op_uid>")
@@ -262,6 +264,7 @@ def api_test_status(op_uid):
return jsonify({
"status": "OK" if (done and op.get("isSuccessful")) else ("FAIL" if done else "RUNNING"),
"done": done,
"displayName": op.get("displayName"),
"isSuccessful": op.get("isSuccessful"),
"isInProgress": op.get("isInProgress"),
"duration": op.get("duration"),
+1 -1
View File
@@ -297,7 +297,7 @@ async function executeOp(params){
showStages(sd.stages||[]);
if(sd.status!=='RUNNING'){
stopPoll();
setFinishedState(sd.status, sd.status==='OK'?'badge-success':'badge', sd.error, sd.duration, instanceName);
setFinishedState(sd.status, sd.status==='OK'?'badge-success':'badge', sd.error||sd.errorLog, sd.duration, sd.displayName||instanceName);
if(sd.status==='OK'){
await refreshInstances();
}