From 4c88a6c6852ce218d7694b9d31ab07ca8dee1716 Mon Sep 17 00:00:00 2001 From: DearTanker <1122669+DearTanker@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=80=BC=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E7=94=A8=20padding=20=E6=9D=A5=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BA=86=E5=9B=BE=E6=A0=87=E7=9A=84=E9=97=B4=E8=B7=9D=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/view/domain/record.html | 43 ++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/app/view/domain/record.html b/app/view/domain/record.html index 9aa82b3..ee5c5de 100644 --- a/app/view/domain/record.html +++ b/app/view/domain/record.html @@ -276,7 +276,7 @@ $(document).ready(function(){ var domain = value; if(domain === "@") domain = "{$domainName}"; else domain = value + ".{$domainName}"; - return value + ' '; + return value + ''; } }, { @@ -293,13 +293,17 @@ $(document).ready(function(){ title: '线路类型' }, { - field: 'Value', - title: '记录值', - formatter: function(value, row, index) { - if(row.Type == 'MX') return value + ' | '+row.MX; - return value; - } - }, + field: 'Value', + title: '记录值', + formatter: function(value, row, index) { + var display = value; + if(row.Type == 'MX') display = value + ' | ' + row.MX; + var copyId = 'copy-value-' + row.RecordId; + // 只允许安全字符,避免引号问题 + var safeValue = (value+'').replace(/'/g, "'").replace(/\\/g, "\\\\"); + return ''+display+''; + } + }, { field: 'TTL', title: 'TTL' @@ -725,5 +729,28 @@ function advanceSearch(){ $("#searchbox1").slideDown(); } } +function copyToClipboard(text, selector) { + var tempInput = document.createElement('input'); + tempInput.style.position = 'absolute'; + tempInput.style.left = '-9999px'; + tempInput.value = text; + document.body.appendChild(tempInput); + tempInput.select(); + document.execCommand('copy'); + document.body.removeChild(tempInput); + if(selector){ + var icon = document.querySelector(selector + ' + a i'); + if(icon){ + var oldClass = icon.className; + icon.className = 'fa fa-check'; + setTimeout(function(){ icon.className = oldClass; }, 1000); + } + } + if(typeof layer !== 'undefined' && layer.msg){ + layer.msg('已复制到剪贴板'); + }else{ + alert('已复制到剪贴板'); + } +} {/block} \ No newline at end of file