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:
parent
9c697a53ee
commit
ea32676df9
4 changed files with 29 additions and 5 deletions
|
|
@ -255,7 +255,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.nav-brand {
|
.nav-brand {
|
||||||
@apply text-decoration-none;
|
@apply no-underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.boat-selector {
|
.boat-selector {
|
||||||
|
|
|
||||||
|
|
@ -130,22 +130,22 @@
|
||||||
<div class="instructions-content">
|
<div class="instructions-content">
|
||||||
<p><strong>1. Add to your Home Assistant configuration.yaml:</strong></p>
|
<p><strong>1. Add to your Home Assistant configuration.yaml:</strong></p>
|
||||||
<pre><code>automation:
|
<pre><code>automation:
|
||||||
- alias: "{{ camera.cameraName }} Snapshot to NaviDocs"
|
- alias: "NaviDocs Snapshot"
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: camera.{{ camera.cameraName | slugify }}
|
entity_id: camera.example
|
||||||
to: 'recording'
|
to: 'recording'
|
||||||
action:
|
action:
|
||||||
service: rest_command.navidocs_camera_update
|
service: rest_command.navidocs_camera_update
|
||||||
data:
|
data:
|
||||||
webhook_url: "{{ getWebhookUrl(camera) }}"
|
webhook_url: "{{ getWebhookUrl(camera) }}"
|
||||||
image_url: "{{ '{{ state_attr(\'camera.' + (camera.cameraName | slugify) + '\', \'entity_picture\') }' }}"
|
image_url: "Replace with Home Assistant state attribute"
|
||||||
|
|
||||||
rest_command:
|
rest_command:
|
||||||
navidocs_camera_update:
|
navidocs_camera_update:
|
||||||
url: "{{ getWebhookUrl(camera) }}"
|
url: "{{ getWebhookUrl(camera) }}"
|
||||||
method: POST
|
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>
|
<p><strong>2. Or use generic ONVIF/RTSP camera directly:</strong></p>
|
||||||
<pre><code>camera:
|
<pre><code>camera:
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,11 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@jest/globals": "^30.2.0",
|
"@jest/globals": "^30.2.0",
|
||||||
|
"@playwright/test": "^1.56.1",
|
||||||
"better-sqlite3": "^12.4.1",
|
"better-sqlite3": "^12.4.1",
|
||||||
|
"chromium": "^3.0.3",
|
||||||
"jest": "^30.2.0",
|
"jest": "^30.2.0",
|
||||||
|
"lighthouse": "^13.0.1",
|
||||||
"supertest": "^7.1.4"
|
"supertest": "^7.1.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
21
serve-dist.mjs
Normal file
21
serve-dist.mjs
Normal 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}`);
|
||||||
|
});
|
||||||
Loading…
Add table
Reference in a new issue