Skip to content

Commit b5014d7

Browse files
size header list according to contents and eliminate size jump on hover (#2360)
* size header list according to contents and eliminate size jump on hover * Keeping the copy to clipboard close to the content * Remove bootstrap styles to pre * include row-gap and background to unify appearance with other lists --------- Co-authored-by: John Simons <[email protected]>
1 parent e58bcad commit b5014d7

File tree

1 file changed

+44
-21
lines changed

1 file changed

+44
-21
lines changed

src/Frontend/src/components/messages2/HeadersView.vue

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,27 @@ const filteredHeaders = computed(() => {
3535
</div>
3636
</div>
3737
</div>
38-
<table class="table" v-if="filteredHeaders.length > 0 && !headers.not_found">
39-
<tbody>
40-
<tr class="interactiveList" v-for="(header, index) in filteredHeaders" :key="index">
41-
<td nowrap="nowrap">{{ header.key }}</td>
42-
<td>
43-
<div class="headercopy" @mouseover="toggleHover(index, true)" @mouseleave="toggleHover(index, false)">
44-
<pre>{{ header.value }}</pre>
45-
<CopyToClipboard v-if="hoverStates[index] && header.value" :value="header.value" :isIconOnly="true" />
46-
</div>
47-
</td>
48-
</tr>
49-
</tbody>
50-
</table>
38+
<div class="header-list" v-if="filteredHeaders.length > 0 && !headers.not_found">
39+
<template v-for="(header, index) in filteredHeaders" :key="index">
40+
<div class="header-key">{{ header.key }}</div>
41+
<div class="header-value" @mouseover="toggleHover(index, true)" @mouseleave="toggleHover(index, false)">
42+
<pre class="removeBootStrap">{{ header.value }}</pre>
43+
<div class="clippy-button"><CopyToClipboard v-if="header.value && hoverStates[index]" :value="header.value" :isIconOnly="true" /></div>
44+
</div>
45+
</template>
46+
</div>
5147

5248
<!-- Message if filtered list is empty -->
5349
<div v-if="filteredHeaders.length <= 0 && !headers.not_found" class="alert alert-warning">No headers found matching the search term.</div>
5450
<div v-if="headers.not_found" 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>
5551
</template>
5652

5753
<style scoped>
58-
.headercopy {
59-
display: flex;
60-
gap: 0.4rem;
54+
.removeBootStrap {
55+
background: initial;
56+
border: none;
57+
margin: 0;
58+
padding: 0;
6159
}
6260
6361
/* empty filtered list message */
@@ -78,16 +76,41 @@ const filteredHeaders = computed(() => {
7876
width: 100%;
7977
max-width: 40rem;
8078
}
81-
.format-text {
82-
font-weight: unset;
83-
font-size: 14px;
84-
min-width: 120px;
85-
}
8679
.filters {
8780
background-color: #f3f3f3;
8881
margin-top: 5px;
8982
border: #8c8c8c 1px solid;
9083
border-radius: 3px;
9184
padding: 5px;
9285
}
86+
87+
.header-list {
88+
margin-bottom: 1rem;
89+
margin-top: 0.5rem;
90+
display: grid;
91+
grid-template-columns: 20rem 1fr;
92+
align-items: flex-start;
93+
justify-content: center;
94+
row-gap: 2px;
95+
}
96+
97+
.header-value,
98+
.header-key {
99+
padding: 1rem;
100+
display: flex;
101+
height: 100%;
102+
min-height: 2rem;
103+
position: relative;
104+
background: white;
105+
}
106+
107+
.header-value {
108+
padding-left: 2.7rem;
109+
}
110+
111+
.clippy-button {
112+
position: absolute;
113+
left: 0;
114+
top: 0.3rem;
115+
}
93116
</style>

0 commit comments

Comments
 (0)