Initial Headless Functions
This commit is contained in:
parent
c3c60efb81
commit
615c5c9edd
5 changed files with 176 additions and 7 deletions
|
|
@ -37,11 +37,27 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
status.textContent = 'Bitte IP eingeben.';
|
||||
return;
|
||||
}
|
||||
status.textContent = `Erkenne Gerät bei ${val} … (Demo)`;
|
||||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue