fix(cli): point dashboard topology at the manager route

the topology endpoint lives in the manager dashboard controller
(GET /manager/dashboard/topology), not the data center the cli was
calling, so every invocation returned 404.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
pnoker
2026-10-06 13:50:18 +08:00
co-authored by Claude Code
parent e1edbbcdc3
commit b2ce0ab698
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ export function registerDashboardCommand(program: Command): void {
.action(async (opts: { mode: string; format?: string }) => {
const format = detectFormat(opts.format);
const result = await dc3Client.get(
withQuery('/api/v3/data/dashboard/topology', { mode: opts.mode }),
withQuery('/api/v3/manager/dashboard/topology', { mode: opts.mode }),
);
printAndExit(result, format);
});
+2 -2
View File
@@ -148,12 +148,12 @@ describe('dashboard command group', () => {
it('topology applies the default cardinality mode', async () => {
await run(['dashboard', 'topology']);
expect(fetchCalls[0].url).toBe('http://gw.test/api/v3/data/dashboard/topology?mode=cardinality');
expect(fetchCalls[0].url).toBe('http://gw.test/api/v3/manager/dashboard/topology?mode=cardinality');
});
it('topology accepts the volume mode and rejects unknown modes (F017)', async () => {
await run(['dashboard', 'topology', '--mode', 'volume']);
expect(fetchCalls[0].url).toBe('http://gw.test/api/v3/data/dashboard/topology?mode=volume');
expect(fetchCalls[0].url).toBe('http://gw.test/api/v3/manager/dashboard/topology?mode=volume');
const { err } = await runCapture(['dashboard', 'topology', '--mode', 'volume&evil=1']);
expect(err).toBeInstanceOf(Error);