From 3a71d07f7804b01a731fa09e6277e3c621738e7e Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 24 Oct 2018 11:38:21 +0200 Subject: [PATCH 1/2] [Chrome extension] Added support to ssl, fixed exportation and added minor and major severity --- extras/chrome_extension/css/popup.css | 7 +++++ extras/chrome_extension/js/background.js | 30 +++++++++++----------- extras/chrome_extension/js/notification.js | 5 +--- extras/chrome_extension/manifest.json | 1 + 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/extras/chrome_extension/css/popup.css b/extras/chrome_extension/css/popup.css index a736abea57..e505e720cc 100644 --- a/extras/chrome_extension/css/popup.css +++ b/extras/chrome_extension/css/popup.css @@ -247,4 +247,11 @@ button h3 { } .sev-Maintenance { background: #A8A8A8; +} +.sev-Minor { + background: #F099A2; + color: #333; +} +.sev-Major { + background: #C97A4A; } \ No newline at end of file diff --git a/extras/chrome_extension/js/background.js b/extras/chrome_extension/js/background.js index 8f3b80e866..5c390f5880 100644 --- a/extras/chrome_extension/js/background.js +++ b/extras/chrome_extension/js/background.js @@ -29,11 +29,13 @@ function main() { if (isFetching) return; isFetching = true; - var feedUrl = localStorage["ip_address"]+'/include/api.php?op=get&op2=events&return_type=csv&apipass='+localStorage["api_pass"]+'&user='+localStorage["user_name"]+'&pass='+localStorage["pass"]; + var feedUrl = localStorage["ip_address"]+'/include/api.php?op=get&op2=events&return_type=json&apipass='+localStorage["api_pass"]+'&user='+localStorage["user_name"]+'&pass='+localStorage["pass"]; + req = new XMLHttpRequest(); req.onload = handleResponse; req.onerror = handleError; req.open("GET", feedUrl, true); + req.withCredentials = true req.send(null); } @@ -132,25 +134,23 @@ function fetchNewEvents(A,B){ function parseReplyEvents (reply) { // Split the API response - var e_array = reply.split("\n"); + var data = JSON.parse(reply) + var e_array = JSON.parse(reply).data; // Form a properly object var fetchedEvents=new Array(); for(var i=0;i Date: Wed, 24 Oct 2018 11:43:01 +0200 Subject: [PATCH 2/2] [Chrome extension] Updated to version 2.1 --- extras/chrome_extension/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/chrome_extension/manifest.json b/extras/chrome_extension/manifest.json index f71b2e7cd6..b591121309 100644 --- a/extras/chrome_extension/manifest.json +++ b/extras/chrome_extension/manifest.json @@ -1,6 +1,6 @@ { "name": "__MSG_name__", - "version": "2.0", + "version": "2.1", "manifest_version": 2, "description": "Pandora FMS Event viewer Chrome extension", "homepage_url": "http://pandorafms.com",