Add webcam functionality to the agent's API and web interface. Implement endpoints for listing available webcams and capturing frames, along with corresponding UI elements for device selection and frame display. Update OpenAPI specification to include new webcam features, enhancing user interaction with webcam devices.

This commit is contained in:
2026-08-29 18:34:05 +03:00
parent 421c83afd2
commit dece8b3ebe
9 changed files with 549 additions and 1 deletions
+28
View File
@@ -134,6 +134,14 @@
background: #111;
}
#video-canvas.view-only { cursor: default; }
#webcam-canvas {
width: 100%;
height: auto;
display: block;
border: 1px solid var(--line);
border-radius: 8px;
background: #111;
}
label.check {
display: inline-flex;
align-items: center;
@@ -216,6 +224,7 @@
<button data-tab="files">Files</button>
<button data-tab="screenshot">Screenshot</button>
<button data-tab="video">Video</button>
<button data-tab="webcam">Webcam</button>
<button data-tab="exec">Command</button>
<button data-tab="logs">Logs</button>
</nav>
@@ -294,6 +303,25 @@
<span class="meta">Toggle sticky modifiers · type anywhere on this tab</span>
</div>
</section>
<section id="webcam" class="panel">
<div class="row">
<button id="webcam-refresh" type="button">Refresh devices</button>
<label>Device
<select id="webcam-device" style="min-width:12rem"></select>
</label>
<button id="webcam-start" class="primary" type="button">Start</button>
<button id="webcam-stop" type="button" disabled>Stop</button>
<label>FPS
<input id="webcam-fps" type="number" min="1" max="10" value="2" style="width:4.5rem">
</label>
<label>Quality
<input id="webcam-quality" type="number" min="1" max="100" value="70" style="width:5rem">
</label>
<button id="webcam-snap" type="button">Snapshot</button>
</div>
<canvas id="webcam-canvas" width="640" height="480"></canvas>
<p id="webcam-meta" class="meta"></p>
</section>
<section id="exec" class="panel">
<div class="row">
<textarea id="exec-command" placeholder="ipconfig /all"></textarea>