Skip to content

Commit bb97828

Browse files
committed
add option to copy the header values to clipboard
1 parent e3bca81 commit bb97828

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/Frontend/src/components/CopyToClipboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ async function copyToClipboard() {
1919

2020
<template>
2121
<Tippy content="Copied" ref="tippyRef" trigger="manual">
22-
<button type="button" class="btn btn-sm" @click="copyToClipboard"><i class="fa fa-copy"></i> Copy to clipboard</button>
22+
<button type="button" title="Copy To Clipboard" class="btn btn-sm" @click="copyToClipboard"><i class="fa fa-copy"></i></button>
2323
</Tippy>
2424
</template>

src/Frontend/src/components/messages/HeadersView.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { ExtendedFailedMessage } from "@/resources/FailedMessage";
3-
3+
import CopyToClipboard from "@/components/CopyToClipboard.vue";
44
const props = defineProps<{
55
message: ExtendedFailedMessage;
66
}>();
@@ -11,8 +11,20 @@ const props = defineProps<{
1111
<tbody>
1212
<tr class="interactiveList" v-for="(header, index) in props.message.headers" :key="index">
1313
<td nowrap="nowrap">{{ header.key }}</td>
14-
<td>
14+
<td class="toolbar">
15+
<!--
1516
<pre>{{ header.value }}</pre>
17+
<span>
18+
<CopyToClipboard :value="header.value || ''" />
19+
20+
</span>
21+
-->
22+
<!-- Use flexbox to align items horizontally -->
23+
<div style="display: flex; align-items: center">
24+
<!-- The pre element should not wrap, so use white-space: nowrap or keep it as a block element -->
25+
<pre style="margin: 0; white-space: nowrap">{{ header.value }}</pre>
26+
<CopyToClipboard :value="header.value || ''" />
27+
</div>
1628
</td>
1729
</tr>
1830
</tbody>

0 commit comments

Comments
 (0)