Moved templates to be embedded in executable
This commit is contained in:
parent
b676be8cb2
commit
1c1a9589b7
25 changed files with 957 additions and 256 deletions
59
webserver/src/static/base.html
Normal file
59
webserver/src/static/base.html
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{% block title %}{% endblock title %}</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="/static/styles.css">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
background:
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 12rem;
|
||||
}
|
||||
|
||||
.sidebar a {
|
||||
padding: 0.5rem;
|
||||
border-radius: 3px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex h-full">
|
||||
<aside class="sidebar bg-stone-300 p-4 flex flex-col">
|
||||
<a class="hover:bg-stone-400" href="/">Summary</a>
|
||||
<a class="hover:bg-stone-400" href="/accounts">Accounts</a>
|
||||
<a class="hover:bg-stone-400" href="/classifiers">Classifiers</a>
|
||||
</aside>
|
||||
<div class="p-4 grow h-full overflow-auto">
|
||||
{% block body %}
|
||||
{% endblock body %}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let state = {execution: null};
|
||||
const check_exec = () => {
|
||||
return fetch('/execution')
|
||||
.then(response => response.text())
|
||||
.then(data => parseInt(data))
|
||||
.catch(err => {});
|
||||
}
|
||||
/*window.onload = () => {
|
||||
check_exec().then(exec => {
|
||||
state.execution = exec;
|
||||
setInterval(()=>{
|
||||
check_exec().then(exec => {
|
||||
if(exec && state.execution != exec) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
})
|
||||
}*/
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue