Files
MarketingTool/apps/desktop/connection.html
T
Marco0300 4dfabf6433
CI / compose (push) Successful in 7m48s
add windows desktop client shell
2026-09-03 14:33:27 +02:00

41 lines
2.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ProspectOS connection</title>
<style>
:root { color-scheme: light; font-family: system-ui, sans-serif; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #f5f3fb; color: #211d2d; }
main { width: min(430px, calc(100% - 48px)); padding: 34px; background: white; border: 1px solid #e4def2; border-radius: 18px; box-shadow: 0 18px 55px #31205d18; }
h1 { margin: 0 0 8px; font-size: 25px; } p { color: #6e6879; line-height: 1.45; }
label { display: block; margin: 22px 0 6px; font-weight: 650; } input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #cfc7df; border-radius: 9px; font: inherit; }
button { margin-top: 22px; width: 100%; padding: 12px; border: 0; border-radius: 9px; background: #5b42c5; color: white; font: inherit; font-weight: 700; cursor: pointer; }
#message { min-height: 22px; color: #b42318; } .hint { font-size: 13px; }
</style>
</head>
<body>
<main>
<h1>Connect to your workspace</h1>
<p>Enter the non-secret HTTP(S) address of the ProspectOS backend. Your browser session stays in the app; only this address is saved locally.</p>
<form id="connectionForm">
<label for="backendUrl">Backend URL</label>
<input id="backendUrl" name="backendUrl" type="url" required placeholder="https://prospect.example.com" autocomplete="url">
<p id="message" role="alert" aria-live="polite"></p>
<button type="submit">Connect</button>
</form>
<p class="hint">Examples: https://prospect.example.com or http://127.0.0.1:8000</p>
</main>
<script>
const input = document.querySelector('#backendUrl');
const message = document.querySelector('#message');
window.prospectDesktop.getBackendUrl().then((value) => { input.value = value || ''; });
document.querySelector('#connectionForm').addEventListener('submit', async (event) => {
event.preventDefault(); message.textContent = 'Connecting…';
const result = await window.prospectDesktop.setBackendUrl(input.value);
message.textContent = result.valid ? '' : result.error;
});
</script>
</body>
</html>