Implement some authentication
This commit is contained in:
@@ -23,18 +23,17 @@
|
||||
|
||||
<script lang="ts">
|
||||
export let timestamp: string;
|
||||
export let type: string;
|
||||
export let value: any;
|
||||
|
||||
let icon = "far fa-circle-question";
|
||||
let text = "Unknown event";
|
||||
let text = `Unknown event (${type})`;
|
||||
|
||||
if ("type" in value) {
|
||||
let m = mappings.get(value.type);
|
||||
if (m) {
|
||||
let mapped = m(value);
|
||||
icon = mapped.icon;
|
||||
text = mapped.text;
|
||||
}
|
||||
let m = mappings.get(type);
|
||||
if (m) {
|
||||
let mapped = m(value);
|
||||
icon = mapped.icon;
|
||||
text = mapped.text;
|
||||
}
|
||||
|
||||
let datetime = new Date(timestamp);
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
const ENDPOINT = "/api/events";
|
||||
|
||||
let events: { _id: string; timestamp: string; value: any }[] = [];
|
||||
let events: { _id: string; timestamp: string; type: string; value: any }[] =
|
||||
[];
|
||||
|
||||
onMount(() => {
|
||||
let int = setInterval(async () => {
|
||||
|
||||
Reference in New Issue
Block a user