fix: keep host name in WinRM update log titles (0.5.17)

Do not overwrite UI log titles with generic backend job.title when several logs are open.
This commit is contained in:
PTah
2026-07-14 10:30:13 +10:00
parent 9883e6aab3
commit f40aa538b0
6 changed files with 28 additions and 12 deletions
@@ -167,7 +167,15 @@ function startCountdown() {
function applyFinishedJob(job: HostRemoteActionJobStatus) {
isLoading.value = false;
ok.value = job.ok ?? job.status === "success";
if (job.title) localTitle.value = job.title;
// Prefer props.title (hostname) over generic backend job.title.
let title = props.title || job.title || "";
const jobTitle = job.title || "";
if (title && jobTitle.includes(" — готово") && !title.includes(" — готово")) {
title = `${title} — готово`;
} else if (title && jobTitle.includes(" — ошибка") && !title.includes(" — ошибка")) {
title = `${title} — ошибка`;
}
localTitle.value = title;
if (job.message) localMessage.value = job.message;
const out = (job.output || job.stdout || "").trim();
if (out) polledOutput.value = out;
@@ -86,9 +86,9 @@ function scheduleSuccessAutoClose(entryId: string) {
}
function applyJobToEntry(entry: HostRemoteActionLogEntry, job: HostRemoteActionJobStatus) {
if (job.title) {
entry.title = job.title;
}
// Keep the UI title set when the log opened (with hostname). Backend job titles
// are generic ("Обновление через WinRM") and overwrite would strip the host name
// when polling / when another log window opens.
if (job.message) {
entry.message = job.message;
}
+8 -2
View File
@@ -713,8 +713,14 @@ async function runRequestAgentUpdate() {
async function runAgentFallback() {
agentControlMessage.value = "";
const title = isWindowsHost.value ? "Обновление через WinRM" : "Fallback SSH (ssh-monitor)";
const job = await runHostRemoteAction(hostId.value, title, "fallback", remoteActionLogPlaceholder(host.value, "fallback"));
if (!host.value) return;
const title = remoteActionTitleForHost(host.value);
const job = await runHostRemoteAction(
hostId.value,
title,
"fallback",
remoteActionLogPlaceholder(host.value, "fallback"),
);
if (job) {
agentControlOk.value = job.ok ?? false;
if (job.ok) {