mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-03 11:42:04 +08:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user