Skip to content

Commit 52e5a9f

Browse files
committed
chore: add ID field to user table and user identification card
1 parent 91041d1 commit 52e5a9f

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@monaco-editor/react": "^4.7.0",
6060
"@noble/post-quantum": "^0.5.2",
6161
"@paralleldrive/cuid2": "2.2.2",
62-
"@remnawave/backend-contract": "2.3.26",
62+
"@remnawave/backend-contract": "2.3.27",
6363
"@simplewebauthn/browser": "^13.2.2",
6464
"@stablelib/base64": "^2.0.1",
6565
"@stablelib/x25519": "^2.0.1",

src/features/dashboard/users/users-table/model/use-table-columns.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export const useUserTableColumns = (
4141
maxSize: 300,
4242
size: 220
4343
},
44+
{
45+
accessorKey: 'id',
46+
header: 'ID',
47+
accessorFn: (originalRow) => originalRow.id,
48+
size: 80
49+
},
4450
{
4551
accessorKey: 'status',
4652
header: t('use-table-columns.status'),

src/shared/ui/forms/users/forms-components/user-identification-card.tsx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ import {
99
Text,
1010
TextInput
1111
} from '@mantine/core'
12-
import { PiCheck, PiCopy, PiLinkDuotone, PiUserDuotone } from 'react-icons/pi'
12+
import {
13+
PiCheck,
14+
PiCopy,
15+
PiIdentificationCardDuotone,
16+
PiLinkDuotone,
17+
PiUserDuotone
18+
} from 'react-icons/pi'
1319
import { ForwardRefComponent, HTMLMotionProps, Variants } from 'motion/react'
1420
import { HiIdentification, HiQuestionMarkCircle } from 'react-icons/hi'
1521
import { GetUserByUuidCommand } from '@remnawave/backend-contract'
@@ -47,6 +53,33 @@ export const UserIdentificationCard = (props: IProps) => {
4753
}
4854
>
4955
<Stack gap="md">
56+
<CopyButton timeout={2000} value={user.id.toString()}>
57+
{({ copied, copy }) => (
58+
<TextInput
59+
label="ID"
60+
leftSection={<PiIdentificationCardDuotone size="16px" />}
61+
onClick={copy}
62+
readOnly
63+
rightSection={
64+
<ActionIcon
65+
color={copied ? 'teal' : 'gray'}
66+
onClick={copy}
67+
variant="subtle"
68+
>
69+
{copied ? <PiCheck size="16px" /> : <PiCopy size="16px" />}
70+
</ActionIcon>
71+
}
72+
styles={{
73+
input: {
74+
cursor: 'copy',
75+
fontFamily: 'monospace'
76+
}
77+
}}
78+
value={user.id.toString()}
79+
/>
80+
)}
81+
</CopyButton>
82+
5083
<CopyButton timeout={2000} value={user.username}>
5184
{({ copied, copy }) => (
5285
<TextInput

src/widgets/dashboard/users/detailed-user-info-drawer/detailed-user-info-drawer.widget.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ export const DetailedUserInfoDrawerWidget = () => {
131131
</Badge>
132132
</Group>
133133

134+
<CopyableFieldShared label="ID" value={user.id.toString()} />
135+
134136
<CopyableFieldShared
135137
label={t('detailed-user-info-drawer.widget.uuid')}
136138
value={user.uuid}

0 commit comments

Comments
 (0)