From b213ddb515405e3ee66820ff4671413c348cbf57 Mon Sep 17 00:00:00 2001 From: Binyamin Sharet Date: Tue, 19 Apr 2016 11:57:15 +0300 Subject: [PATCH 01/25] [WebInterface] html - improvements in building the HTML Fixed issue with multi-line fields. All javascript-generated HTML is now generated using jquery and not strings. --- kitty/interfaces/web/static/report.html | 165 +++++++++++++++++------- 1 file changed, 117 insertions(+), 48 deletions(-) diff --git a/kitty/interfaces/web/static/report.html b/kitty/interfaces/web/static/report.html index 50ff5f2..f9a08f7 100644 --- a/kitty/interfaces/web/static/report.html +++ b/kitty/interfaces/web/static/report.html @@ -35,42 +35,94 @@

From a46fcfe8c88a3e2a157cdec4a99a90ec6ebb6b44 Mon Sep 17 00:00:00 2001 From: Binyamin Sharet Date: Sun, 1 May 2016 12:39:59 +0300 Subject: [PATCH 18/25] [WebInterface] some order in htmls --- kitty/interfaces/web/static/index.html | 2 +- kitty/interfaces/web/static/report.html | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kitty/interfaces/web/static/index.html b/kitty/interfaces/web/static/index.html index d0451ec..9e4697d 100644 --- a/kitty/interfaces/web/static/index.html +++ b/kitty/interfaces/web/static/index.html @@ -4,7 +4,7 @@ - + Kitty Fuzzer diff --git a/kitty/interfaces/web/static/report.html b/kitty/interfaces/web/static/report.html index 7efd9f2..c4eb9bb 100644 --- a/kitty/interfaces/web/static/report.html +++ b/kitty/interfaces/web/static/report.html @@ -2,9 +2,10 @@ - Kitty Fuzzer Report - - + + + + Kitty Fuzzer Report From 092d3ac8378648e90398c5d8ad2081ee2e05532f Mon Sep 17 00:00:00 2001 From: Binyamin Sharet Date: Sun, 1 May 2016 16:34:55 +0300 Subject: [PATCH 19/25] [WebInterface] html - improvements in index and reports --- kitty/interfaces/web/static/index.html | 74 ++++++------ kitty/interfaces/web/static/report.html | 153 +++++++++++++++++------- kitty/interfaces/web/static/style.css | 39 +++++- 3 files changed, 189 insertions(+), 77 deletions(-) diff --git a/kitty/interfaces/web/static/index.html b/kitty/interfaces/web/static/index.html index 9e4697d..15b7b73 100644 --- a/kitty/interfaces/web/static/index.html +++ b/kitty/interfaces/web/static/index.html @@ -87,16 +87,14 @@

Kitty Fuzzer
-
Name Not
Reports ()
-
- +
-
@@ -136,7 +134,7 @@

Kitty Fuzzer
-
Name Not var state = {}; state.template_info = {}; - function renderStageGraph(elements){ + function renderStageGraph(elements) { var cy = cytoscape({ container: $('#stages-graph'), @@ -182,6 +180,32 @@

Kitty Fuzzer
-
Name Not function triggerStageGraphUpdate() { $.getJSON('../api/stages.json', updateStageGraph); } + + function is_edge_in_path(curr_path, src, dst) { + return ( + (curr_path.indexOf(dst) != -1) && + (curr_path.indexOf(src) != -1) && + ((curr_path.indexOf(src) + 1) == curr_path.indexOf(dst)) + ) + } + + function get_edge_classes(curr_path, src, dst) { + if(is_edge_in_path(curr_path, src, dst)) + return 'highlighted'; + else + return ''; + } + + function has_node(elements, node) { + return elements.nodes.indexOf(node) != -1; + } + + function add_node_if_missing(elements, node) { + if(has_node(elements, node) == false) + { + elements.nodes.push({data: {id: node}}); + } + } function updateStageGraph(resp) { var curr_path = resp.current; @@ -194,46 +218,29 @@

Kitty Fuzzer
-
Name Not elements.nodes = new Array(); elements.edges = new Array(); curr_path.unshift('Start'); - $.each(curr_path, function(idx, value){ + $.each(curr_path, function(idx, value) { elements.nodes.push({data: {id: value}, classes: 'highlighted'}); }); /* build all the edges, each entry in all_stages holds a list of destinations from the key */ - $.each(all_stages, function(k, v){ + $.each(all_stages, function(src, v) { /* don't set the same edge twice, even if it occurs twice */ var cache = new Array(); - $.each(v, function(idx, value){ + $.each(v, function(idx, dst) { /* highlight the edge if it is in current path */ - var classes = ''; - if( - (curr_path.indexOf(value) != -1) && - (curr_path.indexOf(k) != -1) && - ((curr_path.indexOf(k) + 1) == curr_path.indexOf(value)) - ) - { - classes = 'highlighted'; - } - if(cache.indexOf(value) == - 1) - { + var classes = get_edge_classes(curr_path, src, dst); + if(cache.indexOf(dst) == - 1) { elements.edges.push({ - data: { - source: k, - target: value, - id: k + '--' + value, - }, + data: {source: src, target: dst, id: src + '--' + dst}, classes:classes, }); - if(elements.nodes.indexOf(value) == -1){ - elements.nodes.push({data: {id: value}}); - } - cache.push(value); + add_node_if_missing(elements, dst); + cache.push(dst); } }); - if(elements.nodes.indexOf(k) == -1){ - elements.nodes.push({data: {id: k}}); - } + add_node_if_missing(elements, src); }); renderStageGraph(elements); } @@ -253,14 +260,15 @@

Kitty Fuzzer
-
Name Not .append($('').text(entry[2])) .attr('onclick', "document.location = '" + "static/report.html?report_id=" + test_number +"';") .attr('style', 'cursor: pointer;') + .attr('title', 'Show report ' + test_number) ); }); } } } + /* Fetch all reports, return a dictionary - testname/report */ function getAllReports() { - /* Fetch all reports, return a dictionary - testname/report */ var res = {}; $.each(state.reports, function(index, entry){ var test_number = entry[0]; @@ -274,10 +282,8 @@

Kitty Fuzzer
-
Name Not return res; } + /* Store all reports into a single zip file */ function exportAllReports() { - /* - Store all reports into a single zip file - */ var zip = new JSZip(); var filename = 'kitty_' + state.start_time.toString() + '_reports.zip'; var report_dir = zip.folder('reports'); diff --git a/kitty/interfaces/web/static/report.html b/kitty/interfaces/web/static/report.html index c4eb9bb..7198b1c 100644 --- a/kitty/interfaces/web/static/report.html +++ b/kitty/interfaces/web/static/report.html @@ -2,10 +2,10 @@ - - - - Kitty Fuzzer Report + + + + Kitty Report @@ -17,22 +17,38 @@

- - - - - -
-
-
Main Report
- - - - - -
Issuer
Status
Reason
Fuzz Path
+ +
+
+ +
+
+
+
Main Report
+
+
+
Issuer
+
+
+
+
Status
+
+
+
+
Reason
+
+
+
+
Fuzz Path
+
+
+
+
-
+

+ +

+