feat(kiosk): add native settings shortcut in webapp settings page

This commit is contained in:
dadaloop82
2026-05-16 13:07:29 +00:00
parent bd8dc0501a
commit 61a2372caa
6 changed files with 54 additions and 3 deletions
+16
View File
@@ -2337,6 +2337,9 @@ async function loadSettingsUI() {
// Show kiosk self-update panel
const updatePanel = document.getElementById('kiosk-update-panel');
if (updatePanel) updatePanel.style.display = '';
// Show kiosk native settings shortcut panel
const nativePanel = document.getElementById('kiosk-native-settings-panel');
if (nativePanel) nativePanel.style.display = '';
}
// Populate About section version
@@ -2356,6 +2359,19 @@ function _kioskReconfigureScale() {
}
}
// ── Kiosk: open native SettingsActivity (server URL, BLE, screensaver) ──
function _openKioskNativeSettings() {
if (typeof _kioskBridge === 'undefined') return;
if (typeof _kioskBridge.openNativeSettings === 'function') {
try { _kioskBridge.openNativeSettings(); } catch(e) {}
} else {
// Older APK without openNativeSettings — make the native gear button
// temporarily visible with a hint to tap it.
try { _kioskBridge.setNativeSettingsVisible(true); } catch(_) {}
showToast(t('settings.kiosk.native_tap_hint') || 'Tocca la rotella ⚙️ in alto a destra', 'info', 4000);
}
}
// ── Kiosk: manual update check ────────────────────────────────────────
let _kioskPendingApkUrl = '';