Anleitungen erstellt und Bildrate einstellbar
This commit is contained in:
@@ -235,20 +235,35 @@
|
||||
<div class="panel">
|
||||
<div class="p-hdr">
|
||||
<div class="p-dot"></div>
|
||||
<span class="p-lbl">Stream-Auflösung</span>
|
||||
<span class="p-lbl">Kamera-Stream</span>
|
||||
<span class="p-tag">Konfiguration</span>
|
||||
</div>
|
||||
<div class="dropdown-row">
|
||||
<label>Profil</label>
|
||||
<select id="camera_profile_select" class="ctrl-select" onchange="setCameraProfile(this.value)">
|
||||
<option value="640x480">640 x 480 · 4:3 · größtes Sichtfeld</option>
|
||||
<option value="1024x768">1024 x 768 · 4:3 · mehr Details</option>
|
||||
<option value="1296x972">1296 x 972 · 4:3 · noch mehr Details</option>
|
||||
<option value="640x480">640 x 480</option>
|
||||
<option value="1024x768">1024 x 768</option>
|
||||
<option value="1296x972">1296 x 972</option>
|
||||
</select>
|
||||
<span id="camera_profile_status" class="ctrl-status"></span>
|
||||
</div>
|
||||
<div class="dropdown-row">
|
||||
<label>Bildrate</label>
|
||||
<select id="camera_fps_select" class="ctrl-select" onchange="setCameraFps(this.value)">
|
||||
<option value="1">1 fps</option>
|
||||
<option value="2">2 fps</option>
|
||||
<option value="3">3 fps</option>
|
||||
<option value="4">4 fps</option>
|
||||
<option value="5">5 fps</option>
|
||||
<option value="7">7 fps</option>
|
||||
<option value="10">10 fps</option>
|
||||
<option value="20">20 fps</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="dropdown-status-row">
|
||||
<span id="camera_profile_status" class="ctrl-status ctrl-status_block"></span>
|
||||
</div>
|
||||
<div class="copy-text camera-copy">
|
||||
Die neue Auflösung wird gespeichert und der Kameradienst automatisch neu gestartet. Der Videostream ist dabei für einen kurzen Moment unterbrochen.
|
||||
Auflösung und Bildrate werden gespeichert. Danach startet der Kameradienst automatisch neu. Der Videostream ist dabei für einen kurzen Moment unterbrochen.
|
||||
</div>
|
||||
<div class="act-grid act-grid_single">
|
||||
<button class="act-btn subtle full" onclick="refreshCameraPreview()">Vorschau neu laden</button>
|
||||
@@ -2353,8 +2368,15 @@
|
||||
function renderCameraConfig(data) {
|
||||
var camera = data && data.camera ? data.camera : {};
|
||||
var selectedProfile = camera.selected_profile || '';
|
||||
var select = document.getElementById('camera_profile_select');
|
||||
if (select && selectedProfile) select.value = selectedProfile;
|
||||
var profileSelect = document.getElementById('camera_profile_select');
|
||||
var fpsSelect = document.getElementById('camera_fps_select');
|
||||
if (profileSelect && selectedProfile) profileSelect.value = selectedProfile;
|
||||
if (fpsSelect && Array.isArray(camera.fps_options) && camera.fps_options.length) {
|
||||
fpsSelect.innerHTML = camera.fps_options.map(function(option) {
|
||||
return '<option value="' + option + '">' + option + ' fps</option>';
|
||||
}).join('');
|
||||
}
|
||||
if (fpsSelect && camera.fps) fpsSelect.value = String(camera.fps);
|
||||
setText('camera_profile_label', selectedProfile || '--');
|
||||
setText('camera_resolution_label', (camera.width && camera.height) ? (camera.width + ' x ' + camera.height) : '--');
|
||||
setText('camera_fps_label', camera.fps ? (camera.fps + ' fps') : '--');
|
||||
@@ -2369,13 +2391,15 @@
|
||||
}
|
||||
|
||||
async function setCameraProfile(profileId) {
|
||||
var fpsSelect = document.getElementById('camera_fps_select');
|
||||
var fps = fpsSelect ? Number(fpsSelect.value || 10) : 10;
|
||||
var statusEl = document.getElementById('camera_profile_status');
|
||||
if (statusEl) statusEl.textContent = 'Speichere…';
|
||||
try {
|
||||
var response = await fetch(adminApiBase + '/api/camera-config', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({profile: profileId})
|
||||
body: JSON.stringify({profile: profileId, fps: fps})
|
||||
});
|
||||
var data = await response.json();
|
||||
if (!response.ok) throw new Error(data.status || 'Fehler');
|
||||
@@ -2390,6 +2414,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
function setCameraFps(fps) {
|
||||
var profileSelect = document.getElementById('camera_profile_select');
|
||||
var profileId = profileSelect ? profileSelect.value : '1296x972';
|
||||
setCameraProfile(profileId);
|
||||
}
|
||||
|
||||
async function runRumble() {
|
||||
try {
|
||||
var response = await fetch(adminApiBase + '/api/rumble', { method: 'POST' });
|
||||
|
||||
Reference in New Issue
Block a user