refactor: update user table layout to include ID and swap last login with contact information

This commit is contained in:
mlogclub
2026-07-28 23:15:21 +08:00
parent 7e6b3fcfe4
commit abbb3594f5
+12 -8
View File
@@ -339,17 +339,21 @@ export default function DashboardUsersPage() {
<Table> <Table>
<TableHeader className="bg-muted/40"> <TableHeader className="bg-muted/40">
<TableRow> <TableRow>
<TableHead className="w-20">ID</TableHead>
<TableHead>{t("user.columnUser")}</TableHead> <TableHead>{t("user.columnUser")}</TableHead>
<TableHead>{t("user.columnRoles")}</TableHead> <TableHead>{t("user.columnRoles")}</TableHead>
<TableHead>{t("user.columnStatus")}</TableHead> <TableHead>{t("user.columnStatus")}</TableHead>
<TableHead>{t("user.columnLastLogin")}</TableHead>
<TableHead>{t("user.columnContact")}</TableHead> <TableHead>{t("user.columnContact")}</TableHead>
<TableHead>{t("user.columnLastLogin")}</TableHead>
<TableHead className="w-[92px] text-right">{t("user.columnActions")}</TableHead> <TableHead className="w-[92px] text-right">{t("user.columnActions")}</TableHead>
</TableRow> </TableRow>
</TableHeader> </TableHeader>
<TableBody> <TableBody>
{list.result.results.map((item) => ( {list.result.results.map((item) => (
<TableRow key={item.id}> <TableRow key={item.id}>
<TableCell className="font-mono text-sm text-muted-foreground">
{item.id}
</TableCell>
<TableCell> <TableCell>
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<div className="flex size-10 items-center justify-center rounded-md bg-muted text-muted-foreground"> <div className="flex size-10 items-center justify-center rounded-md bg-muted text-muted-foreground">
@@ -385,18 +389,18 @@ export default function DashboardUsersPage() {
</Badge> </Badge>
) : null} ) : null}
</TableCell> </TableCell>
<TableCell>
<div className="text-sm">{formatDateTime(item.lastLoginAt)}</div>
<div className="text-xs text-muted-foreground">
{item.lastLoginIp || "-"}
</div>
</TableCell>
<TableCell> <TableCell>
<div className="text-sm">{item.mobile || "-"}</div> <div className="text-sm">{item.mobile || "-"}</div>
<div className="text-xs text-muted-foreground"> <div className="text-xs text-muted-foreground">
{item.email || "-"} {item.email || "-"}
</div> </div>
</TableCell> </TableCell>
<TableCell>
<div className="text-sm">{formatDateTime(item.lastLoginAt)}</div>
<div className="text-xs text-muted-foreground">
{item.lastLoginIp || "-"}
</div>
</TableCell>
<TableCell className="text-right"> <TableCell className="text-right">
<ButtonGroup className="ml-auto"> <ButtonGroup className="ml-auto">
<Button <Button
@@ -450,7 +454,7 @@ export default function DashboardUsersPage() {
))} ))}
{list.loading || list.result.results.length === 0 ? ( {list.loading || list.result.results.length === 0 ? (
<DashboardTableStateRow <DashboardTableStateRow
colSpan={6} colSpan={7}
loading={list.loading} loading={list.loading}
loadingText={t("user.loadingRows")} loadingText={t("user.loadingRows")}
emptyText={t("user.emptyRows")} emptyText={t("user.emptyRows")}