-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebUI: introduce graph comparison tool
This adds a new page (/compare.html) which enables to compare two result sets by displaying side-by-side graphs. This commit also introduces a SubFilter class (a filter based on another filter), used for the graph comparison.
- Loading branch information
Showing
7 changed files
with
326 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
<!DOCTYPE html> | ||
|
||
<!-- | ||
This file is part of IVRE. | ||
Copyright 2011 - 2015 Pierre LALET <[email protected]> | ||
IVRE is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
IVRE is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with IVRE. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<html ng-app="ivreWebUi"> | ||
|
||
<head> | ||
<link rel="stylesheet" type="text/css" href="bs/css/bootstrap.css" /> | ||
<link rel="stylesheet" type="text/css" href="fi/css/flag-icon.css" /> | ||
<link rel="stylesheet" type="text/css" href="ivre/ivre.css" /> | ||
<link rel="icon" type="image/png" id="favicon" href="favicon.png" /> | ||
<script type="text/javascript" src="jq/jquery.js"></script> | ||
<script type="text/javascript" src="bs/js/bootstrap.js"></script> | ||
<script type="text/javascript" src="d3/js/d3.v3.min.js"></script> | ||
<script type="text/javascript" src="d3/js/topojson.v1.min.js"></script> | ||
<script type="text/javascript" src="an/js/angular.js"></script> | ||
<script type="text/javascript"> | ||
config = {}; | ||
</script> | ||
<script type="text/javascript" src="config.js"></script> | ||
<script type="text/javascript" src="ivre/content.js"></script> | ||
<script type="text/javascript" src="ivre/utils.js"></script> | ||
<script type="text/javascript" src="ivre/graph.js"></script> | ||
<script type="text/javascript" src="ivre/filters.js"></script> | ||
<script type="text/javascript" src="ivre/compare.js"></script> | ||
<script type="text/javascript" src="ivre/controllers.js"></script> | ||
<script type="text/javascript" src="ivre/params.js"></script> | ||
<script type="text/javascript" src="ivre/tooltip.js"></script> | ||
<script type="text/javascript" src="ivre/ivre.js"></script> | ||
<title>IVRE Web UI</title> | ||
</head> | ||
|
||
<body onload="init_compare();" ng-controller="IvreCompareCtrl" | ||
style="padding-top: 10px"> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-12 col-md-3"> | ||
<table class="table"> | ||
<thead> | ||
<tr><th colspan="2">Result counters</th></tr> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="filter in all_filters" | ||
ng-class="{succes: filter.count > 0, warning: filter.count === undefined, error: filter.count === 0}"> | ||
<td>{{names[filter.name]}}</td> | ||
<td ng-switch="filter.count"> | ||
<span ng-switch-when="0">No result!</span> | ||
<span ng-switch-when="undefined">[Counting...]</span> | ||
<span ng-switch-default="">{{filter.count}}</span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Results in all sets </td> | ||
<td>{{all_sets.count}} | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="col-sm-12 col-md-3" ng-controller="IvreFilterListCtrl"> | ||
<ul class="nav" ng-controller="IvreFilterListCtrl"> | ||
<ivre-filters title="Common filters"></ivre-filters> | ||
</ul> | ||
</div> | ||
<div class="col-sm-12 col-md-3" ng-repeat="set in [1, 2]"> | ||
<ul class="nav" ng-controller="IvreFilterListCtrl"> | ||
<ivre-filters title="Filters for set {{set}}" | ||
ng-init="tooltipplace=$last?'left':'right'" | ||
parent="" | ||
name="set{{set}}"></ivre-filters> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="navbar graph-list center col-sm-12"> | ||
<div class="navbar-inner"> | ||
<ul class="nav navbar-nav"> | ||
<li> | ||
<form id="explore" ng-submit="build_top_chart();"> | ||
<input type="text" | ||
placeholder="Top values" | ||
class="form-control input-medium" | ||
oninput="ToolTip.handle(this, HELP_TOPVALUES);" | ||
onfocus="ToolTip.handle(this, HELP_TOPVALUES);" | ||
onblur="ToolTip.remove(this);" | ||
id="topvalues-input" | ||
ng-model="topvaluesfield" | ||
data-trigger="manual" | ||
data-html="true" | ||
data-container="#navbar" | ||
/> | ||
</form> | ||
</li> | ||
<li> | ||
<div class="btn-group" role="group"> | ||
<button class="btn btn-default" ng-click="build_ip_plane()" | ||
ng-disabled="!is_ready()">Address space</button> | ||
<button class="btn btn-default" ng-click="build_ip_ports()" | ||
ng-disabled="!is_ready()">IPs & Ports</button> | ||
<button class="btn btn-default" | ||
ng-click="build_ip_map()">Map</button> | ||
<button class="btn btn-default" ng-click="build_ip_timeline()" | ||
ng-disabled="!is_ready()">Timeline</button> | ||
<button class="btn btn-default" | ||
ng-click="build_ip_timeline(86400)" | ||
ng-disabled="!is_ready()">Timeline (24h)</button> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row" style="padding-top: 10px"> | ||
<div class="col-sm-12 col-md-6"> | ||
<div id="chart1" class="chart" style="display: none;"> | ||
<div> | ||
<center> | ||
<span name="charttitle"></span> | ||
<i class="icon-remove clickable" | ||
onclick="hidecharts();"></i> | ||
</center> | ||
</div> | ||
<div name="chartcontent"></div> | ||
</div> | ||
</div> | ||
<div class="col-sm-12 col-md-6"> | ||
<div id="chart2" class="chart" style="display: none;"> | ||
<div> | ||
<center> | ||
<span name="charttitle"></span> | ||
<i class="icon-remove clickable" | ||
onclick="hidecharts();"></i> | ||
</center> | ||
</div> | ||
<div name="chartcontent"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var ALL_SETS; | ||
|
||
function init_compare() { | ||
if(!(wait_filter(init_compare))) | ||
return; | ||
|
||
sync_hash_filter(FILTER) | ||
|
||
window.onhashchange(); | ||
//var all_sets = []; | ||
for(name in FILTERS) { | ||
if(name.substr(0, 3) === "set") { | ||
var filter = FILTERS[name]; | ||
filter.on_query_update(); | ||
//all_sets.push(filter); | ||
} | ||
} | ||
// FIXME work w/ arbitrary number of sets | ||
ALL_SETS = new SubFilter("all_sets", FILTERS.set1, FILTERS.set2); | ||
var scope = get_scope("IvreCompareCtrl"); | ||
scope.$apply(function() { | ||
scope.all_sets = ALL_SETS; | ||
}); | ||
ALL_SETS.need_apply.push(scope); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters