save
This commit is contained in:
@@ -1,20 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Lash v{{.Version}}</title>
|
||||
</head>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Lash v{{.Version}}</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
<body>
|
||||
<h1>Enter Token</h1>
|
||||
|
||||
<script>
|
||||
await fetch('/api/receive-token', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ token: "foo" })
|
||||
});
|
||||
</script>
|
||||
<input
|
||||
type="text"
|
||||
id="tokenInput"
|
||||
placeholder="Enter token"
|
||||
/>
|
||||
|
||||
<button id="submitBtn">
|
||||
Submit
|
||||
</button>
|
||||
|
||||
<p id="status"></p>
|
||||
|
||||
<script>
|
||||
const tokenInput = document.getElementById('tokenInput');
|
||||
const submitBtn = document.getElementById('submitBtn');
|
||||
const status = document.getElementById('status');
|
||||
|
||||
submitBtn.addEventListener('click', async () => {
|
||||
const token = tokenInput.value.trim();
|
||||
|
||||
if (!token) {
|
||||
status.textContent = 'Please enter a token.';
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await fetch('/api/receive-token', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ token })
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user