displaying rudimentary logs
This commit is contained in:
@@ -1,7 +1,29 @@
|
||||
class LogTable extends Shadow {
|
||||
state = {
|
||||
logs: []
|
||||
}
|
||||
|
||||
render() {
|
||||
VStack(() => {
|
||||
|
||||
this.state.logs.forEach((log) => {
|
||||
HStack(() => {
|
||||
p(log.time)
|
||||
p(log.ip)
|
||||
p(log.host)
|
||||
p(log.path)
|
||||
.maxWidth(50, vw)
|
||||
})
|
||||
.gap(1, em)
|
||||
})
|
||||
})
|
||||
.onAppear(async () => {
|
||||
let logs = await ServerClient.send("GET")
|
||||
this.state.logs = logs
|
||||
})
|
||||
.onEvent("log", (e) => {
|
||||
console.log(e.detail)
|
||||
this.state.logs.push(e.detail)
|
||||
console.log(this.state.logs)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user