refactor(layout, i18n, admin): 优化布局结构与多语言支持
调整 AdminShell 组件的子组件顺序,提升代码可读性。更新 admin-breadcrumb 组件,简化导航标签翻译逻辑,确保多语言支持的一致性。重构 admin-language-switcher 组件,优化语言切换的用户体验,增强界面交互性。更新多语言配置,新增登录界面的副标题,提升用户体验。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { Download, Link2, Pencil, ShieldAlert } from "lucide-react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
@@ -14,6 +15,7 @@ import {
|
||||
putAdminIntegrationSite,
|
||||
} from "@/api/admin-integration-sites";
|
||||
import { AdminPageCard } from "@/components/admin/admin-page-card";
|
||||
import { AdminRowActionsMenu } from "@/components/admin/admin-row-actions-menu";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
@@ -361,7 +363,7 @@ export function IntegrationSitesConsole() {
|
||||
<TableHead>{t("integrationSites.columns.name")}</TableHead>
|
||||
<TableHead>{t("integrationSites.columns.status")}</TableHead>
|
||||
<TableHead>{t("integrationSites.columns.walletUrl")}</TableHead>
|
||||
<TableHead className="text-right">{t("integrationSites.columns.actions")}</TableHead>
|
||||
<TableHead className="w-14 text-center">{t("integrationSites.columns.actions")}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -381,46 +383,40 @@ export function IntegrationSitesConsole() {
|
||||
<TableCell className="max-w-[240px] truncate text-xs text-muted-foreground">
|
||||
{row.wallet_api_url ?? "—"}
|
||||
</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<div className="flex flex-wrap justify-end gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => openConnectivity(row)}
|
||||
>
|
||||
{t("integrationSites.connectivityTest")}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={exportBusyId === row.id}
|
||||
onClick={() => void exportParameterSheet(row)}
|
||||
>
|
||||
{t("integrationSites.exportParams")}
|
||||
</Button>
|
||||
{canManage ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => void openEdit(row)}
|
||||
>
|
||||
{t("integrationSites.edit")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canManage ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
onClick={() => setRotateTarget(row)}
|
||||
>
|
||||
{t("integrationSites.rotateSecrets")}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
<TableCell className="text-center">
|
||||
<AdminRowActionsMenu
|
||||
busy={exportBusyId === row.id}
|
||||
actions={[
|
||||
{
|
||||
key: "connectivity",
|
||||
label: t("integrationSites.connectivityTest"),
|
||||
icon: Link2,
|
||||
onClick: () => openConnectivity(row),
|
||||
},
|
||||
{
|
||||
key: "export",
|
||||
label: t("integrationSites.exportParams"),
|
||||
icon: Download,
|
||||
disabled: exportBusyId === row.id,
|
||||
onClick: () => void exportParameterSheet(row),
|
||||
},
|
||||
{
|
||||
key: "edit",
|
||||
label: t("integrationSites.edit"),
|
||||
icon: Pencil,
|
||||
hidden: !canManage,
|
||||
onClick: () => void openEdit(row),
|
||||
},
|
||||
{
|
||||
key: "rotate",
|
||||
label: t("integrationSites.rotateSecrets"),
|
||||
icon: ShieldAlert,
|
||||
destructive: true,
|
||||
hidden: !canManage,
|
||||
onClick: () => setRotateTarget(row),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user