mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Update Filterer, add properties from server to fill in the Filterer
This commit is contained in:
parent
2e83b42ba9
commit
8aa94cc32d
3 changed files with 14 additions and 17 deletions
File diff suppressed because one or more lines are too long
|
@ -135,7 +135,7 @@
|
||||||
Note: Conditions are checked after the notification trigger and the notification will only be sent if the condition logic is satisfied.
|
Note: Conditions are checked after the notification trigger and the notification will only be sent if the condition logic is satisfied.
|
||||||
</p>
|
</p>
|
||||||
<div id="condition-widget"></div>
|
<div id="condition-widget"></div>
|
||||||
<input type="text" name="custom_conditions" id="custom_conditions" value="${notifier['custom_conditions']}" />
|
<input type="hidden" name="custom_conditions" id="custom_conditions" />
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="custom_condition_logic">Condition Logic</label>
|
<label for="custom_condition_logic">Condition Logic</label>
|
||||||
|
@ -273,15 +273,12 @@
|
||||||
|
|
||||||
$('#notifier-config-modal').unbind('hidden.bs.modal');
|
$('#notifier-config-modal').unbind('hidden.bs.modal');
|
||||||
|
|
||||||
|
// Need this for setting conditions since conditions contain the character "
|
||||||
|
$('#custom_conditions').val('${notifier['custom_conditions'] | n}')
|
||||||
|
|
||||||
$('#condition-widget').filterer({
|
$('#condition-widget').filterer({
|
||||||
coefficients: [
|
parameters: ${parameters | n},
|
||||||
{"name": "Title", "type": "string", "value": "title"},
|
conditions: ${notifier["custom_conditions"] | n},
|
||||||
{"name": "Year", "type": "number", "value": "year"}
|
|
||||||
],
|
|
||||||
conditions: [
|
|
||||||
{coefficient: "year", operator: "is", value: ""},
|
|
||||||
{coefficient: "title", operator: "begins with", value: ""}
|
|
||||||
],
|
|
||||||
updateConditions: function(newConditions){
|
updateConditions: function(newConditions){
|
||||||
$('#custom_conditions').val(JSON.stringify(newConditions));
|
$('#custom_conditions').val(JSON.stringify(newConditions));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2951,7 +2951,7 @@ class WebInterface(object):
|
||||||
result = notifiers.get_notifier_config(notifier_id=notifier_id)
|
result = notifiers.get_notifier_config(notifier_id=notifier_id)
|
||||||
|
|
||||||
if not result['custom_conditions']:
|
if not result['custom_conditions']:
|
||||||
result['custom_conditions'] = json.dumps([{'coefficient': '', 'operator': '', 'value': ''}])
|
result['custom_conditions'] = json.dumps([{'parameter': '', 'operator': '', 'value': ''}])
|
||||||
|
|
||||||
if not result['custom_conditions_logic']:
|
if not result['custom_conditions_logic']:
|
||||||
result['custom_conditions_logic'] = ''
|
result['custom_conditions_logic'] = ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue