(null)
const handleCopy = async (snapshotId: number) => {
try {
@@ -537,18 +561,12 @@ function DevicesList({
}
}
- const handleSelectAll = useCallback((e: React.KeyboardEvent) => {
- if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
- e.preventDefault()
- if (contentRef.current) {
- const range = document.createRange()
- range.selectNodeContents(contentRef.current)
- const sel = window.getSelection()
- sel?.removeAllRanges()
- sel?.addRange(range)
- }
+ const handleViewCopy = async () => {
+ if (viewContent) {
+ await navigator.clipboard.writeText(viewContent)
+ message.success('Скопировано в буфер обмена')
}
- }, [])
+ }
if (isLoading) return Загрузка...
if (!devices || devices.length === 0) return Нет устройств
@@ -637,31 +655,33 @@ function DevicesList({
title={viewTitle}
open={viewContent !== null}
onCancel={() => setViewContent(null)}
- footer={null}
+ footer={
+ } onClick={handleViewCopy}>
+ Скопировать
+
+ }
width={800}
maskClosable
destroyOnClose
>
-
+
+ {viewContent && highlightIni(viewContent)}
+
>
)