5be8d4aa00
- Add ProbeONVIF() prober: sends unicast WS-Discovery to ip:3702, parses XAddrs, Name, Hardware from response (no auth needed) - Add ONVIFResult struct to probe models - Register ONVIF detector with highest priority (before HomeKit) - Fix homekit.html back-wrapper max-width to match design system
557 lines
21 KiB
HTML
557 lines
21 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<meta name="theme-color" content="#0a0a0f">
|
|
<title>Strix - HomeKit Pairing</title>
|
|
<style>
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
:root {
|
|
--bg-primary: #0a0a0f;
|
|
--bg-secondary: #1a1a24;
|
|
--bg-tertiary: #24242f;
|
|
--bg-elevated: #2a2a38;
|
|
--purple-primary: #8b5cf6;
|
|
--purple-light: #a78bfa;
|
|
--purple-dark: #7c3aed;
|
|
--purple-glow: rgba(139, 92, 246, 0.3);
|
|
--purple-glow-strong: rgba(139, 92, 246, 0.5);
|
|
--text-primary: #e0e0e8;
|
|
--text-secondary: #a0a0b0;
|
|
--text-tertiary: #606070;
|
|
--success: #10b981;
|
|
--error: #ef4444;
|
|
--border-color: rgba(139, 92, 246, 0.15);
|
|
--font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
--font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
|
|
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
--transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
|
|
|
|
body {
|
|
font-family: var(--font-primary);
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
line-height: 1.5;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.screen {
|
|
min-height: 100vh;
|
|
padding: 1.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
animation: fadeIn var(--transition-base);
|
|
}
|
|
|
|
.container { max-width: 480px; width: 100%; }
|
|
|
|
@media (min-width: 768px) {
|
|
.screen { padding: 3rem 1.5rem; }
|
|
.container { max-width: 540px; }
|
|
}
|
|
|
|
.back-wrapper {
|
|
position: absolute; top: 1.5rem;
|
|
left: 50%; transform: translateX(-50%);
|
|
width: 100%; max-width: 600px;
|
|
padding: 0 1.5rem;
|
|
z-index: 10;
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
.back-wrapper { max-width: 660px; }
|
|
}
|
|
|
|
.btn-back {
|
|
display: inline-flex; align-items: center; gap: 0.5rem;
|
|
background: none; border: none;
|
|
color: var(--text-secondary); font-size: 0.875rem;
|
|
font-family: var(--font-primary); cursor: pointer;
|
|
padding: 0.5rem 0;
|
|
transition: color var(--transition-fast);
|
|
}
|
|
.btn-back:hover { color: var(--purple-primary); }
|
|
|
|
.hero { text-align: center; margin-bottom: 2.5rem; }
|
|
|
|
.title {
|
|
font-size: 1.25rem; font-weight: 600;
|
|
letter-spacing: 0.03em;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.homekit-logo {
|
|
width: 72px; height: 72px;
|
|
margin: 0 auto;
|
|
filter: drop-shadow(0 4px 16px rgba(255, 171, 31, 0.3));
|
|
}
|
|
|
|
.form-group { margin-bottom: 1.5rem; }
|
|
|
|
.label {
|
|
display: flex; align-items: center; gap: 0.5rem;
|
|
font-size: 0.875rem; font-weight: 500;
|
|
color: var(--text-secondary); margin-bottom: 0.75rem;
|
|
}
|
|
|
|
/* Info icon + tooltip */
|
|
.info-icon {
|
|
position: relative; display: inline-flex;
|
|
align-items: center; justify-content: center;
|
|
width: 16px; height: 16px; cursor: help;
|
|
color: var(--text-tertiary); transition: color var(--transition-fast);
|
|
}
|
|
|
|
.info-icon:hover { color: var(--purple-primary); }
|
|
.info-icon svg { width: 16px; height: 16px; }
|
|
|
|
.tooltip {
|
|
position: absolute; top: calc(100% + 8px); left: 50%;
|
|
transform: translateX(-50%);
|
|
background: var(--bg-elevated);
|
|
border: 1px solid var(--purple-primary);
|
|
border-radius: 8px; padding: 1rem;
|
|
width: 320px; max-width: 90vw;
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--purple-glow);
|
|
z-index: 1000; opacity: 0; visibility: hidden;
|
|
transition: opacity var(--transition-fast), visibility var(--transition-fast);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.tooltip::after {
|
|
content: ''; position: absolute; bottom: 100%; left: 50%;
|
|
transform: translateX(-50%);
|
|
border: 6px solid transparent; border-bottom-color: var(--purple-primary);
|
|
}
|
|
|
|
.info-icon:hover .tooltip { opacity: 1; visibility: visible; }
|
|
|
|
.tooltip-title { font-weight: 600; color: var(--purple-primary); margin-bottom: 0.5rem; font-size: 0.875rem; }
|
|
.tooltip-text { font-size: 0.75rem; line-height: 1.5; color: var(--text-secondary); }
|
|
|
|
/* PIN input */
|
|
.pin-row {
|
|
display: flex; align-items: center; justify-content: center;
|
|
gap: 0;
|
|
}
|
|
|
|
.pin-group { display: flex; gap: 0.375rem; }
|
|
|
|
.pin-separator {
|
|
font-size: 1.5rem; font-weight: 300;
|
|
color: var(--text-tertiary);
|
|
padding: 0 0.5rem;
|
|
line-height: 1;
|
|
user-select: none;
|
|
}
|
|
|
|
.pin-digit {
|
|
width: 57px; height: 69px;
|
|
background: var(--bg-secondary);
|
|
border: 2px solid var(--border-color);
|
|
border-radius: 8px;
|
|
color: var(--text-primary);
|
|
font-family: var(--font-mono);
|
|
font-size: 1.375rem; font-weight: 600;
|
|
text-align: center;
|
|
outline: none;
|
|
transition: all var(--transition-fast);
|
|
caret-color: var(--purple-primary);
|
|
-moz-appearance: textfield;
|
|
}
|
|
|
|
.pin-digit::-webkit-inner-spin-button,
|
|
.pin-digit::-webkit-outer-spin-button {
|
|
-webkit-appearance: none; margin: 0;
|
|
}
|
|
|
|
.pin-digit:focus {
|
|
border-color: var(--purple-primary);
|
|
box-shadow: 0 0 0 3px var(--purple-glow);
|
|
}
|
|
|
|
.pin-digit.filled {
|
|
border-color: var(--purple-light);
|
|
background: rgba(139, 92, 246, 0.06);
|
|
}
|
|
|
|
.pin-digit.error {
|
|
border-color: var(--error);
|
|
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
|
|
animation: shake 0.4s ease;
|
|
}
|
|
|
|
.pin-digit.success {
|
|
border-color: var(--success);
|
|
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
|
|
}
|
|
|
|
@media (max-width: 400px) {
|
|
.pin-digit { width: 36px; height: 48px; font-size: 1.125rem; }
|
|
.pin-separator { padding: 0 0.25rem; font-size: 1.25rem; }
|
|
.pin-group { gap: 0.25rem; }
|
|
}
|
|
|
|
/* Error */
|
|
.error-box {
|
|
padding: 1rem;
|
|
background: rgba(239, 68, 68, 0.1);
|
|
border: 1px solid rgba(239, 68, 68, 0.3);
|
|
border-radius: 8px;
|
|
color: var(--error);
|
|
font-size: 0.875rem;
|
|
margin-bottom: 1.5rem;
|
|
display: none;
|
|
animation: fadeIn var(--transition-fast);
|
|
}
|
|
|
|
.error-box.visible { display: block; }
|
|
|
|
/* Buttons */
|
|
.btn {
|
|
display: inline-flex; align-items: center; justify-content: center;
|
|
gap: 0.5rem; padding: 1rem 1.5rem; border-radius: 8px;
|
|
font-size: 1rem; font-weight: 600; font-family: var(--font-primary);
|
|
cursor: pointer; transition: all var(--transition-fast);
|
|
border: none; outline: none;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
|
|
color: white; box-shadow: 0 4px 12px var(--purple-glow);
|
|
}
|
|
.btn-primary:hover:not(:disabled) {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 8px 20px var(--purple-glow-strong);
|
|
}
|
|
.btn-primary:active:not(:disabled) { transform: translateY(0); }
|
|
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
|
|
.btn-large { width: 100%; padding: 1.5rem; font-size: 1.125rem; }
|
|
|
|
.btn-outline {
|
|
display: inline-flex; align-items: center; justify-content: center;
|
|
gap: 0.5rem; padding: 1rem 1.5rem; border-radius: 8px;
|
|
font-size: 1rem; font-weight: 600; font-family: var(--font-primary);
|
|
cursor: pointer; transition: all var(--transition-fast);
|
|
background: transparent; color: var(--text-secondary);
|
|
border: 1px solid var(--border-color); width: 100%;
|
|
margin-top: 0.75rem;
|
|
}
|
|
.btn-outline:hover { border-color: var(--purple-primary); color: var(--purple-light); }
|
|
|
|
/* Pairing spinner */
|
|
.pairing-spinner {
|
|
width: 20px; height: 20px;
|
|
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
border-top-color: white;
|
|
border-radius: 50%;
|
|
animation: spin 0.7s linear infinite;
|
|
}
|
|
|
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
@keyframes shake {
|
|
0%, 100% { transform: translateX(0); }
|
|
20%, 60% { transform: translateX(-4px); }
|
|
40%, 80% { transform: translateX(4px); }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="back-wrapper">
|
|
<button class="btn-back" id="btn-back">
|
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
<path d="M12 4L6 10l6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
</svg>
|
|
Back
|
|
</button>
|
|
</div>
|
|
|
|
<div class="screen">
|
|
<div class="container">
|
|
<div class="hero">
|
|
<svg class="homekit-logo" viewBox="100 120 824 780" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path fill="#FA9012" d="M883.2,413.1l-70.4-55.6l0,0V231.1c0-8.6-3.4-11-9.5-11h-64.4c-7,0-11.3,1.4-11.3,11v59.1l0,0 C634.5,216.7,533.6,137,529.8,134c-7.6-6-12.3-7.6-17.8-7.6c-5.4,0-10.1,1.6-17.8,7.6c-7.6,6-343.2,271.1-353.4,279.1 c-12.4,9.8-8.9,23.9,4.9,23.9h65.5v355.6c0,23,9.2,32.2,31.1,32.2h539.4c21.9,0,31.1-9.2,31.1-32.2V436.9h65.5 C892.1,436.9,895.6,422.9,883.2,413.1z M757.6,742.6c0,15.9-8.2,26.9-24.8,26.9H291.1c-16.6,0-24.8-11-24.8-26.9V410.3 c0-19.3,8.4-31.6,18.1-39.2l212.4-167.7c5.6-4.4,10.4-6.3,15.1-6.3s9.5,1.9,15.1,6.4l212.4,167.7c9.6,7.6,18.1,19.9,18.1,39.2 V742.6z"/>
|
|
<path fill="#FFAB1F" d="M739.6,371.1L527.1,203.3c-5.6-4.4-10.6-6.3-15.1-6.3c-4.6,0-9.5,1.9-15.1,6.4L284.4,371.1 c-9.6,7.6-18.1,19.9-18.1,39.2v332.3c0,15.9,8.2,26.9,24.8,26.9h441.7c16.6,0,24.8-11,24.8-26.9V410.3 C757.6,391,749.2,378.7,739.6,371.1z M702.6,692.7c0,14.8-8.4,21.7-20.7,21.7H342.2c-12.3,0-20.7-6.9-20.7-21.7V433.2 c0-14.4,3.4-22.6,13.6-30.7c5.8-4.6,160.3-126.6,164.4-129.8c4.1-3.3,8.5-4.9,12.5-4.9c4,0,8.4,1.7,12.5,4.9 c4.1,3.3,158.6,125.3,164.4,129.8c10.2,8.1,13.6,16.4,13.6,30.7L702.6,692.7z"/>
|
|
<path fill="#FFBE41" d="M688.9,402.5c-5.8-4.5-160.3-126.6-164.4-129.8c-4.1-3.3-8.5-4.9-12.5-4.9c-4,0-8.4,1.7-12.5,4.9 c-4.1,3.3-158.6,125.3-164.4,129.8c-10.2,8.1-13.6,16.4-13.6,30.7v259.5c0,14.8,8.4,21.7,20.7,21.7h339.7 c12.3,0,20.7-6.9,20.7-21.7V433.2C702.5,418.9,699.1,410.6,688.9,402.5z M647.4,642.8c0,11.9-6.6,16.5-15.6,16.5H392.2 c-9,0-15.6-4.6-15.6-16.5V456.2c0-8.3,0-14.9,9.1-22.2c6-4.8,113.2-89.4,116.4-91.9s6.4-3.8,9.9-3.8c3.6,0.1,7.1,1.5,9.9,3.8 c3.2,2.5,110.4,87.1,116.4,91.9c9.1,7.3,9.1,13.9,9.1,22.2L647.4,642.8z"/>
|
|
<path fill="#FFD260" d="M638.3,434c-6-4.8-113.2-89.4-116.4-91.9c-2.8-2.4-6.3-3.7-9.9-3.8c-3.5,0-6.7,1.3-9.9,3.8 S391.6,429.2,385.7,434c-9.1,7.3-9.1,13.9-9.1,22.2v186.6c0,11.9,6.6,16.5,15.6,16.5h239.5c9,0,15.6-4.6,15.6-16.5V456.2 C647.4,447.8,647.4,441.2,638.3,434z M592.3,593c0,9.2-4.6,11.2-11,11.2H442.8c-6.4,0-11-2.1-11-11.2V479.1 c0-6.4,2.9-12.6,7.8-16.6c2.8-2.3,63-49.4,65.1-51.1c4.2-3.5,10.4-3.5,14.6,0c2.2,1.7,62.3,48.8,65.1,51.1 c5,4.1,7.9,10.2,7.8,16.6L592.3,593z"/>
|
|
<path fill="#FFE780" d="M512,604.1h69.2c6.4,0,11-2.1,11-11.2V479.1c0-6.4-2.9-12.6-7.8-16.6c-2.8-2.3-63-49.4-65.1-51.1 c-4.2-3.5-10.4-3.5-14.6,0c-2.1,1.7-62.3,48.8-65.1,51.1c-5,4.1-7.9,10.2-7.8,16.6v113.8c0,9.2,4.6,11.2,11,11.2L512,604.1z"/>
|
|
</svg>
|
|
<h1 class="title">Apple HomeKit</h1>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="label">
|
|
Pairing Code
|
|
<span class="info-icon">
|
|
<svg viewBox="0 0 16 16" fill="none">
|
|
<circle cx="8" cy="8" r="7" stroke="currentColor" stroke-width="1.5"/>
|
|
<path d="M8 7v4M8 5v.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
</svg>
|
|
<div class="tooltip">
|
|
<div class="tooltip-title">HomeKit Pairing Code</div>
|
|
<p class="tooltip-text">The 8-digit code is usually printed on a label on the camera itself, on the packaging, or in the setup manual. It looks like XXX-XX-XXX.</p>
|
|
</div>
|
|
</span>
|
|
</label>
|
|
|
|
<div class="pin-row" id="pin-row">
|
|
<div class="pin-group" id="group-0"></div>
|
|
<span class="pin-separator">-</span>
|
|
<div class="pin-group" id="group-1"></div>
|
|
<span class="pin-separator">-</span>
|
|
<div class="pin-group" id="group-2"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="error-box" id="error-box"></div>
|
|
|
|
<button class="btn btn-primary btn-large" id="btn-pair" disabled>Pair Device</button>
|
|
<button class="btn-outline" id="btn-standard">Skip, use Standard Discovery</button>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var params = new URLSearchParams(location.search);
|
|
|
|
var ip = params.get('ip') || '';
|
|
var ports = params.get('ports') || '';
|
|
var mac = params.get('mac') || '';
|
|
var vendor = params.get('vendor') || '';
|
|
var server = params.get('server') || '';
|
|
var hostname = params.get('hostname') || '';
|
|
var latency = params.get('latency') || '';
|
|
var mdnsName = params.get('mdns_name') || '';
|
|
var mdnsModel = params.get('mdns_model') || '';
|
|
var mdnsCategory = params.get('mdns_category') || '';
|
|
var mdnsPort = params.get('mdns_port') || '';
|
|
var mdnsPaired = params.get('mdns_paired') || '';
|
|
var mdnsDeviceId = params.get('mdns_device_id') || '';
|
|
|
|
// PIN input -- 8 digits: 3-2-3
|
|
var pinGroups = [3, 2, 3];
|
|
var inputs = [];
|
|
|
|
pinGroups.forEach(function(count, gi) {
|
|
var group = document.getElementById('group-' + gi);
|
|
for (var i = 0; i < count; i++) {
|
|
var input = document.createElement('input');
|
|
input.type = 'text';
|
|
input.inputMode = 'numeric';
|
|
input.pattern = '[0-9]';
|
|
input.maxLength = 1;
|
|
input.className = 'pin-digit';
|
|
input.autocomplete = 'off';
|
|
group.appendChild(input);
|
|
inputs.push(input);
|
|
}
|
|
});
|
|
|
|
inputs.forEach(function(input, idx) {
|
|
input.addEventListener('input', function(e) {
|
|
var v = input.value.replace(/\D/g, '');
|
|
input.value = v ? v[0] : '';
|
|
|
|
hideError();
|
|
|
|
if (v && idx < inputs.length - 1) {
|
|
inputs[idx + 1].focus();
|
|
}
|
|
|
|
updateState();
|
|
});
|
|
|
|
input.addEventListener('keydown', function(e) {
|
|
if (e.key === 'Backspace') {
|
|
if (input.value === '' && idx > 0) {
|
|
inputs[idx - 1].focus();
|
|
inputs[idx - 1].value = '';
|
|
updateState();
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
|
|
if (e.key === 'ArrowLeft' && idx > 0) {
|
|
inputs[idx - 1].focus();
|
|
e.preventDefault();
|
|
}
|
|
if (e.key === 'ArrowRight' && idx < inputs.length - 1) {
|
|
inputs[idx + 1].focus();
|
|
e.preventDefault();
|
|
}
|
|
|
|
if (e.key === 'Enter') {
|
|
doPair();
|
|
}
|
|
});
|
|
|
|
input.addEventListener('focus', function() {
|
|
input.select();
|
|
});
|
|
|
|
// paste support -- distribute digits across fields
|
|
input.addEventListener('paste', function(e) {
|
|
e.preventDefault();
|
|
var text = (e.clipboardData || window.clipboardData).getData('text');
|
|
var digits = text.replace(/\D/g, '');
|
|
|
|
for (var i = 0; i < digits.length && idx + i < inputs.length; i++) {
|
|
inputs[idx + i].value = digits[i];
|
|
}
|
|
|
|
var next = Math.min(idx + digits.length, inputs.length - 1);
|
|
inputs[next].focus();
|
|
updateState();
|
|
});
|
|
});
|
|
|
|
function getPin() {
|
|
var pin = '';
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
pin += inputs[i].value;
|
|
}
|
|
return pin;
|
|
}
|
|
|
|
function updateState() {
|
|
var pin = getPin();
|
|
document.getElementById('btn-pair').disabled = pin.length !== 8;
|
|
|
|
inputs.forEach(function(input) {
|
|
if (input.value) {
|
|
input.classList.add('filled');
|
|
} else {
|
|
input.classList.remove('filled');
|
|
}
|
|
input.classList.remove('error');
|
|
input.classList.remove('success');
|
|
});
|
|
}
|
|
|
|
function showError(msg) {
|
|
var el = document.getElementById('error-box');
|
|
el.textContent = msg;
|
|
el.classList.add('visible');
|
|
inputs.forEach(function(input) { input.classList.add('error'); });
|
|
}
|
|
|
|
function hideError() {
|
|
document.getElementById('error-box').classList.remove('visible');
|
|
}
|
|
|
|
function showSuccess() {
|
|
inputs.forEach(function(input) {
|
|
input.classList.remove('error');
|
|
input.classList.add('success');
|
|
});
|
|
}
|
|
|
|
// pair
|
|
var btnPair = document.getElementById('btn-pair');
|
|
btnPair.addEventListener('click', doPair);
|
|
|
|
async function doPair() {
|
|
var pin = getPin();
|
|
if (pin.length !== 8) return;
|
|
|
|
var port = parseInt(mdnsPort, 10);
|
|
if (!ip || !port || !mdnsDeviceId) {
|
|
showError('Missing device information. Go back and re-probe.');
|
|
return;
|
|
}
|
|
|
|
hideError();
|
|
|
|
btnPair.disabled = true;
|
|
var origText = btnPair.textContent;
|
|
btnPair.textContent = '';
|
|
|
|
var spinner = document.createElement('div');
|
|
spinner.className = 'pairing-spinner';
|
|
btnPair.appendChild(spinner);
|
|
|
|
var label = document.createTextNode(' Pairing...');
|
|
btnPair.appendChild(label);
|
|
|
|
inputs.forEach(function(input) { input.disabled = true; });
|
|
|
|
try {
|
|
var r = await fetch('api/homekit/pair', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
ip: ip,
|
|
port: port,
|
|
device_id: mdnsDeviceId,
|
|
pin: pin
|
|
})
|
|
});
|
|
|
|
if (!r.ok) {
|
|
var text = await r.text();
|
|
inputs.forEach(function(input) { input.disabled = false; });
|
|
btnPair.textContent = origText;
|
|
updateState();
|
|
showError(text || 'Pairing failed (HTTP ' + r.status + ')');
|
|
inputs[0].focus();
|
|
return;
|
|
}
|
|
|
|
var data = await r.json();
|
|
|
|
showSuccess();
|
|
btnPair.textContent = 'Paired!';
|
|
|
|
// redirect to create.html with the homekit URL
|
|
setTimeout(function() {
|
|
var p = new URLSearchParams();
|
|
p.set('url', data.url);
|
|
if (ip) p.set('ip', ip);
|
|
if (mac) p.set('mac', mac);
|
|
if (vendor) p.set('vendor', vendor);
|
|
if (mdnsName) p.set('model', mdnsName);
|
|
if (hostname) p.set('hostname', hostname);
|
|
window.location.href = 'create.html?' + p.toString();
|
|
}, 800);
|
|
|
|
} catch (e) {
|
|
inputs.forEach(function(input) { input.disabled = false; });
|
|
btnPair.textContent = origText;
|
|
updateState();
|
|
showError('Connection error: ' + e.message);
|
|
}
|
|
}
|
|
|
|
// navigation
|
|
document.getElementById('btn-back').addEventListener('click', function() {
|
|
window.location.href = 'index.html';
|
|
});
|
|
|
|
document.getElementById('btn-standard').addEventListener('click', function() {
|
|
var p = new URLSearchParams();
|
|
if (ip) p.set('ip', ip);
|
|
if (ports) p.set('ports', ports);
|
|
if (mac) p.set('mac', mac);
|
|
if (vendor) p.set('vendor', vendor);
|
|
if (server) p.set('server', server);
|
|
if (hostname) p.set('hostname', hostname);
|
|
if (latency) p.set('latency', latency);
|
|
window.location.href = 'standard.html?' + p.toString();
|
|
});
|
|
|
|
// autofocus first input
|
|
inputs[0].focus();
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|