forked from hylkevds/FROST-Server.Plugin.SecurityTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (90 loc) · 4.27 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Start Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.flex-container {
display: flex;
flex-direction: row;
width: 800px;
}
#data, #result {
width: 800px;
padding:5px 0px;
margin:5px 0px;
}
</style>
<script type="text/javascript">
function execute() {
let method = document.getElementById('method').value;
let url = document.getElementById('url').value;
let data = document.getElementById('data').value;
document.getElementById('result').innerHTML = 'Executing ' + method + " to " + url;
var request = new XMLHttpRequest();
request.addEventListener("load", function (e) {
document.getElementById('result').innerHTML = 'Done';
if (request.readyState === 4) {
if (request.status >= 200 && request.status < 300) {
let location = request.getResponseHeader('Location');
if (location === null)
location = "";
document.getElementById('result').innerHTML = 'Done: ' + request.responseText + "<br>"
+ location;
} else {
document.getElementById('result').innerHTML = 'Error ' + request.status + ": " + request.responseText + "";
}
}
});
request.addEventListener("error", function (e) {
document.getElementById('result').innerHTML = 'Error: ' + request.statusText;
});
request.open(method, url, true);
request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
request.send(data);
}
</script>
</head>
<body>
<h1>FROST-Server</h1>
The Fraunhofer Open-source SensorThings Server.
<h2>Some Links</h2>
<table>
<tr><td><a href="v1.0">v1.0/</a></td><td>SensorThingsApi v1.0</td></tr>
<tr><td><a href="v1.1">v1.1/</a></td><td>SensorThingsApi v1.1</td></tr>
<tr><td><a href="v1.1/api">v1.1/api</a></td><td>OpenAPI definition for SensorThingsApi v1.1</td></tr>
<tr><td><a href="ODATA_4.01">ODATA_4.01/</a></td><td>OData version 4.01</td></tr>
<tr><td><a href="ODATA_4.01/api">ODATA_4.01/api</a></td><td>OpenAPI definition for OData version 4.01</td></tr>
<tr><td><a href="ODATA_4.01/$metadata?$format=json">ODATA_4.01/$metadata</a></td><td>OData version 4.01 Data Model Metadata</td></tr>
<tr><td><a href="ODATA_4.0">ODATA_4.0</a></td><td>OData version 4.0</td></tr>
<tr><td><a href="ODATA_4.0/api">ODATA_4.0/api</a></td><td>OpenAPI definition for OData version 4.0</td></tr>
<tr><td><a href="ODATA_4.0/$metadata?$format=json">ODATA_4.0/$metadata</a></td><td>OData version 4.0 Data Model Metadata</td></tr>
<tr><td><a href="DatabaseStatus">DatabaseStatus</a></td><td>Database Status and Update</td></tr>
</table>
<a href="https://github.com/FraunhoferIOSB/FROST-Server">FROST-Server on GitHub</a>
<h2>HTTP Tool</h2>
<div class="flex-container">
<select id="method">
<option value="GET">GET</option>
<option value="POST">POST</option>
<option value="PATCH">PATCH</option>
<option value="DELETE">DELETE</option>
</select>
<label for="url" style="padding: 5px">To URL:</label>
<input type="text" id="url" name="url" style="flex-grow: 1" value="v1.1/Things"><input type="button" value="execute" onclick="execute();">
</div>
<div>
<textarea id="data" name="content" rows="10" cols="80">
{
"name" : "Kitchen",
"description" : "The Kitchen in my house",
"properties" : {
"oven" : true,
"heatingPlates" : 4
}
}
</textarea>
</div>
<div id="result"></div>
</body>
</html>