mirror of
https://github.com/axllent/mailpit.git
synced 2026-03-03 02:17:01 +00:00
Detect if copy to clipboard is supported
This commit is contained in:
@@ -150,6 +150,7 @@ export default {
|
||||
<p class="m-0 small">
|
||||
<strong>MD5</strong>:
|
||||
<button
|
||||
v-if="copyToClipboardSupported"
|
||||
class="btn btn-sm btn-link p-0"
|
||||
title="Click to copy to clipboard"
|
||||
@click="copyToClipboard(part.Checksums.MD5, $event)"
|
||||
@@ -158,10 +159,12 @@ export default {
|
||||
<i v-if="!copiedText[part.Checksums.MD5]" class="bi bi-clipboard ms-1"></i>
|
||||
<i v-else class="bi bi-check2-square ms-1 text-success"></i>
|
||||
</button>
|
||||
<code v-else>{{ part.Checksums.MD5 }}</code>
|
||||
</p>
|
||||
<p class="m-0 small">
|
||||
<strong>SHA1</strong>:
|
||||
<button
|
||||
v-if="copyToClipboardSupported"
|
||||
class="btn btn-link p-0"
|
||||
title="Click to copy to clipboard"
|
||||
@click="copyToClipboard(part.Checksums.SHA1, $event)"
|
||||
@@ -170,10 +173,12 @@ export default {
|
||||
<i v-if="!copiedText[part.Checksums.SHA1]" class="bi bi-clipboard ms-1"></i>
|
||||
<i v-else class="bi bi-check2-square ms-1 text-success"></i>
|
||||
</button>
|
||||
<code v-else>{{ part.Checksums.SHA1 }}</code>
|
||||
</p>
|
||||
<p class="m-0 small">
|
||||
<strong>SHA256</strong>:
|
||||
<button
|
||||
v-if="copyToClipboardSupported"
|
||||
class="btn btn-sm btn-link p-0"
|
||||
title="Click to copy to clipboard"
|
||||
@click="copyToClipboard(part.Checksums.SHA256, $event)"
|
||||
@@ -182,6 +187,7 @@ export default {
|
||||
<i v-if="!copiedText[part.Checksums.SHA256]" class="bi bi-clipboard ms-1"></i>
|
||||
<i v-else class="bi bi-check2-square ms-1 text-success"></i>
|
||||
</button>
|
||||
<code v-else>{{ part.Checksums.SHA256 }}</code>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,6 +24,12 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
copyToClipboardSupported() {
|
||||
return !!navigator.clipboard;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
resolve(u) {
|
||||
return this.$router.resolve(u).href;
|
||||
|
||||
Reference in New Issue
Block a user