mirror of
https://github.com/fankes/beszel.git
synced 2025-10-22 03:19:22 +08:00
react + updates
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useEffect } from 'preact/hooks'
|
||||
import { useEffect } from 'react'
|
||||
import { $servers, pb } from '@/lib/stores'
|
||||
import { DataTable } from '../server-table/data-table'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../ui/card'
|
||||
import { useStore } from '@nanostores/preact'
|
||||
import { useStore } from '@nanostores/react'
|
||||
import { SystemRecord } from '@/types'
|
||||
|
||||
export function Home() {
|
||||
@@ -43,7 +43,9 @@ export function Home() {
|
||||
}
|
||||
$servers.set(newServers)
|
||||
})
|
||||
return () => pb.collection('systems').unsubscribe('*')
|
||||
return () => {
|
||||
pb.collection('systems').unsubscribe('*')
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { pb } from '@/lib/stores'
|
||||
import { SystemRecord } from '@/types'
|
||||
import { useEffect, useState } from 'preact/hooks'
|
||||
import { useRoute } from 'wouter-preact'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useRoute } from 'wouter'
|
||||
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '../ui/card'
|
||||
|
||||
export function ServerDetail() {
|
||||
@@ -18,7 +18,7 @@ export function ServerDetail() {
|
||||
.then((record) => {
|
||||
setServer(record)
|
||||
})
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Reference in New Issue
Block a user