+
+
-
-
+
+
MAC地址
- 内网IP
- 配置版本
- 状态
+ 内网IP
+ 配置版本
+ 状态
{filteredData.map((item, index) => (
-
-
+
+
{item.macaddr}
- {item.inner_ip}
- {item.setid}
-
+ {item.inner_ip}
+ {item.setid}
+
{getStatusText(item.enable)}
@@ -236,8 +234,7 @@ export default function Gatewayinfo() {
-
-
+
{data.length}
网关总数
@@ -256,6 +253,6 @@ export default function Gatewayinfo() {
-
+
)
}
diff --git a/src/app/(root)/layout.tsx b/src/app/(root)/layout.tsx
index b53da0a..1ef818a 100644
--- a/src/app/(root)/layout.tsx
+++ b/src/app/(root)/layout.tsx
@@ -89,10 +89,10 @@ function NavbarItem(props: {
return (
{props.children}
diff --git a/src/app/(root)/settings/page.tsx b/src/app/(root)/settings/page.tsx
index 53a7d69..0c40645 100644
--- a/src/app/(root)/settings/page.tsx
+++ b/src/app/(root)/settings/page.tsx
@@ -7,10 +7,11 @@ import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card'
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'
-import { User, Lock, Search, Trash2, Plus, X } from 'lucide-react'
+import { UserIcon, LockIcon, SearchIcon, Trash2Icon, PlusIcon, XIcon } from 'lucide-react'
import { toast, Toaster } from 'sonner'
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
import { findUsers, createUser, removeUser } from '@/actions/user'
+import { Page } from '@/components/page'
// 用户类型定义
interface UserData {
@@ -123,183 +124,181 @@ export default function Settings() {
)
return (
-
-
-
-
用户管理
-
+
+
+
用户管理
+
+
+
+ {isCreateMode && (
+
+
+ 添加用户账号
+ 创建新的系统用户账户
+
+
+
+
+
+
+ )}
+
+ {/* 用户列表直接显示在页面上 */}
+
+
- {isCreateMode && (
-
-
- 添加用户账号
- 创建新的系统用户账户
-
-
-
-
-
-
- )}
-
- {/* 用户列表直接显示在页面上 */}
-
-
-
-
-
- setSearchTerm(e.target.value)}
- />
-
-
-
-
-
+
+
+
+
+ 账号
+ 创建时间
+ 操作
+
+
+
+ {filteredUsers.length === 0 ? (
- 账号
- 创建时间
- 操作
+
+ 暂无用户数据
+
-
-
- {filteredUsers.length === 0 ? (
-
-
- 暂无用户数据
+ ) : (
+ filteredUsers.map(user => (
+
+ {user.account}
+ {new Date(user.createdAt).toLocaleDateString()}
+
+
+
+
- ) : (
- filteredUsers.map(user => (
-
- {user.account}
- {new Date(user.createdAt).toLocaleDateString()}
-
-
-
-
-
-
- ))
- )}
-
-
-
+ ))
+ )}
+
+
-
+
)
}
diff --git a/src/components/page.tsx b/src/components/page.tsx
index a90d01a..61aa8df 100644
--- a/src/components/page.tsx
+++ b/src/components/page.tsx
@@ -1,10 +1,11 @@
+import { cn } from '@/lib/utils'
import { ComponentProps, ReactNode } from 'react'
export function Page(props: {
children: ReactNode
} & ComponentProps<'div'>) {
return (
-
+
{props.children}
)
diff --git a/src/components/ui/pagination.tsx b/src/components/ui/pagination.tsx
index 91968c2..e7648a0 100644
--- a/src/components/ui/pagination.tsx
+++ b/src/components/ui/pagination.tsx
@@ -107,7 +107,7 @@ function Pagination({
const paginationItems = generatePaginationItems()
return (
-