Compare commits

..

No commits in common. "28cffcfb42b70df61c448854b85b61bc33b6398d" and "9529d2cdc8ea3b7d6bb70e2275647db7769e62cb" have entirely different histories.

4 changed files with 20 additions and 37 deletions

View File

@ -15,7 +15,7 @@
<body>
<div class="topnav">
<a class="active" href="/home">Home</a>
<a class="active" href="/home/index.html">Home</a>
<div style="display: flex; justify-content: flex-end;">
<a href="/devices">Devices</a>
<a href="/profile">Profile</a>

View File

@ -4,13 +4,6 @@
<meta charset="UTF-8" />
<title>Temperature Alarm</title>
<link rel="stylesheet" href="/styles/frontpage.css">
<script type="module">
import { isLoggedIn } from "./shared/utils.js";
if (isLoggedIn()) {
location.href = "/home";
}
</script>
</head>
<body>
<main>

View File

@ -115,10 +115,10 @@ async function init() {
x: new Date(log.date).getTime(),
y: log.temperature,
})),
parsing: false,
})),
},
options: {
parsing: false,
plugins: {
tooltip: {
callbacks: {
@ -127,8 +127,6 @@ async function init() {
},
decimation: {
enabled: true,
algorithm: "lttb",
samples: window.innerWidth / 2,
},
},
scales: {

View File

@ -16,10 +16,6 @@ export async function request(method, path, body = null) {
body: body ? JSON.stringify(body) : undefined,
})
.then(async response => {
if (response.status === 401) {
location.href = "/login";
}
try {
const json = await response.json();
@ -50,7 +46,3 @@ export function getUser() {
return JSON.parse(localStorage.getItem("user"));
}
export function isLoggedIn() {
return document.cookie.match(/\bauth-token=/) && localStorage.getItem("user");
}