feat: parallel agent upgrades with per-host log panels (0.4.2)
Allow multiple remote update jobs at once; each upgrade gets its own bottom-right log dock that auto-closes 30s after success. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,8 +71,7 @@
|
||||
<HostAgentVersionUpgrade
|
||||
:host="h"
|
||||
:git="data"
|
||||
:updating="upgradingHostId === h.id"
|
||||
:upgrade-blocked="upgradingHostId != null && upgradingHostId !== h.id"
|
||||
:updating="isHostRemoteActionActive(h.id)"
|
||||
:outdated-highlight="isVersionOutdated(h)"
|
||||
@upgrade="startAgentUpgrade(h)"
|
||||
/>
|
||||
@@ -132,7 +131,11 @@ import {
|
||||
remoteActionKindForHost,
|
||||
remoteActionTitleForHost,
|
||||
} from "../utils/hostAgentUpgrade";
|
||||
import { runHostRemoteAction } from "../composables/useHostRemoteAction";
|
||||
import {
|
||||
isHostRemoteActionActive,
|
||||
runHostRemoteAction,
|
||||
showHostRemoteActionLog,
|
||||
} from "../composables/useHostRemoteAction";
|
||||
import HostAgentVersionUpgrade from "../components/HostAgentVersionUpgrade.vue";
|
||||
|
||||
const router = useRouter();
|
||||
@@ -197,7 +200,6 @@ const initialSort = loadHostsSortPrefs();
|
||||
const sortBy = ref<SortKey>(initialSort.sortBy);
|
||||
const sortDir = ref<"asc" | "desc">(initialSort.sortDir);
|
||||
const deletingId = ref<number | null>(null);
|
||||
const upgradingHostId = ref<number | null>(null);
|
||||
let patchingHostRow = false;
|
||||
let unsubscribeHostPatch: (() => void) | null = null;
|
||||
|
||||
@@ -234,17 +236,16 @@ function isVersionOutdated(h: HostSummary): boolean {
|
||||
}
|
||||
|
||||
async function startAgentUpgrade(h: HostSummary) {
|
||||
if (!isGitAgentUpgradeAvailable(h, data.value) || upgradingHostId.value != null) {
|
||||
if (!isGitAgentUpgradeAvailable(h, data.value)) {
|
||||
return;
|
||||
}
|
||||
if (isHostRemoteActionActive(h.id)) {
|
||||
showHostRemoteActionLog(h.id);
|
||||
return;
|
||||
}
|
||||
const kind = remoteActionKindForHost(h);
|
||||
if (!kind) return;
|
||||
upgradingHostId.value = h.id;
|
||||
try {
|
||||
await runHostRemoteAction(h.id, remoteActionTitleForHost(h), kind);
|
||||
} finally {
|
||||
upgradingHostId.value = null;
|
||||
}
|
||||
void runHostRemoteAction(h.id, remoteActionTitleForHost(h), kind);
|
||||
}
|
||||
|
||||
function openHost(id: number) {
|
||||
|
||||
Reference in New Issue
Block a user