mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 10:19:27 +08:00
updates
This commit is contained in:
@@ -1,12 +1,28 @@
|
||||
import { useEffect } from 'preact/hooks'
|
||||
import { pb } from '@/lib/stores'
|
||||
import { SystemRecord } from '@/types'
|
||||
import { useEffect, useState } from 'preact/hooks'
|
||||
import { useRoute } from 'wouter-preact'
|
||||
|
||||
export function ServerDetail() {
|
||||
const [_, params] = useRoute('/server/:name')
|
||||
const [node, setNode] = useState({} as SystemRecord)
|
||||
|
||||
useEffect(() => {
|
||||
document.title = `Server: ${params!.name}`
|
||||
document.title = params!.name
|
||||
}, [])
|
||||
|
||||
return <>Info for {params!.name}</>
|
||||
useEffect(() => {
|
||||
pb.collection<SystemRecord>('systems')
|
||||
.getFirstListItem(`name="${params!.name}"`)
|
||||
.then((record) => {
|
||||
setNode(record)
|
||||
})
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1>{node.name}</h1>
|
||||
<pre>{JSON.stringify(node, null, 2)}</pre>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user