Skip to content

Commit b1e3324

Browse files
committed
feat: add hover card with subscription URL details in user modal
1 parent b3a39e3 commit b1e3324

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

public/locales/en/remnawave.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@
305305
"show-qr": "Show QR",
306306
"subscription-qr-code": "Subscription QR Code",
307307
"close": "Close",
308-
"edit-user-headline": "Edit user"
308+
"edit-user-headline": "Edit user",
309+
"subscription-url-description-line-1": "Domain and path resolved from .env variable:",
310+
"subscription-url-description-line-2": "If you want to change it, please change it in the .env file and restart Remnawave using command:"
309311
}
310312
},
311313
"base-api-token-form": {

src/widgets/dashboard/users/view-user-modal/view-user-modal.widget.tsx

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CopyButton,
99
Divider,
1010
Group,
11+
HoverCard,
1112
Modal,
1213
NumberInput,
1314
Progress,
@@ -34,6 +35,7 @@ import { UpdateUserCommand } from '@remnawave/backend-contract'
3435
import { TbDevices2, TbServerCog } from 'react-icons/tb'
3536
import { zodResolver } from 'mantine-form-zod-resolver'
3637
import { notifications } from '@mantine/notifications'
38+
import { HiQuestionMarkCircle } from 'react-icons/hi'
3739
import { useEffect, useMemo, useState } from 'react'
3840
import { DateTimePicker } from '@mantine/dates'
3941
import { useTranslation } from 'react-i18next'
@@ -315,7 +317,49 @@ export const ViewUserModal = () => {
315317

316318
<TextInput
317319
disabled
318-
label={t('view-user-modal.widget.subscription-url')}
320+
label={
321+
<Group gap={4} justify="flex-start">
322+
<Text>
323+
{t('view-user-modal.widget.subscription-url')}
324+
</Text>
325+
<HoverCard shadow="md" width={280} withArrow>
326+
<HoverCard.Target>
327+
<ActionIcon
328+
color="gray"
329+
size="xs"
330+
variant="subtle"
331+
>
332+
<HiQuestionMarkCircle size={20} />
333+
</ActionIcon>
334+
</HoverCard.Target>
335+
<HoverCard.Dropdown>
336+
<Stack gap="sm">
337+
<Text fw={600} size="sm">
338+
{t(
339+
'view-user-modal.widget.subscription-url'
340+
)}
341+
</Text>
342+
<Text c="dimmed" size="sm">
343+
{t(
344+
'view-user-modal.widget.subscription-url-description-line-1'
345+
)}
346+
<Code bg="gray.1" c="dark.4" fw={700}>
347+
SUB_PUBLIC_DOMAIN
348+
</Code>
349+
<br />
350+
{t(
351+
'view-user-modal.widget.subscription-url-description-line-2'
352+
)}
353+
</Text>
354+
<Code bg="gray.1" block c="dark.4" fw={700}>
355+
docker compose down && docker compose up
356+
-d
357+
</Code>
358+
</Stack>
359+
</HoverCard.Dropdown>
360+
</HoverCard>
361+
</Group>
362+
}
319363
leftSection={<PiLinkDuotone size="1rem" />}
320364
rightSection={
321365
<CopyButton

0 commit comments

Comments
 (0)