Wire all dashboard buttons: auth downloads, get_log feedback, action tests.
This commit is contained in:
51
server/web/src/help/remoteActions.test.ts
Normal file
51
server/web/src/help/remoteActions.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
/** Buttons in AgentRemoteActions (full + compact) — must match agent/client handleCommand. */
|
||||
const UI_REMOTE_ACTIONS = [
|
||||
'pause',
|
||||
'resume',
|
||||
'stop',
|
||||
'uninstall',
|
||||
'restart',
|
||||
'screenshot',
|
||||
'ps',
|
||||
'sysinfo',
|
||||
'netstat',
|
||||
'users',
|
||||
'software',
|
||||
'get_log',
|
||||
'powershell',
|
||||
'upload',
|
||||
] as const;
|
||||
|
||||
/** Implemented in agent/client/client.go handleCommand switch. */
|
||||
const AGENT_HANDLED = new Set([
|
||||
'pause',
|
||||
'resume',
|
||||
'restart',
|
||||
'stop',
|
||||
'kill',
|
||||
'uninstall',
|
||||
'get_log',
|
||||
'exec',
|
||||
'powershell',
|
||||
'upload',
|
||||
'download',
|
||||
'ps',
|
||||
'netstat',
|
||||
'users',
|
||||
'software',
|
||||
'screenshot',
|
||||
'sysinfo',
|
||||
'ipconfig',
|
||||
'clipboard',
|
||||
'wifi',
|
||||
]);
|
||||
|
||||
describe('remote action wiring', () => {
|
||||
it('every UI remote button maps to an agent handler', () => {
|
||||
for (const action of UI_REMOTE_ACTIONS) {
|
||||
expect(AGENT_HANDLED.has(action)).toBe(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user