Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVEMENT] Truncate long silence matchers #550

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions promgen/static/css/promgen.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ a[rel]:after {
margin-bottom: 10px;
}

.promgen-label-target > span {
display: inline-block;
vertical-align: middle;
}

.promgen-label-target:hover {
text-decoration: none !important;
color: #000000;
Expand All @@ -77,10 +82,18 @@ a[rel]:after {
.promgen-label-close {
font-size: 20px;
margin-left: 10px;
margin-top: -2px;
color: #aaaaaa;
cursor: pointer;
}

.promgen-silence-matcher-truncate {
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

/* service-detail */
.promgen-flex-space-between-center {
display: flex;
Expand Down
7 changes: 6 additions & 1 deletion promgen/templates/promgen/vue/silence_create_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ <h5>
<ul class="list-inline promgen-labels-list">
<li v-for="(value, label) in state.labels">
<div class="promgen-label-target">
<span>[[label]]=~[[value]]</span>
<span
:title="`${label}:${value}`"
class="promgen-silence-matcher-truncate"
>
[[label]]=~[[value]]
</span>
<span @click="removeLabel(label)" aria-hidden="true" class="promgen-label-close">&times;</span>
</div>
</li>
Expand Down
7 changes: 6 additions & 1 deletion promgen/templates/promgen/vue/silence_list_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ <h4 class="modal-title" id="silenceModalLabel">Silence</h4>
<ul class="list-inline promgen-labels-list">
<li v-for="item in state.labels" :key="`${item.label}-${item.value}`">
<div class="promgen-label-target">
<span>[[item.label]]=~[[item.value]]</span>
<span
:title="`${item.label}:${item.value}`"
class="promgen-silence-matcher-truncate"
>
[[item.label]]=~[[item.value]]
</span>
<span @click="removeFilterLabel(item.label, item.value)" aria-hidden="true" class="promgen-label-close">&times;</span>
</div>
</li>
Expand Down
7 changes: 6 additions & 1 deletion promgen/templates/promgen/vue/silence_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
<td class="col-xs-1">[[ time(silence.endsAt) ]]</td>
<td class="col-xs-3 text-wrap">
<ul class="list-inline">
<li v-for="matcher in silence.matchers">
<li
v-for="matcher in silence.matchers"
:title="`${matcher.name}:${matcher.value}`"
class="promgen-silence-matcher-truncate"
style="color: white"
>
<a
@click="$emit('matcherClick', matcher.name, matcher.value)"
class="label"
Expand Down