77 lines
2.4 KiB
Rust
77 lines
2.4 KiB
Rust
pub const DEFAULT_INDEX_HTML: &str = r#"
|
|
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Aurora Print — UI</title>
|
|
<link rel="stylesheet" href="/static/styles.css" />
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Aurora Print</h1>
|
|
</header>
|
|
<main>
|
|
<section class="card">
|
|
<h2>Gerät erkennen</h2>
|
|
<label for="ip">IP-Adresse</label>
|
|
<input id="ip" type="text" placeholder="z.B. 192.168.1.50" />
|
|
<button id="btn-start">Start</button>
|
|
<p id="status" class="status"></p>
|
|
</section>
|
|
</main>
|
|
<script src="/static/app.js"></script>
|
|
</body>
|
|
</html>
|
|
"#;
|
|
|
|
pub const DEFAULT_APP_JS: &str = r#"
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const ip = document.getElementById('ip');
|
|
const btn = document.getElementById('btn-start');
|
|
const status = document.getElementById('status');
|
|
|
|
btn.addEventListener('click', async () => {
|
|
const val = (ip.value || '').trim();
|
|
if (!val) {
|
|
status.textContent = 'Bitte IP eingeben.';
|
|
return;
|
|
}
|
|
|
|
status.textContent = `Starte Erkennung für ${val} ...`;
|
|
|
|
try {
|
|
const res = await fetch('/api/start', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({ ip: val })
|
|
});
|
|
|
|
const text = await res.text();
|
|
status.textContent = text || 'Anfrage gesendet.';
|
|
} catch (err) {
|
|
console.error(err);
|
|
status.textContent = 'Fehler beim Senden der Anfrage.';
|
|
}
|
|
});
|
|
});
|
|
"#;
|
|
|
|
|
|
pub const DEFAULT_STYLES_CSS: &str = r#"
|
|
* { box-sizing: border-box; }
|
|
body { margin: 0; font: 16px system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
|
|
background: #0b0f19; color: #e6eefc; }
|
|
header { padding: 16px 24px; border-bottom: 1px solid #1c2233; }
|
|
h1 { margin: 0; font-size: 20px; }
|
|
main { max-width: 720px; margin: 32px auto; padding: 0 16px; }
|
|
.card { background: #121829; border: 1px solid #1f2740; border-radius: 12px; padding: 16px;
|
|
box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
|
|
label { display:block; margin: 8px 0 4px; color: #9db4ff; }
|
|
input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #34406a;
|
|
background: #0e1424; color: #e6eefc; }
|
|
button { margin-top: 12px; padding: 10px 14px; border-radius: 8px; border: 1px solid #3a5bff;
|
|
background: #3056ff; color: white; cursor: pointer; }
|
|
button:hover { filter: brightness(1.05); }
|
|
.status { margin-top: 10px; color: #9db4ff; }
|
|
"#;
|