mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-06-21 02:20:41 +00:00
implement group page (#6)
* implement group page * group state, search box * rename some field * update api types
This commit is contained in:
@@ -15,9 +15,11 @@ import { IconButton } from "@/components/xui/icon-button"
|
||||
import { InstallCommandsMenu } from "@/components/install-commands"
|
||||
import { NoteMenu } from "@/components/note-menu"
|
||||
import { TerminalButton } from "@/components/terminal"
|
||||
import { useServer } from "@/hooks/useServer"
|
||||
|
||||
export default function ServerPage() {
|
||||
const { data, mutate, error, isLoading } = useSWR<Server[]>('/api/v1/server', swrFetcher);
|
||||
const { serverGroups } = useServer();
|
||||
|
||||
useEffect(() => {
|
||||
if (error)
|
||||
@@ -69,7 +71,11 @@ export default function ServerPage() {
|
||||
{
|
||||
header: "Groups",
|
||||
accessorKey: "groups",
|
||||
accessorFn: row => "stub",
|
||||
accessorFn: row => {
|
||||
return serverGroups?.filter(sg => sg.servers.includes(row.id))
|
||||
.map(sg => sg.group.id)
|
||||
|| [];
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "ip",
|
||||
|
||||
Reference in New Issue
Block a user