aboutsummaryrefslogtreecommitdiff
path: root/_wui/index.ts
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-19 00:25:26 +0700
committerShulhan <ms@kilabit.info>2024-03-19 00:25:26 +0700
commit57c0833153f9cc87ae72954f8876ea438d2552ae (patch)
treeab56416f0a30988a62f4cc1bfb2a9a93e414a865 /_wui/index.ts
parent2e619db979d76c3e478d0b0592a569a005dc18c0 (diff)
downloadhaminer-57c0833153f9cc87ae72954f8876ea438d2552ae.tar.xz
[wip] _wui: implement web user interface
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();