mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:11:23 +00:00
feat: add update channel status
Co-authored-by: Richard Poelderl <18185649+p6l-richard@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,11 @@ import { inspectPortUsage } from "../infra/ports.js";
|
||||
import { readRestartSentinel } from "../infra/restart-sentinel.js";
|
||||
import { readTailscaleStatusJson } from "../infra/tailscale.js";
|
||||
import { checkUpdateStatus, compareSemverStrings } from "../infra/update-check.js";
|
||||
import {
|
||||
formatUpdateChannelLabel,
|
||||
normalizeUpdateChannel,
|
||||
resolveEffectiveUpdateChannel,
|
||||
} from "../infra/update-channels.js";
|
||||
import { getRemoteSkillEligibility } from "../infra/skills-remote.js";
|
||||
import { runExec } from "../process/exec.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
@@ -87,6 +92,33 @@ export async function statusAllCommand(
|
||||
fetchGit: true,
|
||||
includeRegistry: true,
|
||||
});
|
||||
const configChannel = normalizeUpdateChannel(cfg.update?.channel);
|
||||
const channelInfo = resolveEffectiveUpdateChannel({
|
||||
configChannel,
|
||||
installKind: update.installKind,
|
||||
git: update.git ? { tag: update.git.tag, branch: update.git.branch } : undefined,
|
||||
});
|
||||
const channelLabel = formatUpdateChannelLabel({
|
||||
channel: channelInfo.channel,
|
||||
source: channelInfo.source,
|
||||
gitTag: update.git?.tag ?? null,
|
||||
gitBranch: update.git?.branch ?? null,
|
||||
});
|
||||
const gitLabel =
|
||||
update.installKind === "git"
|
||||
? (() => {
|
||||
const shortSha = update.git?.sha ? update.git.sha.slice(0, 8) : null;
|
||||
const branch =
|
||||
update.git?.branch && update.git.branch !== "HEAD" ? update.git.branch : null;
|
||||
const tag = update.git?.tag ?? null;
|
||||
const parts = [
|
||||
branch ?? (tag ? "detached" : "git"),
|
||||
tag ? `tag ${tag}` : null,
|
||||
shortSha ? `@ ${shortSha}` : null,
|
||||
].filter(Boolean);
|
||||
return parts.join(" · ");
|
||||
})()
|
||||
: null;
|
||||
progress.tick();
|
||||
|
||||
progress.setLabel("Probing gateway…");
|
||||
@@ -333,6 +365,8 @@ export async function statusAllCommand(
|
||||
? `${tailscaleMode} · ${tailscale.backendState ?? "unknown"} · ${tailscale.dnsName} · ${tailscaleHttpsUrl}`
|
||||
: `${tailscaleMode} · ${tailscale.backendState ?? "unknown"} · magicdns unknown`,
|
||||
},
|
||||
{ Item: "Channel", Value: channelLabel },
|
||||
...(gitLabel ? [{ Item: "Git", Value: gitLabel }] : []),
|
||||
{ Item: "Update", Value: updateLine },
|
||||
{
|
||||
Item: "Gateway",
|
||||
|
||||
Reference in New Issue
Block a user