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:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-03-17 19:30:14 +0300
committerGitHub <noreply@github.com>2023-03-17 19:30:14 +0300
commitf25a7a571e6103587558e970673a09375b1ef318 (patch)
tree24e645ff37cec8d8b166bfe59403c4fb19a1da2c /web/html/common/qrcode_modal.html
parentb9ffe62d698016b52a5a36ede0eb2bdf86085d8a (diff)
parent87e173b56767a861210dc0cc4913bab232765dfd (diff)
Merge pull request #26 from MHSanaei/dev
alireza
Diffstat (limited to 'web/html/common/qrcode_modal.html')
-rw-r--r--web/html/common/qrcode_modal.html21
1 files changed, 18 insertions, 3 deletions
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html
index e6a6d476..6c9afbb3 100644
--- a/web/html/common/qrcode_modal.html
+++ b/web/html/common/qrcode_modal.html
@@ -1,9 +1,10 @@
{{define "qrcodeModal"}}
<a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title"
:closable="true" width="300px" :ok-text="qrModal.okText"
- :class="siderDrawer.isDarkTheme ? darkClass : ''"
+ :class="siderDrawer.isDarkTheme ? darkClass : ''"
cancel-text='{{ i18n "close" }}' :ok-button-props="{attrs:{id:'qr-modal-ok-btn'}}">
- <canvas id="qrCode" style="width: 100%; height: 100%;"></canvas>
+ <a-tag color="green" style="margin-bottom: 10px;display: block;text-align: center;" >{{ i18n "pages.inbounds.clickOnQRcode" }}</a-tag>
+ <canvas @click="copyToClipboard()" id="qrCode" style="width: 100%; height: 100%;"></canvas>
</a-modal>
<script>
@@ -35,7 +36,10 @@
this.clipboard = new ClipboardJS('#qr-modal-ok-btn', {
text: () => this.copyText,
});
- this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}'));
+ this.clipboard.on('success', () => {
+ app.$message.success('{{ i18n "copied" }}')
+ this.clipboard.destroy();
+ });
}
if (this.qrcode === null) {
this.qrcode = new QRious({
@@ -58,6 +62,17 @@
data: {
qrModal: qrModal,
},
+ methods: {
+ copyToClipboard() {
+ this.qrModal.clipboard = new ClipboardJS('#qrCode', {
+ text: () => this.qrModal.copyText,
+ });
+ this.qrModal.clipboard.on('success', () => {
+ app.$message.success('{{ i18n "copied" }}')
+ this.qrModal.clipboard.destroy();
+ });
+ }
+ },
});
</script>