mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-13 00:32:58 -07:00
Automatically show config modal when adding a new notifier
This commit is contained in:
parent
a361296930
commit
50941055fb
3 changed files with 20 additions and 15 deletions
|
@ -31,15 +31,7 @@ DOCUMENTATION :: END
|
||||||
// Load notification agent config modal
|
// Load notification agent config modal
|
||||||
$(".toggle-notifier-config-modal").click(function () {
|
$(".toggle-notifier-config-modal").click(function () {
|
||||||
var notifier_id = $(this).data('id');
|
var notifier_id = $(this).data('id');
|
||||||
$.ajax({
|
loadNotifierConfig(notifier_id);
|
||||||
url: 'get_notifier_config_modal',
|
|
||||||
data: { notifier_id: notifier_id },
|
|
||||||
cache: false,
|
|
||||||
async: true,
|
|
||||||
complete: function (xhr, status) {
|
|
||||||
$("#notifier-config-modal").html(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.trigger-tooltip').tooltip();
|
$('.trigger-tooltip').tooltip();
|
||||||
|
|
|
@ -1897,6 +1897,18 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadNotifierConfig(notifier_id) {
|
||||||
|
$.ajax({
|
||||||
|
url: 'get_notifier_config_modal',
|
||||||
|
data: { notifier_id: notifier_id },
|
||||||
|
cache: false,
|
||||||
|
async: true,
|
||||||
|
complete: function (xhr, status) {
|
||||||
|
$("#notifier-config-modal").html(xhr.responseText).modal('show');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// Javascript to enable link to tab
|
// Javascript to enable link to tab
|
||||||
|
@ -2401,12 +2413,13 @@ $(document).ready(function() {
|
||||||
complete: function (xhr, status) {
|
complete: function (xhr, status) {
|
||||||
result = $.parseJSON(xhr.responseText);
|
result = $.parseJSON(xhr.responseText);
|
||||||
msg = result.message;
|
msg = result.message;
|
||||||
if (result.result == 'success') {
|
|
||||||
showMsg('<i class="fa fa-check"></i> ' + msg, false, true, 5000)
|
|
||||||
} else {
|
|
||||||
showMsg('<i class="fa fa-times"></i> ' + msg, false, true, 5000, true)
|
|
||||||
}
|
|
||||||
$('#add-notifier-modal').modal('hide');
|
$('#add-notifier-modal').modal('hide');
|
||||||
|
if (result.result == 'success') {
|
||||||
|
showMsg('<i class="fa fa-check"></i> ' + msg, false, true, 5000);
|
||||||
|
loadNotifierConfig(result.notifier_id);
|
||||||
|
} else {
|
||||||
|
showMsg('<i class="fa fa-times"></i> ' + msg, false, true, 5000, true);
|
||||||
|
}
|
||||||
getNotifiersTable();
|
getNotifiersTable();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2943,7 +2943,7 @@ class WebInterface(object):
|
||||||
result = notifiers.add_notifier_config(agent_id=agent_id, **kwargs)
|
result = notifiers.add_notifier_config(agent_id=agent_id, **kwargs)
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
return {'result': 'success', 'message': 'Added notification agent.'}
|
return {'result': 'success', 'message': 'Added notification agent.', 'notifier_id': result}
|
||||||
else:
|
else:
|
||||||
return {'result': 'error', 'message': 'Failed to add notification agent.'}
|
return {'result': 'error', 'message': 'Failed to add notification agent.'}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue