-
Notifications
You must be signed in to change notification settings - Fork 151
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
Implement "Silence List" Feature as a Modal #539
Merged
vincent-olivert-riera
merged 2 commits into
line:master
from
bai1024:implement-silence-list-modal
Sep 10, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../templates/promgen/vue/silence_modal.html → ...tes/promgen/vue/silence_create_modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% load i18n %} | ||
{% load promgen %} | ||
<div id="silenceListModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="silenceModalLabel"> | ||
<div class="modal-dialog modal-lg" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" @click="state.show = false" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
<h4 class="modal-title" id="silenceModalLabel">Silence</h4> | ||
</div> | ||
<div class="modal-body" style="padding:10px 30px;"> | ||
|
||
<div class="row mb-4"> | ||
<div class="col-md-12"> | ||
<div style="display: flex;align-items: center;"> | ||
<select v-model="form.label" class="form-control" @change="updateValueOptions"> | ||
<option value="">Select a label</option> | ||
<option v-for="label in uniqueLabels" :value="label">[[label]]</option> | ||
</select> | ||
<input type="text" placeholder="=~" style="max-width: 50px; text-align: center;" class="form-control ml-2 mr-2" disabled> | ||
<select v-model="form.value" class="form-control" :disabled="!form.label"> | ||
<option value="">Select a value</option> | ||
<option v-for="value in filteredValues" :value="value">[[value]]</option> | ||
</select> | ||
<button type="button" class="btn btn-primary ml-2" @click="addFilterLabel" :disabled="!form.label || !form.value">+</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row mb-4"> | ||
<div class="col-md-12"> | ||
<div class="labels"> | ||
<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 @click="removeFilterLabel(item.label, item.value)" aria-hidden="true" class="promgen-label-close">×</span> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<table class="table table-bordered table-condensed table-responsive"> | ||
<thead> | ||
<tr> | ||
<th>Starts</th> | ||
<th>Ends</th> | ||
<th>Matchers</th> | ||
<th>Comment</th> | ||
<th>Created by</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<template v-for="silence in filteredSilences" :key="silence.id"> | ||
<silence-row :silence="silence" label-color="info" @matcher-click="addFilterLabel" /> | ||
</template> | ||
</tbody> | ||
|
||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we can get a list from activeSilences() it seems like we could do a quick filter on that, to provide a list of suggestions for the matcher label field, and then do something similar for the matcher value based on which label is selected 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see. I will look into it.