parametrized into config.yaml + bug fix
This commit is contained in:
66
src/templates/html/generic_search.html
Normal file
66
src/templates/html/generic_search.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Search</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 600px;
|
||||
margin: 50px auto;
|
||||
padding: 20px;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
margin: 10px 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
button {
|
||||
background: #4CAF50;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background: #45a049;
|
||||
}
|
||||
#results {
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
background: #f9f9f9;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Search</h1>
|
||||
<form id="searchForm">
|
||||
<input type="text" id="searchQuery" placeholder="Enter search query..." required>
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
<div id="results"></div>
|
||||
|
||||
<script>
|
||||
document.getElementById('searchForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const query = document.getElementById('searchQuery').value;
|
||||
const results = document.getElementById('results');
|
||||
|
||||
try {
|
||||
const response = await fetch(`/api/search?q=${encodeURIComponent(query)}`);
|
||||
const text = await response.text();
|
||||
results.innerHTML = `<pre>${text}</pre>`;
|
||||
results.style.display = 'block';
|
||||
} catch (err) {
|
||||
results.innerHTML = `<p>Error: ${err.message}</p>`;
|
||||
results.style.display = 'block';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
74
src/templates/html/input_form.html
Normal file
74
src/templates/html/input_form.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Contact</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 500px;
|
||||
margin: 50px auto;
|
||||
padding: 20px;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
}
|
||||
input, textarea {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ddd;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
textarea {
|
||||
min-height: 100px;
|
||||
}
|
||||
button {
|
||||
background: #4CAF50;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background: #45a049;
|
||||
}
|
||||
#response {
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Contact</h1>
|
||||
<form id="contactForm">
|
||||
<input type="text" name="name" placeholder="Name" required>
|
||||
<input type="email" name="email" placeholder="Email" required>
|
||||
<textarea name="message" placeholder="Message" required></textarea>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
<div id="response"></div>
|
||||
|
||||
<script>
|
||||
document.getElementById('contactForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const formData = new FormData(this);
|
||||
|
||||
fetch('/api/contact', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body: new URLSearchParams(formData)
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
document.getElementById('response').innerHTML = text;
|
||||
document.getElementById('response').style.display = 'block';
|
||||
})
|
||||
.catch(error => {
|
||||
document.getElementById('response').innerHTML = 'Error: ' + error.message;
|
||||
document.getElementById('response').style.display = 'block';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,8 +11,18 @@ Disallow: /login/
|
||||
Disallow: /admin/login
|
||||
Disallow: /phpMyAdmin/
|
||||
Disallow: /admin/login.php
|
||||
Disallow: /users
|
||||
Disallow: /search
|
||||
Disallow: /contact
|
||||
Disallow: /info
|
||||
Disallow: /input
|
||||
Disallow: /feedback
|
||||
Disallow: /server
|
||||
Disallow: /api/v1/users
|
||||
Disallow: /api/v2/secrets
|
||||
Disallow: /api/search
|
||||
Disallow: /api/sql
|
||||
Disallow: /api/database
|
||||
Disallow: /.env
|
||||
Disallow: /credentials.txt
|
||||
Disallow: /passwords.txt
|
||||
|
||||
Reference in New Issue
Block a user