mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
Drop workbench card blurbs and let API key secrets dismiss after copy.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
52cd4d1298
commit
99d180c501
4 changed files with 6 additions and 33 deletions
|
|
@ -20,7 +20,6 @@ export type ModuleDefinition = {
|
||||||
path: string;
|
path: string;
|
||||||
section: WorkbenchSection;
|
section: WorkbenchSection;
|
||||||
labelKey: string;
|
labelKey: string;
|
||||||
descKey?: string;
|
|
||||||
iconTone: ModuleIconTone;
|
iconTone: ModuleIconTone;
|
||||||
iconKind: ModuleIconKind;
|
iconKind: ModuleIconKind;
|
||||||
titleKey: string;
|
titleKey: string;
|
||||||
|
|
@ -37,7 +36,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/ume",
|
path: "/ume",
|
||||||
section: "monitoring",
|
section: "monitoring",
|
||||||
labelKey: "workbench.cards.umeSync",
|
labelKey: "workbench.cards.umeSync",
|
||||||
descKey: "workbench.cards.umeSyncDesc",
|
|
||||||
iconTone: "blue",
|
iconTone: "blue",
|
||||||
iconKind: "sync",
|
iconKind: "sync",
|
||||||
titleKey: "layout.titleUme",
|
titleKey: "layout.titleUme",
|
||||||
|
|
@ -48,7 +46,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/ne",
|
path: "/ne",
|
||||||
section: "operations",
|
section: "operations",
|
||||||
labelKey: "workbench.cards.managedNe",
|
labelKey: "workbench.cards.managedNe",
|
||||||
descKey: "workbench.cards.managedNeDesc",
|
|
||||||
iconTone: "green",
|
iconTone: "green",
|
||||||
iconKind: "server",
|
iconKind: "server",
|
||||||
titleKey: "layout.titleManagedNe",
|
titleKey: "layout.titleManagedNe",
|
||||||
|
|
@ -59,7 +56,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/network",
|
path: "/network",
|
||||||
section: "operations",
|
section: "operations",
|
||||||
labelKey: "workbench.cards.network",
|
labelKey: "workbench.cards.network",
|
||||||
descKey: "workbench.cards.networkDesc",
|
|
||||||
iconTone: "slate",
|
iconTone: "slate",
|
||||||
iconKind: "network",
|
iconKind: "network",
|
||||||
titleKey: "layout.titleNetwork",
|
titleKey: "layout.titleNetwork",
|
||||||
|
|
@ -70,7 +66,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/topology",
|
path: "/topology",
|
||||||
section: "operations",
|
section: "operations",
|
||||||
labelKey: "workbench.cards.topology",
|
labelKey: "workbench.cards.topology",
|
||||||
descKey: "workbench.cards.topologyDesc",
|
|
||||||
iconTone: "amber",
|
iconTone: "amber",
|
||||||
iconKind: "topology",
|
iconKind: "topology",
|
||||||
titleKey: "layout.titleTopology",
|
titleKey: "layout.titleTopology",
|
||||||
|
|
@ -81,7 +76,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/webcrt",
|
path: "/webcrt",
|
||||||
section: "operations",
|
section: "operations",
|
||||||
labelKey: "workbench.cards.webcrt",
|
labelKey: "workbench.cards.webcrt",
|
||||||
descKey: "workbench.cards.webcrtDesc",
|
|
||||||
iconTone: "slate",
|
iconTone: "slate",
|
||||||
iconKind: "terminal",
|
iconKind: "terminal",
|
||||||
titleKey: "layout.titleWebcrt",
|
titleKey: "layout.titleWebcrt",
|
||||||
|
|
@ -92,7 +86,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/port-traffic/wall",
|
path: "/port-traffic/wall",
|
||||||
section: "operations",
|
section: "operations",
|
||||||
labelKey: "workbench.cards.portTrafficWall",
|
labelKey: "workbench.cards.portTrafficWall",
|
||||||
descKey: "workbench.cards.portTrafficWallDesc",
|
|
||||||
iconTone: "amber",
|
iconTone: "amber",
|
||||||
iconKind: "wall",
|
iconKind: "wall",
|
||||||
titleKey: "layout.titlePortTrafficWall",
|
titleKey: "layout.titlePortTrafficWall",
|
||||||
|
|
@ -104,7 +97,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/users",
|
path: "/users",
|
||||||
section: "system",
|
section: "system",
|
||||||
labelKey: "workbench.cards.users",
|
labelKey: "workbench.cards.users",
|
||||||
descKey: "workbench.cards.usersDesc",
|
|
||||||
iconTone: "slate",
|
iconTone: "slate",
|
||||||
iconKind: "users",
|
iconKind: "users",
|
||||||
titleKey: "layout.titleUsers",
|
titleKey: "layout.titleUsers",
|
||||||
|
|
@ -115,7 +107,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/audit",
|
path: "/audit",
|
||||||
section: "system",
|
section: "system",
|
||||||
labelKey: "workbench.cards.audit",
|
labelKey: "workbench.cards.audit",
|
||||||
descKey: "workbench.cards.auditDesc",
|
|
||||||
iconTone: "amber",
|
iconTone: "amber",
|
||||||
iconKind: "audit",
|
iconKind: "audit",
|
||||||
titleKey: "layout.titleAudit",
|
titleKey: "layout.titleAudit",
|
||||||
|
|
@ -125,7 +116,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/api-keys",
|
path: "/api-keys",
|
||||||
section: "system",
|
section: "system",
|
||||||
labelKey: "workbench.cards.apiKeys",
|
labelKey: "workbench.cards.apiKeys",
|
||||||
descKey: "workbench.cards.apiKeysDesc",
|
|
||||||
iconTone: "green",
|
iconTone: "green",
|
||||||
iconKind: "key",
|
iconKind: "key",
|
||||||
titleKey: "layout.titleApiKeys",
|
titleKey: "layout.titleApiKeys",
|
||||||
|
|
@ -135,7 +125,6 @@ export const MODULES: readonly ModuleDefinition[] = [
|
||||||
path: "/sessions",
|
path: "/sessions",
|
||||||
section: "system",
|
section: "system",
|
||||||
labelKey: "workbench.cards.sessions",
|
labelKey: "workbench.cards.sessions",
|
||||||
descKey: "workbench.cards.sessionsDesc",
|
|
||||||
iconTone: "slate",
|
iconTone: "slate",
|
||||||
iconKind: "key",
|
iconKind: "key",
|
||||||
titleKey: "layout.titleSessions",
|
titleKey: "layout.titleSessions",
|
||||||
|
|
|
||||||
|
|
@ -79,27 +79,16 @@ const en = {
|
||||||
},
|
},
|
||||||
cards: {
|
cards: {
|
||||||
umeSync: "UME Sync",
|
umeSync: "UME Sync",
|
||||||
umeSyncDesc: "UME alarms, subscription & inventory",
|
|
||||||
network: "Network Management",
|
network: "Network Management",
|
||||||
networkDesc: "NE inventory, alarms, config sync, and monitoring tasks",
|
|
||||||
managedNe: "NE Management",
|
managedNe: "NE Management",
|
||||||
managedNeDesc: "Multi-vendor SSH/Telnet NEs & connectivity test",
|
|
||||||
collect: "Batch Collect",
|
collect: "Batch Collect",
|
||||||
collectDesc: "Run custom CLI commands on connected NEs and save logs",
|
|
||||||
webcrt: "WebCRT",
|
webcrt: "WebCRT",
|
||||||
webcrtDesc: "Interactive browser login to connected NEs (SSH/Telnet)",
|
|
||||||
topology: "Topology",
|
topology: "Topology",
|
||||||
topologyDesc: "Fabric topology views; LLDP physical discovery; MCP paged graph query",
|
|
||||||
portTrafficWall: "Traffic wall",
|
portTrafficWall: "Traffic wall",
|
||||||
portTrafficWallDesc: "Named traffic boards in dedicated tabs",
|
|
||||||
users: "Users",
|
users: "Users",
|
||||||
usersDesc: "Admin: create, disable users and reset passwords",
|
|
||||||
audit: "Audit",
|
audit: "Audit",
|
||||||
auditDesc: "Live task overview and operation logs",
|
|
||||||
apiKeys: "API Keys",
|
apiKeys: "API Keys",
|
||||||
apiKeysDesc: "Issue MCP/script tokens per user with expiry",
|
|
||||||
sessions: "Login sessions",
|
sessions: "Login sessions",
|
||||||
sessionsDesc: "Review and revoke logins on other devices",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
network: {
|
network: {
|
||||||
|
|
|
||||||
|
|
@ -79,27 +79,16 @@ const zh = {
|
||||||
},
|
},
|
||||||
cards: {
|
cards: {
|
||||||
umeSync: "UME同步",
|
umeSync: "UME同步",
|
||||||
umeSyncDesc: "UME 告警同步、订阅与清单",
|
|
||||||
network: "网络管理",
|
network: "网络管理",
|
||||||
networkDesc: "网元清单、告警、配置同步与监控任务",
|
|
||||||
managedNe: "网元管理",
|
managedNe: "网元管理",
|
||||||
managedNeDesc: "多厂商 SSH/Telnet 网元与连通性测试",
|
|
||||||
collect: "批量采集",
|
collect: "批量采集",
|
||||||
collectDesc: "对已连通网元执行定制 CLI 命令并保存日志",
|
|
||||||
webcrt: "WebCRT",
|
webcrt: "WebCRT",
|
||||||
webcrtDesc: "浏览器内交互登录已连通网元(SSH/Telnet)",
|
|
||||||
topology: "拓扑管理",
|
topology: "拓扑管理",
|
||||||
topologyDesc: "Fabric 拓扑视图;LLDP 发现物理链路,MCP 可分页拉图",
|
|
||||||
portTrafficWall: "流量大屏",
|
portTrafficWall: "流量大屏",
|
||||||
portTrafficWallDesc: "独立页签打开命名流量大屏",
|
|
||||||
users: "用户管理",
|
users: "用户管理",
|
||||||
usersDesc: "管理员添加、禁用用户并重置密码",
|
|
||||||
audit: "操作审计",
|
audit: "操作审计",
|
||||||
auditDesc: "任务概览与操作日志",
|
|
||||||
apiKeys: "API Key",
|
apiKeys: "API Key",
|
||||||
apiKeysDesc: "为用户生成 MCP/脚本用 Token,可设有效期",
|
|
||||||
sessions: "登录会话",
|
sessions: "登录会话",
|
||||||
sessionsDesc: "查看并踢掉其他设备上的登录",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
network: {
|
network: {
|
||||||
|
|
|
||||||
|
|
@ -164,10 +164,13 @@ export function ApiTokensPage() {
|
||||||
createMut.mutate();
|
createMut.mutate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const dismissCreatedPlain = () => setCreatedPlain("");
|
||||||
|
|
||||||
const copyToken = async () => {
|
const copyToken = async () => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(createdPlain);
|
await navigator.clipboard.writeText(createdPlain);
|
||||||
showOk(t("auth.tokenCopied"));
|
showOk(t("auth.tokenCopied"));
|
||||||
|
dismissCreatedPlain();
|
||||||
} catch {
|
} catch {
|
||||||
showError(t("auth.tokenCopyFailed"));
|
showError(t("auth.tokenCopyFailed"));
|
||||||
}
|
}
|
||||||
|
|
@ -260,6 +263,9 @@ export function ApiTokensPage() {
|
||||||
<button type="button" onClick={() => void copyToken()}>
|
<button type="button" onClick={() => void copyToken()}>
|
||||||
{t("auth.copyToken")}
|
{t("auth.copyToken")}
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" onClick={dismissCreatedPlain}>
|
||||||
|
{t("common.close")}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue