Admin stazioni: campo Worker visione (URL), traduzioni e test (#45)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NABedeMX43pyXZbDNUgA5B
This commit is contained in:
Adriano
2026-10-11 17:39:22 +00:00
parent 275bbd1a5f
commit 40eed5c2af
4 changed files with 70 additions and 1 deletions
@@ -204,6 +204,17 @@
maxlength="255">
</div>
{# Worker visione (#45): vuoto = worker centrale #}
<div>
<label class="block text-sm font-medium text-[var(--text-primary)] mb-1">{{ _('Worker visione (URL)') }}</label>
<input type="text" x-model="form.vision_worker_url"
class="w-full px-3 py-2 rounded-lg border border-[var(--border-color)] bg-[var(--bg-card)]
text-sm font-mono text-[var(--text-primary)] focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-colors"
placeholder="http://10.0.0.7:8100"
maxlength="500">
<p class="mt-1 text-xs text-[var(--text-secondary)]">{{ _('Vuoto = worker centrale') }}</p>
</div>
<div>
<label class="block text-sm font-medium text-[var(--text-primary)] mb-1">{{ _('Note') }}</label>
<textarea x-model="form.notes" rows="3"
@@ -452,6 +463,7 @@ function stationManagement(initialStations, initialRecipes) {
name: '',
location: '',
notes: '',
vision_worker_url: '', // #45
active: true,
},
@@ -505,7 +517,7 @@ function stationManagement(initialStations, initialRecipes) {
this.isEditing = false;
this.editingId = null;
this.errorMsg = '';
this.form = { code: '', name: '', location: '', notes: '', active: true };
this.form = { code: '', name: '', location: '', notes: '', vision_worker_url: '', active: true };
this.showModal = true;
},
@@ -518,6 +530,7 @@ function stationManagement(initialStations, initialRecipes) {
name: station.name,
location: station.location || '',
notes: station.notes || '',
vision_worker_url: station.vision_worker_url || '', // #45
active: station.active,
};
this.showModal = true;
@@ -537,6 +550,7 @@ function stationManagement(initialStations, initialRecipes) {
name: this.form.name,
location: this.form.location || null,
notes: this.form.notes || null,
vision_worker_url: (this.form.vision_worker_url || '').trim() || null, // #45
active: this.form.active,
};
const resp = await fetch(`/admin/api/stations/${this.editingId}`, {
@@ -563,6 +577,7 @@ function stationManagement(initialStations, initialRecipes) {
name: this.form.name,
location: this.form.location || null,
notes: this.form.notes || null,
vision_worker_url: (this.form.vision_worker_url || '').trim() || null, // #45
active: this.form.active,
};
const resp = await fetch('/admin/api/stations', {