diff options
| author | Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-12 20:26:13 +0300 |
|---|---|---|
| committer | Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-12 21:15:28 +0300 |
| commit | 814337964591ac1971ab90662282964984232e24 (patch) | |
| tree | 2dfcda34fc58f7bb15712865ac43a254862bc7a6 /web/html/xui/inbound_info_modal.html | |
| parent | 5bd6baa0554f6763e6bc81b322b264d45859b74e (diff) | |
Add copy button for sub link
Diffstat (limited to 'web/html/xui/inbound_info_modal.html')
| -rw-r--r-- | web/html/xui/inbound_info_modal.html | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index cfaddf3b..d9d0637c 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -114,6 +114,7 @@ <tr v-if="infoModal.clientSettings.subId"> <td>Subscription link</td> <td><a :href="[[ subBase + infoModal.clientSettings.subId ]]" target="_blank">[[ subBase + infoModal.clientSettings.subId ]]</a></td> + <td><a-icon id="copy-sub-link" type="snippets" @click="copyToClipboard('copy-sub-link', subBase + infoModal.clientSettings.subId)"></a-icon></td> </tr> <tr v-if="infoModal.clientSettings.tgId"> <td>Telegram ID</td> @@ -190,7 +191,7 @@ <div v-if="dbInbound.hasLink()"> <a-divider>URL</a-divider> <p>[[ infoModal.link ]]</p> - <button class="ant-btn ant-btn-primary" id="copy-url-link"><a-icon type="snippets"></a-icon>{{ i18n "copy" }}</button> + <button class="ant-btn ant-btn-primary" id="copy-url-link" @click="copyToClipboard('copy-url-link', infoModal.link)"><a-icon type="snippets"></a-icon>{{ i18n "copy" }}</button> </div> </a-modal> <script> @@ -218,14 +219,6 @@ this.isExpired = this.inbound.isExpiry(index); this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; this.visible = true; - infoModalApp.$nextTick(() => { - if (this.clipboard === null) { - this.clipboard = new ClipboardJS('#copy-url-link', { - text: () => this.link, - }); - this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}')); - } - }); }, close() { infoModal.visible = false; @@ -263,7 +256,7 @@ }, }, methods: { - copyTextToClipboard(elmentId, content) { + copyToClipboard(elmentId, content) { this.infoModal.clipboard = new ClipboardJS('#' + elmentId, { text: () => content, }); |
