Wire all dashboard buttons: auth downloads, get_log feedback, action tests.

This commit is contained in:
drjones
2026-05-28 19:56:11 -07:00
parent 9e26c4babb
commit fda72041f0
8 changed files with 143 additions and 8 deletions

View 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);
}
});
});