297fb2a7a0
- Android app (android/, built with build.sh): signs in to Home Assistant once, opens Dashboard Studio full screen, renews the ingress session; downloadable from Install as an app - Phone dashboards: a round menu button brings back the top bar with Edit, Kiosk and Install as an app - Install as an app explains what works per device (Android app, https for browser install, iPhone limits) - Fixed: browser install failed because the manifest was fetched without the Home Assistant sign-in Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64 lines
3.8 KiB
HTML
64 lines
3.8 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<style>
|
|
:root { color-scheme: dark; }
|
|
body { margin: 0; min-height: 100vh; background: #0f1526; color: #f2f2f7; font: 16px/1.45 system-ui, sans-serif; display: flex; align-items: center; justify-content: center; }
|
|
main { width: 100%; max-width: 420px; padding: 28px 22px; box-sizing: border-box; }
|
|
img { width: 72px; height: 72px; border-radius: 18px; display: block; margin-bottom: 18px; }
|
|
h1 { font-size: 24px; margin: 0 0 8px; }
|
|
p { margin: 0 0 18px; color: #a1a8bb; }
|
|
.msg { background: rgba(255, 69, 58, .15); color: #ffb4ae; padding: 10px 14px; border-radius: 12px; }
|
|
.msg:empty { display: none; }
|
|
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
|
|
input { width: 100%; box-sizing: border-box; font: inherit; color: inherit; background: #1c2438; border: 1px solid #2f3a57; border-radius: 12px; padding: 12px 14px; }
|
|
input:focus { outline: 2px solid #0a84ff; border-color: transparent; }
|
|
.hint { font-size: 13px; margin: 8px 0 22px; }
|
|
button { width: 100%; font: inherit; font-weight: 600; color: #fff; background: #0a84ff; border: 0; border-radius: 12px; padding: 13px; }
|
|
button:active { opacity: .8; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<img src="icon.png" alt="">
|
|
<h1 data-t="title">Connect to Home Assistant</h1>
|
|
<p data-t="intro">Enter the address you use to open Home Assistant. You sign in once; the app remembers it.</p>
|
|
<p class="msg" id="msg"></p>
|
|
<form id="f">
|
|
<label for="addr" data-t="label">Home Assistant address</label>
|
|
<input id="addr" type="text" inputmode="url" autocomplete="url" autocapitalize="off" spellcheck="false" placeholder="http://homeassistant.local:8123" required>
|
|
<p class="hint" data-t="hint">You can also paste the link from Dashboard Studio: Install as an app, Open in the app.</p>
|
|
<button type="submit" data-t="go">Connect</button>
|
|
</form>
|
|
</main>
|
|
<script>
|
|
const NL = {
|
|
title: "Verbinden met Home Assistant",
|
|
intro: "Vul het adres in waarmee je Home Assistant opent. Je logt één keer in; de app onthoudt het.",
|
|
label: "Adres van Home Assistant",
|
|
hint: "Je kunt ook de link uit Dashboard Studio plakken: Installeren als app, Openen in de app.",
|
|
go: "Verbinden",
|
|
offline: "Home Assistant is niet bereikbaar op dit adres. Controleer het adres en je verbinding.",
|
|
notfound: "Dashboard Studio staat niet in Home Assistant. Installeer de app daar eerst, of plak de link uit Dashboard Studio.",
|
|
noaddress: "Dashboard Studio is gevonden, maar alleen een beheerder kan het adres opvragen. Plak de link uit Dashboard Studio: Installeren als app, Openen in de app.",
|
|
error: "Verbinden lukte niet: {0}",
|
|
};
|
|
const EN = {
|
|
offline: "Home Assistant can't be reached at this address. Check the address and your connection.",
|
|
notfound: "Dashboard Studio isn't installed in Home Assistant. Install it there first, or paste the link from Dashboard Studio.",
|
|
noaddress: "Dashboard Studio was found, but only an administrator can look up its address. Paste the link from Dashboard Studio: Install as an app, Open in the app.",
|
|
error: "Couldn't connect: {0}",
|
|
};
|
|
const T = navigator.language.startsWith("nl") ? NL : EN;
|
|
if (T === NL) document.querySelectorAll("[data-t]").forEach((el) => { el.textContent = NL[el.dataset.t] || el.textContent; });
|
|
const why = window.DSApp ? DSApp.message() : "", detail = window.DSApp ? DSApp.detail() : "";
|
|
if (why) document.getElementById("msg").textContent = (T[why] || T.error).replace("{0}", detail || why);
|
|
const addr = document.getElementById("addr");
|
|
addr.value = window.DSApp ? DSApp.address() : "";
|
|
document.getElementById("f").onsubmit = (e) => { e.preventDefault(); DSApp.setup(addr.value.trim()); };
|
|
</script>
|
|
</body>
|
|
</html>
|