mirror of https://github.com/CIRCL/AIL-framework
463 lines
19 KiB
HTML
463 lines
19 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>Analysis Information Leak framework Dashboard</title>
|
|
|
|
<!-- Core CSS -->
|
|
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
|
|
<link href="{{ url_for('static', filename='css/jquery-ui.min.css') }}" rel="stylesheet" type="text/css" />
|
|
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.time.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.stack.js') }}"></script>
|
|
|
|
<style>
|
|
.sparkLineStats ul {
|
|
padding-left:0;
|
|
list-style:none
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="wrapper">
|
|
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
|
|
{% include 'header.html' %}
|
|
<!-- /.navbar-top-links -->
|
|
<div class="navbar-default sidebar" role="navigation">
|
|
<div class="sidebar-collapse">
|
|
<ul class="nav" id="side-menu">
|
|
<li class="sidebar-search">
|
|
{% include 'searchbox.html' %}
|
|
</li>
|
|
</ul>
|
|
<!-- /#side-menu -->
|
|
</div>
|
|
<!-- /.sidebar-collapse -->
|
|
<a href="{{ url_for('index') }}"><img src="{{ url_for('static', filename='image/AIL.png') }}" /></a>
|
|
</div>
|
|
<!-- /.navbar-static-side -->
|
|
</nav>
|
|
</div>
|
|
|
|
<div id="page-wrapper">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<h1 class="page-header" data-page="page-termsfrequency" >Terms frequency: Top set information</h1>
|
|
</div>
|
|
<!-- /.col-lg-12 -->
|
|
</div>
|
|
<!-- /.row -->
|
|
<div class="row">
|
|
|
|
<!-- Panel OPTIONS -->
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div id="panel-today" class="panel panel-info">
|
|
<div class="panel-heading">
|
|
<strong>Today</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div id="panel-today" class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Today top word</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="col-lg-6">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Term</th>
|
|
<th>Value</th>
|
|
<th>Action</th>
|
|
<th>Displayed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table-today">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Term</th>
|
|
<th>Value</th>
|
|
<th>Action</th>
|
|
<th>Displayed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table-today2">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
<div id="panel-today" class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Graph</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div id="graph-today" style="height: 400px;"></div>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
</div>
|
|
<!-- /.panel -->
|
|
</div>
|
|
<!-- /.panel -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Panel OPTIONS -->
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div id="panel-today" class="panel panel-info">
|
|
<div class="panel-heading">
|
|
<strong>Week</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div id="panel-week" class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Week top word</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="col-lg-6">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Term</th>
|
|
<th>Value</th>
|
|
<th>Action</th>
|
|
<th>Displayed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table-week">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Term</th>
|
|
<th>Value</th>
|
|
<th>Action</th>
|
|
<th>Displayed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table-week2">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
<div id="panel-week" class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Graph</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div id="graph-week" style="height: 400px;"></div>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
</div>
|
|
<!-- /.panel -->
|
|
</div>
|
|
<!-- /.panel -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Panel OPTIONS -->
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div id="panel-today" class="panel panel-info">
|
|
<div class="panel-heading">
|
|
<strong>Month</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div id="panel-month" class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Month top word</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="col-lg-6">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Term</th>
|
|
<th>Value</th>
|
|
<th>Action</th>
|
|
<th>Displayed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table-month">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Term</th>
|
|
<th>Value</th>
|
|
<th>Action</th>
|
|
<th>Displayed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table-month2">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
<div id="panel-month" class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Graph</strong>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div id="graph-month" style="height: 400px;"></div>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
</div>
|
|
<!-- /.panel -->
|
|
</div>
|
|
<!-- /.panel -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- /.row -->
|
|
</div>
|
|
<!-- /#page-wrapper -->
|
|
</div>
|
|
|
|
|
|
<!-- import graph function -->
|
|
<script>
|
|
$(document).ready(function(){
|
|
activePage = $('h1.page-header').attr('data-page');
|
|
$("#"+activePage).addClass("active");
|
|
});
|
|
</script>
|
|
|
|
|
|
<script>
|
|
var graph_options = {
|
|
series: {
|
|
lines: {
|
|
show: true,
|
|
lineWidth: 2
|
|
},
|
|
bars: {show: false, barWidth: 60*60*1000},
|
|
shadowSize: 0
|
|
},
|
|
grid: {
|
|
hoverable: true,
|
|
clickable: true,
|
|
tickColor: "#f9f9f9",
|
|
borderWidth: 0
|
|
},
|
|
xaxis: {
|
|
mode: "time",
|
|
timeformat: "%m/%d",
|
|
minTickSize: [1, "day"]
|
|
},
|
|
yaxis: {
|
|
autoscaleMargin: 0.1,
|
|
},
|
|
}
|
|
|
|
|
|
set_today = "TopTermFreq_set_day";
|
|
set_week = "TopTermFreq_set_week";
|
|
set_month = "TopTermFreq_set_month";
|
|
|
|
var plot_today;
|
|
var plot_week;
|
|
var plot_month;
|
|
|
|
var promises = []; // Used to know when everything has been received
|
|
|
|
promises.push($.getJSON("{{ url_for('terms_plot_top_data') }}", { set: set_today, num_day: 1 }, function(data, status){
|
|
//console.log(data);
|
|
data.sort(function(a, b){return b[2]-a[2];});
|
|
// Sort data
|
|
var table_today = $("#table-today")
|
|
var table_today2 = $("#table-today2")
|
|
var to_plot = [];
|
|
for(i=0; i<data.length; i++) {
|
|
var curr_data = [];
|
|
for(j=0; j<data[i][1].length; j++) {
|
|
curr_data.push([data[i][1][j][0]*1000, data[i][1][j][1]]);
|
|
}
|
|
to_plot.push({ data: curr_data, label: data[i][0]});
|
|
if ( i < (data.length/2))
|
|
table_today.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("today", data[i][0])+"</td></tr>")
|
|
else
|
|
table_today2.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("today", data[i][0])+"</td></tr>")
|
|
}
|
|
plot_today = $.plot($("#graph-today"), to_plot, graph_options);
|
|
}));
|
|
|
|
promises.push($.getJSON("{{ url_for('terms_plot_top_data') }}", { set: set_week, num_day: 7 }, function(data, status){
|
|
data.sort(function(a, b){return b[2]-a[2];});
|
|
// Sort data
|
|
var table = $("#table-week")
|
|
var table2 = $("#table-week2")
|
|
var to_plot = [];
|
|
for(i=0; i<data.length; i++) {
|
|
var curr_data = [];
|
|
for(j=0; j<data[i][1].length; j++) {
|
|
curr_data.push([data[i][1][j][0]*1000, data[i][1][j][1]]);
|
|
}
|
|
to_plot.push({ data: curr_data, label: data[i][0]});
|
|
if ( i < (data.length/2))
|
|
table.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("week", data[i][0])+"</td></tr>")
|
|
else
|
|
table2.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("week", data[i][0])+"</td></tr>")
|
|
}
|
|
plot_week = $.plot($("#graph-week"), to_plot, graph_options);
|
|
}));
|
|
|
|
promises.push($.getJSON("{{ url_for('terms_plot_top_data') }}", { set: set_month, num_day: 31 }, function(data, status){
|
|
data.sort(function(a, b){return b[2]-a[2];});
|
|
// Sort data
|
|
var table = $("#table-month")
|
|
var table2 = $("#table-month2")
|
|
var to_plot = [];
|
|
for(i=0; i<data.length; i++) {
|
|
var curr_data = [];
|
|
for(j=0; j<data[i][1].length; j++) {
|
|
curr_data.push([data[i][1][j][0]*1000, data[i][1][j][1]]);
|
|
}
|
|
to_plot.push({ data: curr_data, label: data[i][0]});
|
|
if ( i < (data.length/2))
|
|
table.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("month", data[i][0])+"</td></tr>")
|
|
else
|
|
table2.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("month", data[i][0])+"</td></tr>")
|
|
}
|
|
plot_month = $.plot($("#graph-month"), to_plot, graph_options);
|
|
}));
|
|
|
|
/* When everything has been received, start adding tooltip */
|
|
$.when.apply($, promises).done( function (arg) {
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
|
$(".btn-interaction").unbind("click.interaction");
|
|
$(".btn-interaction").bind("click.interaction", perform_operation);
|
|
$(".check-interaction").unbind("click.interaction");
|
|
$(".check-interaction").bind("click.interaction", hide_or_show);
|
|
});
|
|
|
|
|
|
function addbuttons(term) {
|
|
return "<button class=\"fa fa-eye btn-interaction btn btn-success\" data-toggle=\"tooltip\" data-placement=\"right\" title=\"Add to tracked list\" style=\"margin-right: 5px;\""+
|
|
"data-section=\"followTerm\" data-term=\""+term+"\"></button>"+
|
|
"<button class=\"fa fa-eye-slash btn-interaction btn btn-danger\" data-toggle=\"tooltip\" data-placement=\"right\" title=\"Add to black-list\""+
|
|
"data-section=\"blacklistTerm\" data-term=\""+term+"\"></button>";
|
|
}
|
|
|
|
function addcheckbox(graph, term) {
|
|
return "<input type=checkbox checked class=\"check-interaction\" data-term=\""+term+"\" data-graph=\""+graph+"\"></input>";
|
|
}
|
|
|
|
function perform_operation(){
|
|
var curr_section = $(this).attr('data-section');
|
|
var curr_term = $(this).attr('data-term');
|
|
|
|
var data_to_send = { section: curr_section, action:"add", term: curr_term};
|
|
|
|
$.get("{{ url_for('terms_management_action') }}", data_to_send, function(data, status){
|
|
if(status == "success") {
|
|
location.reload();
|
|
}
|
|
});
|
|
}
|
|
|
|
function hide_or_show() {
|
|
var curr_term = $(this).attr('data-term');
|
|
var graph = $(this).attr('data-graph');
|
|
var checked = $(this).prop('checked')
|
|
console.log(curr_term + ' ' + graph + ' ' + checked);
|
|
|
|
if(graph == "today") {
|
|
var graphData = plot_today.getData();
|
|
var index;
|
|
for(i=0; i<graphData.length; i++){
|
|
if(graphData[i].label == curr_term){
|
|
index = i;
|
|
break;
|
|
}
|
|
}
|
|
graphData[index].lines.show = checked;
|
|
plot_today.setData(graphData);
|
|
plot_today.draw();
|
|
} else if (graph == "week") {
|
|
var graphData = plot_week.getData();
|
|
var index;
|
|
for(i=0; i<graphData.length; i++){
|
|
if(graphData[i].label == curr_term){
|
|
index = i;
|
|
break;
|
|
}
|
|
}
|
|
graphData[index].lines.show = checked;
|
|
plot_week.setData(graphData);
|
|
plot_week.draw();
|
|
} else if (graph == "month") {
|
|
var graphData = plot_month.getData();
|
|
var index;
|
|
for(i=0; i<graphData.length; i++){
|
|
if(graphData[i].label == curr_term){
|
|
index = i;
|
|
break;
|
|
}
|
|
}
|
|
graphData[index].lines.show = checked;
|
|
plot_month.setData(graphData);
|
|
plot_month.draw();
|
|
}
|
|
|
|
// graph, hide curve
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|