chore: show dashboard url in status
This commit is contained in:
@@ -30,6 +30,7 @@ import { resolveGatewayProgramArguments } from "../daemon/program-args.js";
|
|||||||
import { resolveGatewayService } from "../daemon/service.js";
|
import { resolveGatewayService } from "../daemon/service.js";
|
||||||
import { callGateway } from "../gateway/call.js";
|
import { callGateway } from "../gateway/call.js";
|
||||||
import { resolveGatewayBindHost } from "../gateway/net.js";
|
import { resolveGatewayBindHost } from "../gateway/net.js";
|
||||||
|
import { resolveControlUiLinks } from "../commands/onboard-helpers.js";
|
||||||
import {
|
import {
|
||||||
formatPortDiagnostics,
|
formatPortDiagnostics,
|
||||||
inspectPortUsage,
|
inspectPortUsage,
|
||||||
@@ -562,6 +563,17 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) {
|
|||||||
`Gateway: bind=${status.gateway.bindMode} (${bindHost}), port=${status.gateway.port} (${status.gateway.portSource})`,
|
`Gateway: bind=${status.gateway.bindMode} (${bindHost}), port=${status.gateway.port} (${status.gateway.portSource})`,
|
||||||
);
|
);
|
||||||
defaultRuntime.log(`Probe target: ${status.gateway.probeUrl}`);
|
defaultRuntime.log(`Probe target: ${status.gateway.probeUrl}`);
|
||||||
|
const controlUiEnabled = status.config?.daemon?.controlUi?.enabled ?? true;
|
||||||
|
if (!controlUiEnabled) {
|
||||||
|
defaultRuntime.log("Dashboard: disabled");
|
||||||
|
} else {
|
||||||
|
const links = resolveControlUiLinks({
|
||||||
|
port: status.gateway.port,
|
||||||
|
bind: status.gateway.bindMode,
|
||||||
|
basePath: status.config?.daemon?.controlUi?.basePath,
|
||||||
|
});
|
||||||
|
defaultRuntime.log(`Dashboard: ${links.httpUrl}`);
|
||||||
|
}
|
||||||
if (status.gateway.probeNote) {
|
if (status.gateway.probeNote) {
|
||||||
defaultRuntime.log(`Probe note: ${status.gateway.probeNote}`);
|
defaultRuntime.log(`Probe note: ${status.gateway.probeNote}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from "../agents/defaults.js";
|
} from "../agents/defaults.js";
|
||||||
import { resolveConfiguredModelRef } from "../agents/model-selection.js";
|
import { resolveConfiguredModelRef } from "../agents/model-selection.js";
|
||||||
import { withProgress } from "../cli/progress.js";
|
import { withProgress } from "../cli/progress.js";
|
||||||
import { loadConfig } from "../config/config.js";
|
import { loadConfig, resolveGatewayPort } from "../config/config.js";
|
||||||
import {
|
import {
|
||||||
loadSessionStore,
|
loadSessionStore,
|
||||||
resolveStorePath,
|
resolveStorePath,
|
||||||
@@ -29,6 +29,7 @@ import {
|
|||||||
logWebSelfId,
|
logWebSelfId,
|
||||||
webAuthExists,
|
webAuthExists,
|
||||||
} from "../web/session.js";
|
} from "../web/session.js";
|
||||||
|
import { resolveControlUiLinks } from "./onboard-helpers.js";
|
||||||
import type { HealthSummary } from "./health.js";
|
import type { HealthSummary } from "./health.js";
|
||||||
|
|
||||||
export type SessionStatus = {
|
export type SessionStatus = {
|
||||||
@@ -265,6 +266,7 @@ export async function statusCommand(
|
|||||||
},
|
},
|
||||||
runtime: RuntimeEnv,
|
runtime: RuntimeEnv,
|
||||||
) {
|
) {
|
||||||
|
const cfg = loadConfig();
|
||||||
const summary = await getStatusSummary();
|
const summary = await getStatusSummary();
|
||||||
const usage = opts.usage
|
const usage = opts.usage
|
||||||
? await withProgress(
|
? await withProgress(
|
||||||
@@ -311,11 +313,21 @@ export async function statusCommand(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const controlUiEnabled = cfg.gateway?.controlUi?.enabled ?? true;
|
||||||
|
if (!controlUiEnabled) {
|
||||||
|
runtime.log(info("Dashboard: disabled"));
|
||||||
|
} else {
|
||||||
|
const links = resolveControlUiLinks({
|
||||||
|
port: resolveGatewayPort(cfg),
|
||||||
|
bind: cfg.gateway?.bind,
|
||||||
|
basePath: cfg.gateway?.controlUi?.basePath,
|
||||||
|
});
|
||||||
|
runtime.log(info(`Dashboard: ${links.httpUrl}`));
|
||||||
|
}
|
||||||
runtime.log(
|
runtime.log(
|
||||||
`Web session: ${summary.web.linked ? "linked" : "not linked"}${summary.web.linked ? ` (last refreshed ${formatAge(summary.web.authAgeMs)})` : ""}`,
|
`Web session: ${summary.web.linked ? "linked" : "not linked"}${summary.web.linked ? ` (last refreshed ${formatAge(summary.web.authAgeMs)})` : ""}`,
|
||||||
);
|
);
|
||||||
if (summary.web.linked) {
|
if (summary.web.linked) {
|
||||||
const cfg = loadConfig();
|
|
||||||
const account = resolveWhatsAppAccount({ cfg });
|
const account = resolveWhatsAppAccount({ cfg });
|
||||||
logWebSelfId(account.authDir, runtime, true);
|
logWebSelfId(account.authDir, runtime, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user