feat: wire CNC camera via same-origin /camera proxy, bolder overlay
- streamUrl -> relative /camera/mjpg/video.mjpg so the page loads the LAN-only CNC MJPEG cam same-origin (no mixed-content, no embedded creds). Vite dev-proxy added so the same path works under `npm run dev`. - renderDefaults: thicker lines (lineWidth 3) and fully-saturated cut/rapid colors so the toolpath reads clearly over the video feed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
845e92e56f
commit
cbc11f3bb9
2 changed files with 16 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"streamUrl": "",
|
"streamUrl": "/camera/mjpg/video.mjpg",
|
||||||
"calibration": null,
|
"calibration": null,
|
||||||
"renderDefaults": { "cutColor": "#00e5ff", "rapidColor": "#ff9800", "lineWidth": 1.5 }
|
"renderDefaults": { "cutColor": "#00ffff", "rapidColor": "#ff7700", "lineWidth": 3 }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,19 @@
|
||||||
import { defineConfig } from 'vitest/config';
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
// Dev-only: proxy the CNC MJPEG camera so the page can load it via a
|
||||||
|
// same-origin relative path (`/camera/...`), exactly as nginx does in
|
||||||
|
// production. Keeps `streamUrl` identical in dev and prod and avoids
|
||||||
|
// mixed-content / cross-origin issues. Override the target for a different
|
||||||
|
// camera with: VITE_CAMERA_TARGET=http://host npm run dev
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/camera': {
|
||||||
|
target: process.env.VITE_CAMERA_TARGET || 'http://172.17.3.38',
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/camera/, ''),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
test: { globals: true, environment: 'node' },
|
test: { globals: true, environment: 'node' },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue