Skip to content

Commit cf56f5e

Browse files
committed
[ADD] tooltip to help out user
1 parent 01611e2 commit cf56f5e

File tree

2 files changed

+41
-13
lines changed

2 files changed

+41
-13
lines changed

source/app/blueprints/alerts/templates/alerts.html

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,50 @@
179179
</select>
180180
</div>
181181
</div>
182-
<div class="form-row mt-3">
183-
<div class="col-md-12">
184-
<button class="btn btn-sm btn-outline-dark" type="button" data-toggle="collapse" data-target="#customConditionsCollapse" aria-expanded="false" aria-controls="customConditionsCollapse">
185-
Custom Conditions
186-
</button>
187-
</div>
182+
<div class="form-row mt-3">
183+
<div class="col-md-12">
184+
<button class="btn btn-sm btn-outline-dark" type="button" data-toggle="collapse" data-target="#customConditionsCollapse" aria-expanded="false" aria-controls="customConditionsCollapse">
185+
Custom Conditions
186+
</button>
187+
<a href="#" class="ml-2" data-toggle="collapse" data-target="#customConditionsExamples" aria-expanded="false" aria-controls="customConditionsExamples">
188+
Show Examples
189+
</a>
188190
</div>
191+
</div>
189192

190-
<div class="collapse mt-3" id="customConditionsCollapse">
191-
<div class="form-row">
192-
<div class="col-md-12 form-group">
193-
<label for="custom_conditions">Custom Conditions</label>
194-
<div class="form-control" id="custom_conditions"></div>
195-
</div>
193+
<div class="collapse mt-3" id="customConditionsCollapse">
194+
<div class="form-row">
195+
<div class="col-md-12 form-group">
196+
<label for="custom_conditions">Custom Conditions</label>
197+
<div class="form-control" id="custom_conditions"></div>
196198
</div>
197199
</div>
200+
</div>
201+
202+
<div class="collapse" id="customConditionsExamples">
203+
<div class="card card-body mt-2">
204+
<p>Here are two sample custom conditions:</p>
205+
<pre><code>
206+
[{
207+
"field": "alert_severity_id",
208+
"operator": "in",
209+
"value": [1, 2]
210+
},
211+
{
212+
"field": "alert_title",
213+
"operator": "like",
214+
"value": "phishing"
215+
}]</code></pre>
216+
<pre><code>
217+
[{
218+
"field": "severity.severity_name",
219+
"operator": "like",
220+
"value": "Critical"
221+
}]
222+
</code></pre>
223+
<p>Copy one of these conditions and paste it into the "Custom Conditions" field above, then adjust the values as needed.</p>
224+
</div>
225+
</div>
198226
<div class="form-row mt-3">
199227
<div class="col centered">
200228
<button type="submit" class="btn btn-sm btn-primary">Apply Filters</button>

source/app/static/assets/js/iris/alerts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ async function updateAlerts(page, per_page, filters = {}, paging=false){
13581358
console.error(error);
13591359
});
13601360

1361-
if (!notify_auto_api(data)) {
1361+
if (!notify_auto_api(data, true)) {
13621362
return;
13631363
}
13641364
const alerts = data.data.alerts;

0 commit comments

Comments
 (0)