validator/src/main/resources/gui/index.html

81 lines
No EOL
2 KiB
HTML

<!--
~ Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Validator</title>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta content="width=device-width,initial-scale=1" name="viewport">
<link href="lib/vue.css" rel="stylesheet">
<style>
#result {
border: 1pt solid black;
margin-top: 20px
}
#result:empty {
display: none;
}
</style>
</head>
<body>
<script type="text/javascript">
var validate = function () {
const input = document.getElementById('file');
const output = document.getElementById('result');
var headers = new Headers();
headers.append('Content-Type', 'application/xml');
var requestOptions = {
method: 'POST',
headers: headers,
body: input.files[0],
redirect: 'follow',
};
fetch('/', requestOptions)
.then(response => response.text())
.then(result => output.innerText = result)
.catch(error => output.innerText = result);
return false;
};
</script>
<div data-app id="app">Loading validator... </div>
<script>
window.$docsify = {
repo: "itplr-kosit/validator",
loadSidebar: false,
hideSidebar: true,
autoHeader: true,
}
</script>
<script src="lib/docsify.min.js"></script>
</body>
</html>