Skip to content

Commit d71cd34

Browse files
committed
feat: add copy functionality for UUID in InboundsCardWidget
- Implemented a CopyButton in the InboundsCardWidget to allow users to easily copy the UUID of an inbound. - Updated localization files for English, Persian, and Russian to include new translations
1 parent 8055f72 commit d71cd34

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

public/locales/en/remnawave.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@
572572
"add-nodes-to-inbound-line-1": "Are you sure you want to add this inbound to nodes?",
573573
"add-nodes-to-inbound-line-2": "This action will add the inbound to all nodes.",
574574
"remove-nodes-from-inbound-line-1": "Are you sure you want to remove this inbound from nodes?",
575-
"remove-nodes-from-inbound-line-2": "This action will remove the inbound from all nodes."
575+
"remove-nodes-from-inbound-line-2": "This action will remove the inbound from all nodes.",
576+
"copied": "Copied",
577+
"copy-uuid": "Copy UUID"
576578
}
577579
},
578580
"multi-select-hosts": {

public/locales/fa/remnawave.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@
572572
"add-nodes-to-inbound-line-1": "آیا مطمئن هستید که می‌خواهید این اینباند را به نودها اضافه کنید؟",
573573
"add-nodes-to-inbound-line-2": "این اقدام اینباند را به همه نودها اضافه خواهد کرد.",
574574
"remove-nodes-from-inbound-line-1": "آیا مطمئن هستید که می‌خواهید این اینباند را از نودها حذف کنید؟",
575-
"remove-nodes-from-inbound-line-2": "این اقدام اینباند را از همه نودها حذف خواهد کرد."
575+
"remove-nodes-from-inbound-line-2": "این اقدام اینباند را از همه نودها حذف خواهد کرد.",
576+
"copied": "کپی شده",
577+
"copy-uuid": "کپی UUID"
576578
}
577579
},
578580
"multi-select-hosts": {
@@ -719,4 +721,4 @@
719721
"bulk-actions": "اقدامات دسته‌جمعی"
720722
}
721723
}
722-
}
724+
}

public/locales/ru/remnawave.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@
572572
"add-nodes-to-inbound-line-1": "Вы уверены, что хотите добавить этот инбаунд нодам?",
573573
"add-nodes-to-inbound-line-2": "Это действие добавит инбаунд всем нодам.",
574574
"remove-nodes-from-inbound-line-1": "Вы уверены, что хотите удалить этот инбаунд у нод?",
575-
"remove-nodes-from-inbound-line-2": "Это действие удалит инбаунд у всех нод."
575+
"remove-nodes-from-inbound-line-2": "Это действие удалит инбаунд у всех нод.",
576+
"copied": "Скопированный",
577+
"copy-uuid": "Копировать uuid"
576578
}
577579
},
578580
"multi-select-hosts": {
@@ -719,4 +721,4 @@
719721
"bulk-actions": "Массовые действия"
720722
}
721723
}
722-
}
724+
}

src/widgets/dashboard/inbounds/inbounds-card/inbounds-card.widget.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
Badge,
33
Button,
44
Card,
5+
CopyButton,
56
Divider,
67
Group,
78
JsonInput,
@@ -12,7 +13,9 @@ import {
1213
Tooltip
1314
} from '@mantine/core'
1415
import {
16+
PiCheck,
1517
PiCode,
18+
PiCopy,
1619
PiCpu,
1720
PiDoorOpen,
1821
PiGlobe,
@@ -346,6 +349,21 @@ export function InboundsCardWidget(props: IProps) {
346349
>
347350
{t('inbounds-card.widget.show-raw-inbound')}
348351
</Button>
352+
<CopyButton timeout={2000} value={inbound.uuid}>
353+
{({ copied, copy }) => (
354+
<Button
355+
color={copied ? 'teal' : 'gray'}
356+
leftSection={copied ? <PiCheck size="1rem" /> : <PiCopy size="1rem" />}
357+
onClick={copy}
358+
size="sm"
359+
variant="subtle"
360+
>
361+
{copied
362+
? t('inbounds-card.widget.copied')
363+
: t('inbounds-card.widget.copy-uuid')}
364+
</Button>
365+
)}
366+
</CopyButton>
349367
</Group>
350368
</Paper>
351369
)

0 commit comments

Comments
 (0)