File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
src/Frontend/src/components Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 22import { Tippy , TippyComponent } from " vue-tippy" ;
33import { useTemplateRef } from " vue" ;
44
5- const props = defineProps <{
6- value: string ;
7- }>();
5+ const props = withDefaults (
6+ defineProps <{
7+ value: string ;
8+ isIconOnly? : boolean ;
9+ }>(),
10+ { isIconOnly: false }
11+ );
812
913const tippyRef = useTemplateRef <TippyComponent | null >(" tippyRef" );
1014let timeoutId: number ;
@@ -19,6 +23,7 @@ async function copyToClipboard() {
1923
2024<template >
2125 <Tippy content =" Copied" ref =" tippyRef" trigger =" manual" >
22- <button type =" button" class =" btn btn-secondary btn-sm" @click =" copyToClipboard" ><i class =" fa fa-copy" ></i > Copy to clipboard</button >
26+ <button v-if =" !props.isIconOnly" type =" button" class =" btn btn-secondary btn-sm" @click =" copyToClipboard" ><i class =" fa fa-copy" ></i > Copy to clipboard</button >
27+ <button v-else type =" button" class =" btn btn-secondary btn-sm" @click =" copyToClipboard" v-tippy =" 'Copy to clipboard'" ><i class =" fa fa-copy" ></i ></button >
2328 </Tippy >
2429</template >
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { ExtendedFailedMessage } from " @/resources/FailedMessage" ;
3-
3+ import CopyToClipboard from " @/components/CopyToClipboard.vue" ;
4+ import { ref } from " vue" ;
45const props = defineProps <{
56 message: ExtendedFailedMessage ;
67}>();
8+
9+ const hoverStates = ref <Record <number , boolean >>({});
10+
11+ const toggleHover = (index : number , state : boolean ) => {
12+ hoverStates .value [index ] = state ;
13+ };
714 </script >
815
916<template >
@@ -12,12 +19,21 @@ const props = defineProps<{
1219 <tr class =" interactiveList" v-for =" (header, index) in props.message.headers" :key =" index" >
1320 <td nowrap =" nowrap" >{{ header.key }}</td >
1421 <td >
15- <pre >{{ header.value }}</pre >
22+ <div class =" headercopy" @mouseover =" toggleHover(index, true)" @mouseleave =" toggleHover(index, false)" >
23+ <pre >{{ header.value }}</pre >
24+ <CopyToClipboard v-if =" hoverStates[index]" :value =" header.value || ''" :isIconOnly =" true" />
25+ </div >
1626 </td >
1727 </tr >
1828 </tbody >
1929 </table >
2030 <div v-if =" props.message.headersNotFound" class =" alert alert-info" >Could not find message headers. This could be because the message URL is invalid or the corresponding message was processed and is no longer tracked by ServiceControl.</div >
2131</template >
2232
23- <style scoped></style >
33+ <style scoped>
34+ .headercopy {
35+ display : flex ;
36+ align-items : top ;
37+ gap : 0.4rem ;
38+ }
39+ </style >
You can’t perform that action at this time.
0 commit comments