Files
Console/ui/desktop/components/LogTable.js
2025-12-26 06:55:32 -06:00

31 lines
744 B
JavaScript

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)
})
}
}
register(LogTable)