From 900e31eecdfba9a7bfdaaf0349e293098e149834 Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Thu, 13 Sep 2018 19:20:02 +0200 Subject: Simplify sequence analysis result color coding Signed-off-by: Matthias Held --- js/filelist.js | 4 ++-- js/scan.js | 4 ++-- js/utils.js | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'js') diff --git a/js/filelist.js b/js/filelist.js index 6d45741..c04ad14 100644 --- a/js/filelist.js +++ b/js/filelist.js @@ -88,8 +88,8 @@ } $.getJSON(self.getColorModeUrl, function(schema) { if (schema.colorMode == 1) { - Utils.colors = {red: 'color-blind-red', orange: 'color-blind-orange', yellow: 'color-blind-yellow', green: 'color-blind-green'}; - Utils.colorsText = {red: 'color-blind-red-text', orange: 'color-blind-orange', yellow: 'color-blind-yellow-text', green: 'color-blind-green-text'}; + Utils.colors = {red: 'color-blind-red', yellow: 'color-blind-yellow', green: 'color-blind-green'}; + Utils.colorsText = {red: 'color-blind-red-text', yellow: 'color-blind-yellow-text', green: 'color-blind-green-text'}; } $.getJSON(self.url, function(data) { $('#section-loading').remove(); diff --git a/js/scan.js b/js/scan.js index ca25e60..4a90146 100644 --- a/js/scan.js +++ b/js/scan.js @@ -208,8 +208,8 @@ var count = 0; $.getJSON(self.getColorModeUrl, function(schema) { if (schema.colorMode == 1) { - Utils.colors = {red: 'color-blind-red', orange: 'color-blind-orange', yellow: 'color-blind-yellow', green: 'color-blind-green'}; - Utils.colorsText = {red: 'color-blind-red-text', orange: 'color-blind-orange', yellow: 'color-blind-yellow-text', green: 'color-blind-green-text'}; + Utils.colors = {red: 'color-blind-red', yellow: 'color-blind-yellow', green: 'color-blind-green'}; + Utils.colorsText = {red: 'color-blind-red-text', yellow: 'color-blind-yellow-text', green: 'color-blind-green-text'}; } $.each(self.sequencesToScan, function(index, sequence) { $.ajax({ diff --git a/js/utils.js b/js/utils.js index 18afda9..5820eba 100644 --- a/js/utils.js +++ b/js/utils.js @@ -32,8 +32,8 @@ * @memberof OCA.RansomwareDetection */ Utils.prototype = { - colors: {red: 'red', orange: 'orange', yellow: 'yellow', green: 'green'}, - colorsText: {red: 'red-text', orange: 'orange-text', yellow: 'yellow-text', green: 'green-text'}, + colors: {red: 'red', yellow: 'yellow', green: 'green'}, + colorsText: {red: 'red-text', yellow: 'yellow-text', green: 'green-text'}, /** * Creates a new row in the table. @@ -211,11 +211,9 @@ */ _createTableSkeleton: function(sequence, suspicionScore) { var color = this.colors.green; - if (suspicionScore >= 6) { + if (suspicionScore > 4) { color = this.colors.red; - } else if (suspicionScore >= 5) { - color = this.colors.orange; - } else if (suspicionScore >= 3) { + } else if (suspicionScore > 2) { color = this.colors.yellow; } var table = -- cgit v1.2.3