nsecbunkerd/templates/authorizeRequest.handlebar
2023-12-20 10:21:24 +00:00

83 lines
2.6 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://rsms.me/" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
<script src="https://cdn.tailwindcss.com"></script>
<script>
function sendPostRequest(permissions) {
const url = '/requests/{{record.id}}';
const data = {
permissions
};
fetch(url, {
method: 'POST', // or 'PUT'
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
})
.then((response) => response.json())
.then((data) => {
console.log('Success:', data);
window.close();
})
.catch((error) => {
console.error('Error:', error);
});
}
</script>
<style>
html {
font-family: Inter;
:root {
font-family: "Inter", sans-serif;
}
@supports (font-variation-settings: normal) {
:root {
font-family: "Inter var", sans-serif;
}
}
font-size: 1rem;
}
label > span {
font-weight: 600;
}
</style>
</head>
<body class="flex flex-col items-center justify-center min-h-screen min-w-screen px-10">
<div class="flex justify-center mb-6">
</div>
<h1 class="text-center text-2xl font-semibold">Do you want to allow this client to use account
<br/>
<span class="font-black">{{record.keyName}}</span>?</h1>
<div class="flex flex-row items-center justify-center gap-8 mt-8">
<button onclick="sendPostRequest()" class="py-3 bg-black hover:bg-neutral-700 transition-all duration-300 text-lg rounded-lg px-10 justify-center items-center gap-2 inline-flex text-white font-semibold">Yes</button>
<button onclick="window.close()" class="text-lg px-10 bg-neutral-200 hover:!bg-neutral-300 transition-all duration-200 rounded-lg py-3">No</button>
</div>
<!-- List all cookies -->
<script>
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
console.log(cookies[i]);
}
</script>
<style lang="postcss">
.button {
@apply px-3 py-1.5 bg-white rounded-lg justify-center items-center gap-2 inline-flex;
@apply text-black text-base font-semibold;
}
</style>
</body>
</html>