Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KarboniteKream committed Jan 12, 2022
1 parent c52d4c1 commit 089f7db
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
10 changes: 4 additions & 6 deletions promgen/static/js/promgen.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ const app = new Vue({
.then(() => location.reload());
},
setSilenceLabels(labels) {
if (labels.target) {
silenceStore.setLabels(labels.target.dataset);
} else {
silenceStore.setLabels(labels);
}

silenceStore.setLabels(labels);
silenceStore.showForm();
scroll(0, 0);
},
setSilenceDataset(event) {
this.setSilenceLabels(event.target.dataset);
},
addSilenceLabel(label, value) {
silenceStore.addLabel(label, value);
silenceStore.showForm();
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/host_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>Host: {{ slug }}</h1>
<div class="panel panel-primary">
<div class="panel-body">
<a
@click="setSilenceLabels"
@click="setSilenceDataset"
class="btn btn-warning"
data-instance="{{slug}}:[0-9]*"
style="display: inline-block;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>

<a href="{% url 'project-update' project.id %}" class="btn btn-warning btn-sm">{% trans "Update Project" %}</a>
<a @click="setSilenceLabels" class="btn btn-warning btn-sm" data-project="{{project.name}}" data-service="{{project.service.name}}">{% trans "Silence" %}</a>
<a @click="setSilenceDataset" class="btn btn-warning btn-sm" data-project="{{project.name}}" data-service="{{project.service.name}}">{% trans "Silence" %}</a>

<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/project_detail_exporters.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</td>
<td>
<a
@click="setSilenceLabels"
@click="setSilenceDataset"
class="btn btn-warning btn-xs"
data-job="{{exporter.job}}"
data-project="{{project.name}}"
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/project_detail_hosts.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<td><a href="{% url 'host-detail' host.name %}">{{ host.name }}</a></td>
<td>
<a
@click="setSilenceLabels"
@click="setSilenceDataset"
class="btn btn-warning btn-xs"
data-instance="{{host.name}}:[0-9]*"
data-project="{{project.name}}"
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/project_detail_urls.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<td>{{ url.url }}</td>
<td title="{{ url.probe.description }}">{{ url.probe.module }}</td>
<td>
<a @click="setSilenceLabels"
<a @click="setSilenceDataset"
class="btn btn-warning btn-xs"
data-job="{{url.probe.module}}"
data-instance="{{url.url}}">{% trans "Silence" %}</a>
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/project_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
</td>

<td>
<a @click="setSilenceLabels" class="btn btn-warning btn-xs" data-project="{{project.name}}" data-service="{{service.name}}">{% trans "Silence" %}</a>
<a @click="setSilenceDataset" class="btn btn-warning btn-xs" data-project="{{project.name}}" data-service="{{service.name}}">{% trans "Silence" %}</a>
</td>
</tr>
4 changes: 2 additions & 2 deletions promgen/templates/promgen/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1>Hosts</h1>
<li>
<a href="{% url 'host-detail' host.name %}">{{ host.name }}</a>
<a
@click="setSilenceLabels"
@click="setSilenceDataset"
class="btn btn-warning btn-xs"
data-instance="{{host.name}}:[0-9]*"
style="display: inline-block;"
Expand All @@ -107,7 +107,7 @@ <h1>Hosts</h1>
<tr>
<td><a href="{% url 'host-detail' host.name %}">{{ host.name }}</a></td>
<td><a
@click="setSilenceLabels"
@click="setSilenceDataset"
class="btn btn-warning btn-xs"
data-instance="{{host.name}}:[0-9]*"
style="display: inline-block;"
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/service_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>

<a href="{% url 'service-update' service.id %}" class="btn btn-warning btn-sm">{% trans "Edit Service" %}</a>
<a @click="setSilenceLabels" data-service="{{service.name}}" class="btn btn-warning btn-sm">{% trans "Silence" %}</a>
<a @click="setSilenceDataset" data-service="{{service.name}}" class="btn btn-warning btn-sm">{% trans "Silence" %}</a>

<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down

0 comments on commit 089f7db

Please sign in to comment.