@rubytech/create-maxy 1.0.779 → 1.0.780
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -245,10 +245,14 @@ function portalHTML() {
|
|
|
245
245
|
<div class="card" style="padding:32px 16px">
|
|
246
246
|
<div class="success-icon">✓</div>
|
|
247
247
|
<h1>Connected!</h1>
|
|
248
|
-
<p class="hint">${escapedBrandName} is now online.
|
|
248
|
+
<p class="hint">${escapedBrandName} is now online. Redirecting in <span id="redirect-countdown">5</span>s…</p>
|
|
249
249
|
<div class="address-box">
|
|
250
250
|
<a id="device-link" href="#" target="_blank"></a>
|
|
251
251
|
</div>
|
|
252
|
+
<p class="hint" id="ip-fallback" style="display:none">If the page above doesn't load (some Android browsers don't resolve <code>.local</code>), use this direct IP:</p>
|
|
253
|
+
<div class="address-box" id="ip-fallback-box" style="display:none">
|
|
254
|
+
<a id="device-link-ip" href="#" target="_blank"></a>
|
|
255
|
+
</div>
|
|
252
256
|
<p class="hint">This access point will close shortly.<br>Your phone will reconnect to your WiFi automatically.</p>
|
|
253
257
|
</div>
|
|
254
258
|
</div>
|
|
@@ -362,13 +366,34 @@ function portalHTML() {
|
|
|
362
366
|
}
|
|
363
367
|
|
|
364
368
|
function showSuccess(data) {
|
|
365
|
-
var
|
|
369
|
+
var hostnameAddr = data.hostname
|
|
366
370
|
? "http://" + data.hostname + ".local" + devicePort
|
|
367
|
-
:
|
|
371
|
+
: null;
|
|
372
|
+
var ipAddr = data.ip ? "http://" + data.ip + devicePort : null;
|
|
373
|
+
var primary = hostnameAddr || ipAddr;
|
|
368
374
|
var link = document.getElementById("device-link");
|
|
369
|
-
link.href =
|
|
370
|
-
link.textContent =
|
|
375
|
+
link.href = primary;
|
|
376
|
+
link.textContent = primary;
|
|
377
|
+
if (hostnameAddr && ipAddr && hostnameAddr !== ipAddr) {
|
|
378
|
+
var ipLink = document.getElementById("device-link-ip");
|
|
379
|
+
ipLink.href = ipAddr;
|
|
380
|
+
ipLink.textContent = ipAddr;
|
|
381
|
+
document.getElementById("ip-fallback").style.display = "block";
|
|
382
|
+
document.getElementById("ip-fallback-box").style.display = "block";
|
|
383
|
+
}
|
|
371
384
|
showScreen("success-screen");
|
|
385
|
+
// Auto-redirect after 5s — gives the phone time to drop the AP and
|
|
386
|
+
// rejoin home WiFi before navigating to the .local / IP address.
|
|
387
|
+
var remaining = 5;
|
|
388
|
+
var countdownEl = document.getElementById("redirect-countdown");
|
|
389
|
+
var ticker = setInterval(function() {
|
|
390
|
+
remaining -= 1;
|
|
391
|
+
if (countdownEl) countdownEl.textContent = String(remaining);
|
|
392
|
+
if (remaining <= 0) {
|
|
393
|
+
clearInterval(ticker);
|
|
394
|
+
window.location.href = primary;
|
|
395
|
+
}
|
|
396
|
+
}, 1000);
|
|
372
397
|
}
|
|
373
398
|
|
|
374
399
|
function pollResult() {
|