accounters/webserver/src/static/base.html
2024-06-03 18:39:17 +02:00

59 lines
1.5 KiB
HTML

<!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>