X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fsrc%2FloggingSource.js;h=2810ac8cb9cefdeb8520830fe1c00763c05d227b;hb=df6a222256b914f0ecba9a20d26e5d6b7b2ff964;hp=dc28aa4cc8ee866783d7240ce22882025654dab7;hpb=660c2a10bd46b81968e3ed354ea4b3f218c90b29;p=osm%2FUI.git diff --git a/skyquake/plugins/logging/src/loggingSource.js b/skyquake/plugins/logging/src/loggingSource.js index dc28aa4cc..2810ac8cb 100644 --- a/skyquake/plugins/logging/src/loggingSource.js +++ b/skyquake/plugins/logging/src/loggingSource.js @@ -66,23 +66,41 @@ export default { return new Promise(function(resolve, reject) { let promises = []; let remove = null; - // if(nulledCategories.length > 0) { - // remove = $.ajax({ - // // url: apiUrl('api/config/default-severity'), - // url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')), - // type: 'DELETE', - // beforeSend: Utils.addAuthorizationStub, - // success: function(data) { - // resolve(data); - // }, - // error: function(error) { - // console.log("There was an error updating the logging config data", - // error); - // reject(error); - // } - // }); - // promises.push(remove); - // } + if(loggingConfig.hasOwnProperty('allowDuplicateEvents')) { + promises.push($.ajax({ + url: apiUrl('api/config/allow-duplicate-events'), + type: 'PUT', + beforeSend: Utils.addAuthorizationStub, + data: { + allowDuplicateEvents: loggingConfig.allowDuplicateEvents + }, + success: function(data) { + resolve(data); + }, + error: function(error) { + console.log("There was an error updating the logging config data", + error); + reject(error); + } + })) + } + if(nulledCategories.length > 0) { + remove = $.ajax({ + // url: apiUrl('api/config/default-severity'), + url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')), + type: 'DELETE', + beforeSend: Utils.addAuthorizationStub, + success: function(data) { + resolve(data); + }, + error: function(error) { + console.log("There was an error updating the logging config data", + error); + reject(error); + } + }); + promises.push(remove); + } Promise.all(promises).then(function(data) { return $.ajax({ url: apiUrl('api/aggregate'),