91
91
</div >
92
92
93
93
<h4 class =" my-2" >Conditions </h4 >
94
- @for ( int conditionIndex = 0 ; conditionIndex < command .Conditions .Count ; conditionIndex ++ )
94
+ @for ( int i = 0 ; i < command .Conditions .Count ; i ++ )
95
95
{
96
+ var conditionIndex = i ;
96
97
var condition = command .Conditions .ElementAt (conditionIndex );
97
98
<Expander Class =" border border-dark rounded-2 p-3 my-3" >
98
99
<Header >
99
100
<div class =" row" >
100
101
<div class =" col-10" >
101
- Condition @conditionIndex
102
+ Condition @( conditionIndex + 1 )
102
103
</div >
103
104
<div class =" col-2" >
104
105
<button @onclick =" e => OnRemoveCondition(condition)" title =" Remove condition" class =" btn btn-danger d-flex ms-auto" ><span class =" bi bi-trash-fill" ></span ></button >
@@ -108,14 +109,15 @@ else
108
109
<Body >
109
110
<div class =" border border-dark rounded-2 p-3" >
110
111
<h5 >Filters </h5 >
111
- @for ( int filterIndex = 0 ; filterIndex < condition .Filters .Count ; filterIndex ++ )
112
+ @for ( int j = 0 ; j < condition .Filters .Count ; j ++ )
112
113
{
114
+ var filterIndex = j ;
113
115
var filter = condition .Filters .ElementAt (filterIndex );
114
116
<Expander Class =" border border-secondary rounded-2 p-3 mb-3" IsExpanded =" true" >
115
117
<Header >
116
118
<div class =" row" >
117
119
<div class =" col-10" >
118
- Filter @filterIndex
120
+ Filter @( filterIndex + 1 )
119
121
</div >
120
122
<div class =" col-2" >
121
123
<button @onclick =" e => OnRemoveFilterFromCondition(condition, filter)" title =" Remove filter" class =" btn btn-danger d-flex ms-auto" ><span class =" bi bi-trash-fill" ></span ></button >
124
126
</Header >
125
127
<Body >
126
128
<h5 >Attributes </h5 >
129
+ <KeyValuePairEditor OnAdd =" ((e) => OnAddOrUpdateConditionFilterAttribute(condition, filter, e.Key, e.Value))" />
127
130
<table class =" table table-striped" >
128
131
<thead >
129
132
<tr >
@@ -133,14 +136,14 @@ else
133
136
</thead >
134
137
<tbody >
135
138
@if (filter .Attributes != null
136
- && filter .Attributes .Any ())
139
+ && filter .Attributes .Any ())
137
140
{
138
141
foreach (var attr in filter .Attributes )
139
142
{
140
143
<tr >
141
144
<td >@attr.Key </td >
142
145
<td >
143
- <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 " />
146
+ <KeyValuePairEditor Kvp = " attr" OnChange = " ((e) => OnAddOrUpdateConditionFilterAttribute(condition, filter, attr.Key, e.Value)) " />
144
147
</td >
145
148
<td ><button @onclick =" e => OnRemoveAttributeFromConditionFilter(condition, filter, attr.Key)" class =" btn btn-danger" ><span class =" bi bi-trash-fill" ></span ></button ></td >
146
149
</tr >
150
153
</table >
151
154
152
155
<h5 >Correlation Mappings </h5 >
156
+ <KeyValuePairEditor OnAdd =" ((e) => OnAddOrUpdateConditionFilterCorrelationMapping(condition, filter, e.Key, e.Value))" />
153
157
<table class =" table table-striped" >
154
158
<thead >
155
159
<tr >
166
170
<tr >
167
171
<td >@mapping.Key </td >
168
172
<td >
169
- <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 " />
173
+ <KeyValuePairEditor Kvp = " mapping" OnChange = " ((e) => OnAddOrUpdateConditionFilterCorrelationMapping(condition, filter, mapping.Key, e.Value)) " />
170
174
</td >
171
175
<td ><button @onclick =" e => OnRemoveCorrelationMappingFromConditionFilter(condition, filter, mapping.Key)" class =" btn btn-danger" ><span class =" bi bi-trash-fill" ></span ></button ></td >
172
176
</tr >
0 commit comments