オーナー登録やアカウント作成は不要です。Cloudflareに設定した管理キーを入力すると、このブラウザのセッション中だけ管理APIを利用できます。
ご滞在中は無料でご利用いただけます
① スマートフォンのWi-Fi設定を開きます。
② 表示されているWi-Fi名を選択します。
③ パスワードを入力します。
④ 接続完了です。
`, close: "閉じる" }, en: { subtitle: "Free Wi-Fi is available during your stay.", ssid: "Wi-Fi Name (SSID)", password: "Password", copy: "🔑 Copy Password", copied: "✓ Copied", guide: "📱 How to Connect", guideTitle: "📱 How to Connect to Wi-Fi", guideText: `① Open the Wi-Fi settings on your smartphone.
② Select the Wi-Fi network shown above.
③ Enter the password.
④ You are connected!
`, close: "Close" }, zh: { subtitle: "入住期间可免费使用 Wi-Fi。", ssid: "Wi-Fi 名称(SSID)", password: "密码", copy: "🔑 复制密码", copied: "✓ 已复制", guide: "📱 查看连接方法", guideTitle: "📱 Wi-Fi连接方法", guideText: `① 打开手机的 Wi-Fi 设置。
② 选择上方显示的 Wi-Fi 网络。
③ 输入密码。
④ 连接完成!
`, close: "关闭" }, ko: { subtitle: "투숙 기간 동안 무료 Wi-Fi를 이용하실 수 있습니다.", ssid: "Wi-Fi 이름 (SSID)", password: "비밀번호", copy: "🔑 비밀번호 복사", copied: "✓ 복사되었습니다", guide: "📱 연결 방법 보기", guideTitle: "📱 Wi-Fi 연결 방법", guideText: `① 스마트폰의 Wi-Fi 설정을 엽니다.
② 위에 표시된 Wi-Fi 네트워크를 선택합니다.
③ 비밀번호를 입력합니다.
④ 연결이 완료되었습니다!
`, close: "닫기" } }; function apiHeaders() { return { "Content-Type": "application/json", "Authorization": `Bearer ${adminKey}` }; } async function api(url, options = {}) { return fetch(url, { ...options, headers: { ...(options.body ? { "Content-Type": "application/json" } : {}), ...(adminKey ? { "Authorization": `Bearer ${adminKey}` } : {}), ...(options.headers || {}) } }); } async function authorizeAdmin() { const key = document.getElementById("adminKey").value.trim(); const error = document.getElementById("authError"); error.textContent = ""; if (!key) { error.textContent = "管理キーを入力してください。"; return; } adminKey = key; sessionStorage.setItem("guest_wifi_admin_key", adminKey); const response = await api("/api/properties"); if (!response.ok) { sessionStorage.removeItem("guest_wifi_admin_key"); adminKey = ""; let data = {}; try { data = await response.json(); } catch {} error.textContent = data.message || "管理キーを確認できませんでした。"; return; } document.getElementById("authCard").style.display = "none"; document.getElementById("adminContent").style.display = "block"; const data = await response.json(); properties = data.properties || []; renderProperties(); } async function loadProperties() { const response = await api("/api/properties"); if (response.status === 401) { sessionStorage.removeItem("guest_wifi_admin_key"); adminKey = ""; document.getElementById("authCard").style.display = "block"; document.getElementById("adminContent").style.display = "none"; return; } const data = await response.json(); if (!response.ok) throw new Error(data.message || "取得に失敗しました。"); properties = data.properties || []; renderProperties(); } function createButton(text, className, onClick) { const button = document.createElement("button"); button.className = className; button.textContent = text; button.onclick = onClick; return button; } function renderProperties() { const list = document.getElementById("propertyList"); list.innerHTML = ""; if (!properties.length) { list.innerHTML = `