Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanaei <ho3ein.sanaei@gmail.com>2025-03-07 14:40:35 +0300
committerGitHub <noreply@github.com>2025-03-07 14:40:35 +0300
commit42fa64770bab9f9fb52e0cdb6d5dd82d66f19c35 (patch)
tree17d8a98faecccbda02b98ede48adf020d5e8d2f9 /web/html/common
parent2d8cca3a2ec1ae9034b7bc28a2fb5f2260f43e1a (diff)
parent0a207b8a2c0629b7f1996025a40a10fbe58d05d0 (diff)
Merge pull request #2732 from shishkevichd/refactor/refactor-1
Code refactoring
Diffstat (limited to 'web/html/common')
-rw-r--r--web/html/common/js.html3
-rw-r--r--web/html/common/qrcode_modal.html16
-rw-r--r--web/html/common/text_modal.html10
3 files changed, 16 insertions, 13 deletions
diff --git a/web/html/common/js.html b/web/html/common/js.html
index 301b1df7..2d93935f 100644
--- a/web/html/common/js.html
+++ b/web/html/common/js.html
@@ -5,9 +5,8 @@
<script src="{{ .base_path }}assets/axios/axios.min.js?{{ .cur_ver }}"></script>
<script src="{{ .base_path }}assets/qs/qs.min.js"></script>
<script src="{{ .base_path }}assets/js/axios-init.js?{{ .cur_ver }}"></script>
-<script src="{{ .base_path }}assets/js/util/common.js?{{ .cur_ver }}"></script>
<script src="{{ .base_path }}assets/js/util/date-util.js?{{ .cur_ver }}"></script>
-<script src="{{ .base_path }}assets/js/util/utils.js?{{ .cur_ver }}"></script>
+<script src="{{ .base_path }}assets/js/util/index.js?{{ .cur_ver }}"></script>
<script src="{{ .base_path }}assets/js/langs.js"></script>
<script>
const basePath = '{{ .base_path }}';
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html
index 117dd640..914290f6 100644
--- a/web/html/common/qrcode_modal.html
+++ b/web/html/common/qrcode_modal.html
@@ -10,7 +10,7 @@
<a-tag color="purple" class="qr-tag"><span>{{ i18n "pages.settings.subSettings"}}</span></a-tag>
<tr-qr-bg class="qr-bg-sub">
<tr-qr-bg-inner class="qr-bg-sub-inner">
- <canvas @click="copyToClipboard(genSubLink(qrModal.client.subId))" id="qrCode-sub" class="qr-cv"></canvas>
+ <canvas @click="qrModal.copy(genSubLink(qrModal.client.subId))" id="qrCode-sub" class="qr-cv"></canvas>
</tr-qr-bg-inner>
</tr-qr-bg>
</tr-qr-box>
@@ -18,7 +18,7 @@
<a-tag color="purple" class="qr-tag"><span>{{ i18n "pages.settings.subSettings"}} Json</span></a-tag>
<tr-qr-bg class="qr-bg-sub">
<tr-qr-bg-inner class="qr-bg-sub-inner">
- <canvas @click="copyToClipboard(genSubJsonLink(qrModal.client.subId))" id="qrCode-subJson" class="qr-cv"></canvas>
+ <canvas @click="qrModal.copy(genSubJsonLink(qrModal.client.subId))" id="qrCode-subJson" class="qr-cv"></canvas>
</tr-qr-bg-inner>
</tr-qr-bg>
</tr-qr-box>
@@ -27,7 +27,7 @@
<tr-qr-box class="qr-box">
<a-tag color="green" class="qr-tag"><span>[[ row.remark ]]</span></a-tag>
<tr-qr-bg class="qr-bg">
- <canvas @click="copyToClipboard(row.link)" :id="'qrCode-'+index" class="qr-cv"></canvas>
+ <canvas @click="qrModal.copy(row.link)" :id="'qrCode-'+index" class="qr-cv"></canvas>
</tr-qr-bg>
</tr-qr-box>
</template>
@@ -78,10 +78,12 @@
qrModal: qrModal,
},
methods: {
- copyToClipboard(content) {
- return copyToClipboard(content).then(() => {
- app.$message.success('{{ i18n "copied" }}')
- })
+ copy(content) {
+ ClipboardManager
+ .copyText(content)
+ .then(() => {
+ app.$message.success('{{ i18n "copied" }}')
+ })
},
setQrCode(elementId, content) {
new QRious({
diff --git a/web/html/common/text_modal.html b/web/html/common/text_modal.html
index 36589199..c15282b9 100644
--- a/web/html/common/text_modal.html
+++ b/web/html/common/text_modal.html
@@ -28,10 +28,12 @@
this.visible = true;
},
copy: function (content = '') {
- copyToClipboard(content).then(() => {
- app.$message.success('{{ i18n "copied" }}')
- this.close();
- })
+ ClipboardManager
+ .copyText(content)
+ .then(() => {
+ app.$message.success('{{ i18n "copied" }}')
+ this.close();
+ })
},
close: function () {
this.visible = false;