Skip to content

Commit fe80a8a

Browse files
committed
fix(Dashboard): Added views to manage correlations
1 parent 834f18a commit fe80a8a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/dashboard/Synapse.Dashboard/Features/Shared/KeyValuePairEditor/KeyValuePairEditor.razor

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
@namespace Synapse.Dashboard
22

3-
<div>
4-
@if (Kvp == null)
5-
{
6-
<input class="form-control" placeholder="Key" type="text" value="@key" @onchange="e => OnPropertyChanged((editor) => editor.key = (string?)e.Value ?? string.Empty)" />
7-
}
8-
<input class="form-control" placeholder="Value" type="text" value="@value" @onchange="e => OnPropertyChanged((editor) => editor.value = (string?)e.Value ?? string.Empty)" />
9-
@if (Kvp == null)
10-
{
11-
<button class="btn btn-outline-dark" type="button" @onclick="OnAddClicked">Add</button>
12-
}
13-
</div>
3+
<tr>
4+
<td>
5+
<input type="text" value="@key" placeholder="Key" class="form-control" @onchange="e => OnPropertyChanged((editor) => editor.key = (string?)e.Value ?? string.Empty)" />
6+
</td>
7+
<td>
8+
<input class="form-control" placeholder="Value" type="text" value="@value" @onchange="e => OnPropertyChanged((editor) => editor.value = (string?)e.Value ?? string.Empty)" />
9+
</td>
10+
<td>
11+
<button class="btn btn-outline-dark" type="button" @onclick="OnAddClicked"><small class="bi bi-plus-circle"></small></button>
12+
</td>
13+
</tr>
1414

1515
@code {
1616
private string key = "";

src/dashboard/Synapse.Dashboard/Pages/Correlations/Create/View.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ else
138138
</Header>
139139
<Body>
140140
<h5>Context Attributes</h5>
141-
<KeyValuePairEditor OnAdd="((e) => OnAddOrUpdateConditionFilterAttribute(condition, filter, e.Key, e.Value))" />
142141
<table class="table table-striped">
143142
<thead>
144143
<tr>
@@ -157,15 +156,15 @@ else
157156
<td>
158157
<input type="text" value="@attr.Value" @onchange="e => OnAddOrUpdateConditionFilterAttribute(condition, filter, attr.Key, (string)e.Value!)" placeholder="Value" title="The value of the context attribute to filter events by. Supports regular expressions" class="form-control" />
159158
</td>
160-
<td><button @onclick="e => OnRemoveAttributeFromConditionFilter(condition, filter, attr.Key)" class="btn btn-danger"><span class="bi bi-trash-fill"></span></button></td>
159+
<td><button @onclick="e => OnRemoveAttributeFromConditionFilter(condition, filter, attr.Key)" class="btn btn-danger"><small class="bi bi-trash-fill"></small></button></td>
161160
</tr>
162161
}
163162
}
163+
<KeyValuePairEditor OnAdd="((e) => OnAddOrUpdateConditionFilterAttribute(condition, filter, e.Key, e.Value))" />
164164
</tbody>
165165
</table>
166166

167167
<h5>Correlation Mappings</h5>
168-
<KeyValuePairEditor OnAdd="((e) => OnAddOrUpdateConditionFilterCorrelationMapping(condition, filter, e.Key, e.Value))" />
169168
<table class="table table-striped">
170169
<thead>
171170
<tr>
@@ -184,16 +183,17 @@ else
184183
<td>
185184
<input type="text" value="@mapping.Value" @onchange="e => OnAddOrUpdateConditionFilterCorrelationMapping(condition, filter, mapping.Key, (string)e.Value!)" placeholder="Value" title="The value of the context attribute used to correlate filtered cloud events. Supports regular expressions" class="form-control" />
186185
</td>
187-
<td><button @onclick="e => OnRemoveCorrelationMappingFromConditionFilter(condition, filter, mapping.Key)" class="btn btn-danger"><span class="bi bi-trash-fill"></span></button></td>
186+
<td><button @onclick="e => OnRemoveCorrelationMappingFromConditionFilter(condition, filter, mapping.Key)" class="btn btn-danger"><small class="bi bi-trash-fill"></small></button></td>
188187
</tr>
189188
}
190189
}
190+
<KeyValuePairEditor OnAdd="((e) => OnAddOrUpdateConditionFilterCorrelationMapping(condition, filter, e.Key, e.Value))" />
191191
</tbody>
192192
</table>
193193
</Body>
194194
</Expander>
195195
}
196-
<button @onclick="e => OnAddFilterToCondition(condition)" class="btn btn-primary w-100"><span class="bi bi-cloud-arrow-up"></span><span>Add new filter</span></button>
196+
<button @onclick="e => OnAddFilterToCondition(condition)" class="btn btn-primary w-100"><small class="bi bi-cloud-arrow-up"></small><span>Add new filter</span></button>
197197
</div>
198198
</Body>
199199
</Expander>

0 commit comments

Comments
 (0)