Spaces:
Runtime error
Runtime error
<html> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
<title>Cyber Radar</title> | |
<!-- Styles --> | |
<link rel="stylesheet" href="/static/[email protected]"> | |
<link rel="stylesheet" href="/static/main.css"> | |
<link rel="stylesheet" href="/static/aos.css"> | |
<link rel="stylesheet" href="/static/inline.css"> | |
<!-- JS --> | |
<script src="/static/[email protected]"></script> | |
<script src="/static/spam-checker.js"></script> | |
<script src="/static/[email protected]"></script> | |
<script src="/static/[email protected]"></script> | |
<script async="" defer="defer" src="/static/aos.js"></script> | |
<script type="text/javascript" src="/static/inline.js"> </script> | |
<body style="background-color: #292a2d; color: #ffffff;"> | |
<main> | |
<article class="article-container"> | |
<div class="container text-center" style="padding-bottom: 0px;"> | |
<!-- <h1 style="color: #ffffff; font-size: 50px;">CybeRadar</h1> --> | |
<img src="/static/logo.png" width="25%"> | |
<h2 style="color: #ffffff;"> Detect📡 Defend🛡</h2> | |
</div> | |
<!-- <hr style="background-color: white;"> --> | |
<section class="container mt-4 mb-5"> | |
<div class="mx-auto shadow-default border-radius-lg" style="border: 1px solid #e6e7eb"> | |
<div class="row" style="margin: 0 !important"> | |
<div class="col-md-8"> | |
<div id="spam-checker--input"> | |
<div class="hwt-container"> | |
<div class="hwt-backdrop" style="margin: 0.916667px;"> | |
<div class="hwt-highlights hwt-content" style="padding: 0px; border-width: 0px;"> | |
</div> | |
</div> | |
<textarea spellcheck="true" id="spam-checker--textarea" style="width: 100%; color: #ffffff;" rows="20" | |
class="hwt-input hwt-content"> | |
</textarea> | |
<style> | |
#myButton { | |
background-color: blue; | |
color: white; | |
border: 1px solid white; | |
cursor: pointer; | |
border-radius: 5px; | |
transition: transform 0.3s; | |
padding: 10px 20px; | |
} | |
#myButton:active { | |
transform: scale(0.9); | |
} | |
</style> | |
</div> | |
</div> | |
</div> | |
<aside class="col-md-4" style="background-color: #f2f3f5; border-radius: 0 0.5rem 0.5rem 0"> | |
<div id="spam-checker--aside"> | |
</div> | |
</aside> | |
</div> | |
</div> | |
</section> | |
</section> | |
</div> | |
</article> | |
</main> | |
<script> | |
function clicker(){ | |
const inputValue = document.getElementById("spam-checker--textarea").value; | |
sendDataToServer(inputValue); | |
} | |
function sendDataToServer(data) { | |
// Make the AJAX request to the server | |
// Replace 'URL' with the actual URL of your localhost endpoint | |
const xhr = new XMLHttpRequest(); | |
xhr.open('POST', '/api/data', true); | |
xhr.setRequestHeader('Content-type', 'application/json'); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState === 4 && xhr.status === 200) { | |
// Request completed successfully | |
const response = JSON.parse(xhr.responseText); | |
const value = response.value; | |
console.log("Response value:", value); | |
document.getElementById('tfmodel').textContent = response.value | |
document.getElementById('tfmodels').innerHTML = response.score | |
} | |
}; | |
xhr.send(JSON.stringify({ text: data })); | |
} | |
</script> | |
</body> |