Files
2026-05-14 02:27:26 +01:00

125 lines
5.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Install Printer - KlipperAnywhere</title>
<meta name="description" content="Install the KlipperAnywhere agent on a printer over SSH.">
<meta id="csrf-meta" name="csrf-token" content="{{CSRF_TOKEN}}">
<link rel="stylesheet" href="/static/styles.css">
<link rel="icon" href="/favicon.ico">
<link rel="icon" type="image/png" href="/static/assets/favicon.png">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
</head>
<body class="app-page">
<header class="app-header">
<a class="brand" href="/">
<span class="brand-mark" aria-hidden="true">K</span>
<span>KlipperAnywhere</span>
</a>
<nav class="nav-links" aria-label="Install navigation">
<div class="nav-group nav-core">
<a class="text-button" href="/dashboard">Dashboard</a>
<a class="text-button" href="/account">Account</a>
<a class="text-button admin-only" href="/admin" hidden>Admin</a>
</div>
<div class="nav-group nav-tools">
<div class="printer-switcher-group" aria-label="Printer switcher">
<label class="printer-switcher-label" for="printer-switcher">Printer</label>
<select id="printer-switcher" class="printer-switcher" aria-label="Switch printer">
<option value="">Loading printers...</option>
</select>
<button class="text-button" id="printer-switcher-open" type="button">Open</button>
</div>
<button class="text-button" id="refresh" type="button">Refresh</button>
<form class="logout-form" method="post" action="/logout">
<input type="hidden" name="csrf_token" value="{{CSRF_TOKEN}}">
<button class="text-button" type="submit">Sign out</button>
</form>
</div>
</nav>
</header>
<main class="dashboard-shell install-shell">
<section class="dashboard-heading">
<p class="eyebrow">Printer setup</p>
<h1 class="dashboard-title">Install agent over SSH</h1>
</section>
<section class="detail-grid install-grid" aria-live="polite">
<article class="detail-panel">
<div class="panel-heading">
<h2>Connection</h2>
</div>
<p class="auth-copy">Connect to the printer host, upload the installer, and start the agent without touching the host manually.</p>
<p class="auth-copy install-note">Use a root account or a user with passwordless sudo. If you opened this from a printer page, the printer ID will prefill.</p>
<p id="install-status" class="form-message" hidden></p>
<form id="install-form" class="user-form install-form">
<label>
<span>Printer host / IP</span>
<input name="host" autocomplete="off" placeholder="192.168.1.60" required>
</label>
<label>
<span>Server URL</span>
<input name="server_url" autocomplete="off" placeholder="https://klipperanywhere.example.com">
</label>
<p class="panel-subtitle">Use the URL the printer can reach from its own network, not <code>127.0.0.1</code> or <code>localhost</code>.</p>
<label>
<span>SSH port</span>
<input name="port" type="number" min="1" max="65535" value="22">
</label>
<label>
<span>SSH username</span>
<input name="username" autocomplete="username" required>
</label>
<label>
<span>SSH password</span>
<input name="password" type="password" autocomplete="current-password" required>
</label>
<label>
<span>Printer ID</span>
<input name="printer_id" autocomplete="off" placeholder="Optional, defaults to the remote hostname">
</label>
<label>
<span>Printer host type</span>
<select name="host_type" class="settings-select">
<option value="standard">Standard Linux service</option>
<option value="rinkhals">Rinkhals app</option>
</select>
</label>
<p class="panel-subtitle">Choose Rinkhals only if the printer host runs the Rinkhals app framework. Standard installs use a service or init script.</p>
<label>
<span>Moonraker URL</span>
<input name="moonraker_url" autocomplete="off" placeholder="http://127.0.0.1:7125" value="http://127.0.0.1:7125">
</label>
<label>
<span>UI URL</span>
<input name="ui_url" autocomplete="off" placeholder="Optional, defaults to auto-detect">
</label>
<label class="settings-checkbox">
<input name="ui_auto_detect" type="checkbox" checked>
<span>Auto-detect the printer UI on the host</span>
</label>
<button class="button primary" type="submit">Install agent</button>
</form>
</article>
<article class="detail-panel">
<div class="panel-heading">
<h2>Result</h2>
</div>
<p class="auth-copy">The installer uploads the bootstrap scripts, generates the agent config, and runs the remote setup flow.</p>
<dl class="printer-facts detail-facts" id="install-facts">
<div><dt>Status</dt><dd>Waiting</dd></div>
</dl>
<pre class="install-output" id="install-output">No install has been run yet.</pre>
</article>
</section>
</main>
<script src="/static/session.js"></script>
<script src="/static/printer-switcher.js"></script>
<script src="/static/install.js"></script>
</body>
</html>