Skip to content

Commit c6d2191

Browse files
committed
fix(users): copy numeric user ID from actions menu
1 parent 21b74e8 commit c6d2191

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

dashboard/public/statics/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"monitorUsers": "Monitor Users",
2323
"alltime": "All time",
2424
"today": "Today",
25-
"coreUsername": "Core Username",
25+
"copyUserId": "Copy ID",
2626
"nodes": {
2727
"title": "Nodes",
2828
"description": "Manage your nodes",

dashboard/public/statics/locales/fa.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"monitorUsers": "مدیریت کاربران",
2727
"alltime": "همه زمان",
2828
"today": "امروز",
29-
"coreUsername": "نام کاربری هسته",
29+
"copyUserId": "کپی شناسه",
3030
"settings": {
3131
"title": "تنظیمات",
3232
"notifications": {

dashboard/public/statics/locales/ru.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"monitorUsers": "Мониторинг пользователей",
4949
"alltime": "Все время",
5050
"today": "Сегодня",
51-
"coreUsername": "Основное имя пользователя",
51+
"copyUserId": "Копировать ID",
5252
"create": "Создать",
5353
"nodes": {
5454
"title": "Узлы",

dashboard/public/statics/locales/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"monitorUsers": "监控用户",
2020
"alltime": "全部时间",
2121
"today": "今天",
22-
"coreUsername": "核心用户名",
22+
"copyUserId": "复制 ID",
2323
"create": "创建",
2424
"nodes": {
2525
"title": "节点",

dashboard/src/features/users/components/action-buttons.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useDirDetection from '@/hooks/use-dir-detection'
55
import { type UseEditFormValues } from '@/features/users/forms/user-form'
66
import { useActiveNextPlanById, useGetCurrentAdmin, useRemoveUserById, useResetUserDataUsageById, useRevokeUserSubscriptionById, UserResponse, UsersResponse } from '@/service/api'
77
import { useQueryClient } from '@tanstack/react-query'
8-
import { Cat, Check, Copy, Cpu, EllipsisVertical, Fingerprint, GlobeLock, Link2Off, ListStart, ListTree, Network, Pencil, PieChart, QrCode, RefreshCcw, Trash2, UserCog, Users } from 'lucide-react'
8+
import { Cat, Check, Copy, EllipsisVertical, Fingerprint, GlobeLock, Hash, Link2Off, ListStart, ListTree, Network, Pencil, PieChart, QrCode, RefreshCcw, Trash2, UserCog, Users } from 'lucide-react'
99
import { WireguardIcon, XrayIcon, SingboxIcon, MihomoIcon } from '@/components/icons/format-icons'
1010
import { Code } from 'lucide-react'
1111
import { FC, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'
@@ -438,9 +438,9 @@ const ActionButtons: FC<ActionButtonsProps> = ({ user, isModalHost = true, rende
438438
setSetOwnerModalOpen(true)
439439
}
440440

441-
const handleCopyCoreUsername = async () => {
441+
const handleCopyUserId = async () => {
442442
try {
443-
await navigator.clipboard.writeText(`${user.id}.${user.username}`)
443+
await navigator.clipboard.writeText(String(user.id))
444444
toast.success(t('usersTable.copied', { defaultValue: 'Copied to clipboard' }))
445445
} catch (error) {
446446
toast.error(t('copyFailed', { defaultValue: 'Failed to copy content' }))
@@ -719,9 +719,9 @@ const ActionButtons: FC<ActionButtonsProps> = ({ user, isModalHost = true, rende
719719
)}
720720

721721
{canReadAllUsers && (
722-
<DropdownMenuItem onSelect={handleCopyCoreUsername}>
723-
<Cpu className="mr-2 h-4 w-4" />
724-
<span>{t('coreUsername')}</span>
722+
<DropdownMenuItem onSelect={handleCopyUserId}>
723+
<Hash className="mr-2 h-4 w-4" />
724+
<span>{t('copyUserId')}</span>
725725
</DropdownMenuItem>
726726
)}
727727

0 commit comments

Comments
 (0)