|
258 | 258 | <tr-info-title class="tr-info-title">
|
259 | 259 | <a-tag color="purple">Subscription Link</a-tag>
|
260 | 260 | <a-tooltip title='{{ i18n "copy" }}'>
|
261 |
| - <a-button size="small" icon="snippets" id="copy-sub-link" @click="copyToClipboard('copy-sub-link', infoModal.subLink)"></a-button> |
| 261 | + <a-button size="small" icon="snippets" @click="copyToClipboard(infoModal.subLink)"></a-button> |
262 | 262 | </a-tooltip>
|
263 | 263 | </tr-info-title>
|
264 | 264 | <a :href="[[ infoModal.subLink ]]" target="_blank">[[ infoModal.subLink ]]</a>
|
|
267 | 267 | <tr-info-title class="tr-info-title">
|
268 | 268 | <a-tag color="purple">Json Link</a-tag>
|
269 | 269 | <a-tooltip title='{{ i18n "copy" }}'>
|
270 |
| - <a-button size="small" icon="snippets" id="copy-subJson-link" @click="copyToClipboard('copy-subJson-link', infoModal.subJsonLink)"></a-button> |
| 270 | + <a-button size="small" icon="snippets" @click="copyToClipboard(infoModal.subJsonLink)"></a-button> |
271 | 271 | </a-tooltip>
|
272 | 272 | </tr-info-title>
|
273 | 273 | <a :href="[[ infoModal.subJsonLink ]]" target="_blank">[[ infoModal.subJsonLink ]]</a>
|
|
279 | 279 | <tr-info-title class="tr-info-title">
|
280 | 280 | <a-tag color="blue">[[ infoModal.clientSettings.tgId ]]</a-tag>
|
281 | 281 | <a-tooltip title='{{ i18n "copy" }}'>
|
282 |
| - <a-button size="small" icon="snippets" id="copy-tg-link" @click="copyToClipboard('copy-tg-link', infoModal.clientSettings.tgId)"></a-button> |
| 282 | + <a-button size="small" icon="snippets" @click="copyToClipboard(infoModal.clientSettings.tgId)"></a-button> |
283 | 283 | </a-tooltip>
|
284 | 284 | </tr-info-title>
|
285 | 285 | </tr-info-row>
|
|
290 | 290 | <tr-info-title class="tr-info-title">
|
291 | 291 | <a-tag class="tr-info-tag" color="green">[[ link.remark ]]</a-tag>
|
292 | 292 | <a-tooltip title='{{ i18n "copy" }}'>
|
293 |
| - <a-button style="min-width: 24px;" size="small" icon="snippets" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)"></a-button> |
| 293 | + <a-button style="min-width: 24px;" size="small" icon="snippets" @click="copyToClipboard(link.link)"></a-button> |
294 | 294 | </a-tooltip>
|
295 | 295 | </tr-info-title>
|
296 | 296 | <code>[[ link.link ]]</code>
|
|
304 | 304 | <tr-info-title class="tr-info-title">
|
305 | 305 | <a-tag class="tr-info-tag" color="green">[[ link.remark ]]</a-tag>
|
306 | 306 | <a-tooltip title='{{ i18n "copy" }}'>
|
307 |
| - <a-button style="min-width: 24px;" size="small" icon="snippets" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)"></a-button> |
| 307 | + <a-button style="min-width: 24px;" size="small" icon="snippets" @click="copyToClipboard(link.link)"></a-button> |
308 | 308 | </a-tooltip>
|
309 | 309 | </tr-info-title>
|
310 | 310 | <code>[[ link.link ]]</code>
|
|
431 | 431 | <tr-info-title class="tr-info-title">
|
432 | 432 | <a-tag color="blue">Config</a-tag>
|
433 | 433 | <a-tooltip title='{{ i18n "copy" }}'>
|
434 |
| - <a-button style="min-width: 24px;" size="small" icon="snippets" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, infoModal.links[index])"></a-button> |
| 434 | + <a-button style="min-width: 24px;" size="small" icon="snippets" @click="copyToClipboard(infoModal.links[index])"></a-button> |
435 | 435 | </a-tooltip>
|
436 | 436 | </tr-info-title>
|
437 | 437 | <div v-html="infoModal.links[index].replaceAll(`\n`,`<br />`)" style="border-radius: 1rem; padding: 0.5rem;" class="client-table-odd-row">
|
|
464 | 464 | clientStats: [],
|
465 | 465 | upStats: 0,
|
466 | 466 | downStats: 0,
|
467 |
| - clipboard: null, |
468 | 467 | links: [],
|
469 | 468 | index: null,
|
470 | 469 | isExpired: false,
|
|
533 | 532 | },
|
534 | 533 | },
|
535 | 534 | methods: {
|
536 |
| - copyToClipboard(elementId, content) { |
537 |
| - this.infoModal.clipboard = new ClipboardJS('#' + elementId, { |
538 |
| - text: () => content, |
539 |
| - }); |
540 |
| - this.infoModal.clipboard.on('success', () => { |
| 535 | + copyToClipboard(content) { |
| 536 | + return copyToClipboard(content).then(() => { |
541 | 537 | app.$message.success('{{ i18n "copied" }}')
|
542 |
| - this.infoModal.clipboard.destroy(); |
543 |
| - }); |
| 538 | + }) |
544 | 539 | },
|
545 | 540 | statsColor(stats) {
|
546 | 541 | return usageColor(stats.up + stats.down, app.trafficDiff, stats.total);
|
|
0 commit comments