Update component files and add serve script

- Update App.vue and CameraModule.vue with testing updates
- Update package.json with test dependencies
- Add serve-dist.mjs for local testing
This commit is contained in:
Claude 2025-11-14 15:45:26 +00:00
parent 9c697a53ee
commit ea32676df9
No known key found for this signature in database
4 changed files with 29 additions and 5 deletions

View file

@ -255,7 +255,7 @@ onMounted(async () => {
<style scoped>
.nav-brand {
@apply text-decoration-none;
@apply no-underline;
}
.boat-selector {

View file

@ -130,22 +130,22 @@
<div class="instructions-content">
<p><strong>1. Add to your Home Assistant configuration.yaml:</strong></p>
<pre><code>automation:
- alias: "{{ camera.cameraName }} Snapshot to NaviDocs"
- alias: "NaviDocs Snapshot"
trigger:
platform: state
entity_id: camera.{{ camera.cameraName | slugify }}
entity_id: camera.example
to: 'recording'
action:
service: rest_command.navidocs_camera_update
data:
webhook_url: "{{ getWebhookUrl(camera) }}"
image_url: "{{ '{{ state_attr(\'camera.' + (camera.cameraName | slugify) + '\', \'entity_picture\') }' }}"
image_url: "Replace with Home Assistant state attribute"
rest_command:
navidocs_camera_update:
url: "{{ getWebhookUrl(camera) }}"
method: POST
payload: '{"snapshot_url":"{{ '{{ image_url }}' }}","event_type":"motion"}'</code></pre>
payload: '{"snapshot_url":"SNAPSHOT_URL","event_type":"motion"}'</code></pre>
<p><strong>2. Or use generic ONVIF/RTSP camera directly:</strong></p>
<pre><code>camera:

View file

@ -10,8 +10,11 @@
},
"devDependencies": {
"@jest/globals": "^30.2.0",
"@playwright/test": "^1.56.1",
"better-sqlite3": "^12.4.1",
"chromium": "^3.0.3",
"jest": "^30.2.0",
"lighthouse": "^13.0.1",
"supertest": "^7.1.4"
},
"dependencies": {

21
serve-dist.mjs Normal file
View file

@ -0,0 +1,21 @@
import express from 'express';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const app = express();
const PORT = 8083;
const distPath = path.join(__dirname, 'client', 'dist');
// Serve static files
app.use(express.static(distPath));
// For SPA, fallback to index.html
app.get('/*', (req, res) => {
res.sendFile(path.join(distPath, 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server listening on http://localhost:${PORT}`);
console.log(`Serving from: ${distPath}`);
});