aboutsummaryrefslogtreecommitdiff
path: root/_wui/index.ts
diff options
context:
space:
mode:
Diffstat (limited to '_wui/index.ts')
-rw-r--r--_wui/index.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/_wui/index.ts b/_wui/index.ts
new file mode 100644
index 0000000..74fd18f
--- /dev/null
+++ b/_wui/index.ts
@@ -0,0 +1,19 @@
+class Haminer {
+ apiLogTail(id: string) {
+ var comp = document.getElementById(id);
+
+ const evtSource = new EventSource("/api/log/tail");
+
+ evtSource.onmessage = (event) => {
+ const elLog = document.createElement("div");
+
+ console.log(`${event.data}`);
+
+ elLog.textContent = event.data;
+
+ comp.prepend(elLog);
+ };
+ }
+}
+
+let haminer = new Haminer();