Files
deskmeter/dmapp/dmweb/templates/main.html
buenosairesam de2ea3b7cb deploy updates
2026-01-26 21:39:21 -03:00

117 lines
3.2 KiB
HTML

<html>
<head>
<!-- <link rel="stylesheet" href="{{ url_for('static', filename='styles/dm.css') }}"> -->
{% block head %} {% endblock %}
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
padding: 20px;
box-sizing: border-box;
background-color: #1a1a1a;
color: #e0e0e0;
font-family: monospace;
}
.nav-bar {
position: absolute;
top: 20px;
left: 20px;
display: flex;
gap: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #444;
}
.nav-bar a {
text-decoration: none;
color: #6b9bd1;
font-size: 12pt;
padding: 5px 10px;
border-radius: 3px;
}
.nav-bar a:hover {
background-color: #2a2a2a;
}
.grey {
color: #666;
}
.blue {
color: #6b9bd1;
}
table {
font-size: clamp(14pt, 3vw, 28pt);
border-collapse: collapse;
}
td {
padding: 0.1em 0.5em;
}
td:first-child {
text-align: right;
padding-right: 0.3em;
}
td:last-child {
text-align: left;
font-variant-numeric: tabular-nums;
}
.workspace-table {
font-size: clamp(10pt, 2vw, 18pt);
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid #444;
}
.workspace-table td {
padding: 0.05em 0.4em;
}
</style>
{% if auto_refresh %}
<script>
function refreshData() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "/api/today", true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
document.getElementById("content-container").innerHTML =
xhr.responseText;
}
};
xhr.send();
}
// Auto-refresh every 5 seconds using AJAX
setInterval(refreshData, 5000);
</script>
{% endif %}
</head>
<body>
<!-- agregar función que me diga cuanto tiempo hace que esta activo el escritorio
(calcular el delta con el ultimo switch y pasarlo a mm:ss) -->
<div class="nav-bar">
<a href="/">Today</a>
<a href="/calendar/daily">Calendar</a>
<a href="/switches/daily">Switches</a>
<a href="/totals">All Time</a>
</div>
<div id="content-container">
{% block content %} {% include 'main_content.html' %} {% endblock %}
</div>
</body>
</html>