Compare commits
2 commits
845e92e56f
...
d22cdd5302
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d22cdd5302 | ||
|
|
cbc11f3bb9 |
2 changed files with 35 additions and 3 deletions
|
|
@ -1,5 +1,23 @@
|
||||||
{
|
{
|
||||||
"streamUrl": "",
|
"streamUrl": "/camera/mjpg/video.mjpg",
|
||||||
"calibration": null,
|
"calibration": {
|
||||||
"renderDefaults": { "cutColor": "#00e5ff", "rapidColor": "#ff9800", "lineWidth": 1.5 }
|
"imagePoints": [
|
||||||
|
[0.3182042321463028, 0.008781558726673985],
|
||||||
|
[0.6584910919108977, 0.010976948408342482],
|
||||||
|
[0.9349741654696311, 0.9341383095499451],
|
||||||
|
[0.05201209184657934, 0.9407244785949506]
|
||||||
|
],
|
||||||
|
"machinePoints": [
|
||||||
|
[0, 0],
|
||||||
|
[0, 1220],
|
||||||
|
[2440, 1220],
|
||||||
|
[2440, 0]
|
||||||
|
],
|
||||||
|
"homography": [
|
||||||
|
-0.00012223053029634107, 0.00028168511954120923, 0.3182042321463022,
|
||||||
|
0.00014436860873395254, 0.0000018455329325253353, 0.008781558726673699,
|
||||||
|
-0.0002525449441254382, 0.000004193623923514485, 1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"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