replace notification string ids as numbers (#4615, #4630)

This commit is contained in:
gabryon99 2020-10-27 15:31:56 +01:00
parent 80fc2164bd
commit 7dcaed78c5
5 changed files with 45 additions and 36 deletions

View file

@ -93,7 +93,8 @@ $(document).ready(function () {
const $flowdeviceTable = $(`table#flowdevice-list`).DataTable(dtConfig);
$('[data-notification-id="flow_snmp_ratio"] a.btn').click(function() {
const FLOW_SNMP_RATIO_NOTIFICATION_ID = 13;
$(`[data-notification-id="${FLOW_SNMP_RATIO_NOTIFICATION_ID}"] a.btn`).click(function() {
// Enable SNMP and FlowDevice Timseries
NtopUtils.setPref(
'flowdevice_timeseries',

View file

@ -113,18 +113,14 @@ $(document).ready(function () {
const $sflowdeviceTable = $(`table#sflowdevice-list`).DataTable(dtConfig);
$('[data-notification-id="flow_snmp_ratio"] a.btn').click(function() {
const FLOW_SNMP_RATIO_NOTIFICATION_ID = 13;
$(`[data-notification-id="${FLOW_SNMP_RATIO_NOTIFICATION_ID}"] a.btn`).click(function() {
// Enable SNMP and FlowDevice Timseries
NtopUtils.setPref(
'flowdevice_timeseries',
pageCSRF,
(data) => {
// reload the page after the submission to take effects
if (data.success) location.reload();
},
(jqxhr, settings, ex) => {
console.error(ex);
}
(data) => { if (data.success) location.reload(); },
(jqxhr, settings, ex) => { console.error(ex); }
)
});
});