From 2d8cca3a2ec1ae9034b7bc28a2fb5f2260f43e1a Mon Sep 17 00:00:00 2001 From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com> Date: Fri, 7 Mar 2025 02:43:46 +0700 Subject: refactor: delete `clipboardjs` (#2727) text copying can be done without using additional libraries --- web/html/xui/inbound_info_modal.html | 23 +++++++++-------------- web/html/xui/inbounds.html | 1 - web/html/xui/index.html | 1 - 3 files changed, 9 insertions(+), 16 deletions(-) (limited to 'web/html/xui') diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index d9913f32..f95461e2 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -258,7 +258,7 @@ Subscription Link - + [[ infoModal.subLink ]] @@ -267,7 +267,7 @@ Json Link - + [[ infoModal.subJsonLink ]] @@ -279,7 +279,7 @@ [[ infoModal.clientSettings.tgId ]] - + @@ -290,7 +290,7 @@ [[ link.remark ]] - + [[ link.link ]] @@ -304,7 +304,7 @@ [[ link.remark ]] - + [[ link.link ]] @@ -431,7 +431,7 @@ Config - +
@@ -464,7 +464,6 @@ clientStats: [], upStats: 0, downStats: 0, - clipboard: null, links: [], index: null, isExpired: false, @@ -533,14 +532,10 @@ }, }, methods: { - copyToClipboard(elementId, content) { - this.infoModal.clipboard = new ClipboardJS('#' + elementId, { - text: () => content, - }); - this.infoModal.clipboard.on('success', () => { + copyToClipboard(content) { + return copyToClipboard(content).then(() => { app.$message.success('{{ i18n "copied" }}') - this.infoModal.clipboard.destroy(); - }); + }) }, statsColor(stats) { return usageColor(stats.up + stats.down, app.trafficDiff, stats.total); diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 89a37a29..86890926 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -546,7 +546,6 @@ {{template "js" .}} - diff --git a/web/html/xui/index.html b/web/html/xui/index.html index 2e57277a..8f89da90 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -332,7 +332,6 @@ {{template "js" .}} - {{template "component/themeSwitcher" .}} {{template "textModal"}}