forked from BeOpen-project/minio-sql-connector
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfrontend-preview.html
More file actions
106 lines (104 loc) · 3.25 KB
/
frontend-preview.html
File metadata and controls
106 lines (104 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Query</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 800px;
margin: 50px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.form-group {
margin-bottom: 20px;
display: inline-flex;
align-items: center;
}
.form-group input[type="text"] {
width: 200px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 3px;
box-sizing: border-box;
margin-right: 10px;
}
.form-group label {
margin-right: 10px;
font-weight: bold;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 3px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
textarea {
width: calc(100% - 20px);
min-height: 100px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 3px;
box-sizing: border-box;
display: block;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h2>Query</h2>
<div class="form-group">
<label for="keyInput">Key:</label>
<input type="text" id="keyInput" name="keyInput" placeholder="Inserisci chiave">
</div>
<div class="form-group">
<label for="valueInput">Value:</label>
<input type="text" id="valueInput" name="valueInput" placeholder="Inserisci valore">
<button id="addButton">Submit</button>
</div>
<br>
<div>
<label for="resultsTextarea">Risultati:</label>
</div>
<textarea id="resultsTextarea" name="resultsTextarea" readonly></textarea>
</div>
<script>
document.getElementById('addButton').addEventListener('click', function() {
const key = document.getElementById('keyInput').value;
const value = document.getElementById('valueInput').value;
const token = '';
if (key && value) {
fetch(`http://localhost:3000/api/query?${key}=${encodeURIComponent(value)}`, {
headers: {
'Authorization': `Bearer ${token}`
}
})
.then(response => response.json())
.then(data => {
document.getElementById('resultsTextarea').value = JSON.stringify(data, null, 2);
})
.catch(error => {
document.getElementById('resultsTextarea').value = 'Error: ' + error;
});
} else {
alert('Please enter both key and value.');
}
});
</script>
</body>
</html>