mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
225 lines
13 KiB
HTML
225 lines
13 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/dygraph_gallery.css') }}" rel="stylesheet" type="text/css" />
|
||
|
<!-- JS -->
|
||
|
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
|
||
|
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
||
|
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
|
||
|
<script src="{{ url_for('static', filename='js/jquery.flot.pie.js') }}"></script>
|
||
|
<script src="{{ url_for('static', filename='js/jquery.flot.time.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>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
{% include 'navbar.html' %}
|
||
|
|
||
|
<div id="page-wrapper">
|
||
|
<div class="row">
|
||
|
<div class="col-lg-12">
|
||
|
<h1 class="page-header" data-page="page-termsfrequency" >Credentials tracking</h1>
|
||
|
</div>
|
||
|
<!-- /.col-lg-12 -->
|
||
|
<!-- 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-success">
|
||
|
<div class="panel-heading">
|
||
|
<strong>Manage tracked credentials</strong>
|
||
|
</div>
|
||
|
<div class="panel-body">
|
||
|
|
||
|
<div class="form-group input-group" style="margin-bottom: 30px;">
|
||
|
<span class="input-group-addon"><span class="fa fa-eye"></span></span>
|
||
|
<input id="followCredInput" class="form-control" placeholder="Credential to track." type="text" style="max-width: 400px;">
|
||
|
<button id="followTermBtn" class="btn btn-success btn-interaction" style="margin-left: 10px;" data-section="followTerm" data-action="add"> Track</button>
|
||
|
</div>
|
||
|
|
||
|
<table class="table table-striped table-bordered table-hover" id="myTable">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th style="max-width: 800px;">Credential</th>
|
||
|
<th>Added date</th>
|
||
|
<th>Day occurence</th>
|
||
|
<th>Week occurence</th>
|
||
|
<th>Month occurence</th>
|
||
|
<th># tracked paste</th>
|
||
|
<th>Action</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<!-- SET -->
|
||
|
{% for set in trackSet_list %}
|
||
|
<tr style="background-color: #cdffca;">
|
||
|
<td>{{ set }}</td>
|
||
|
<td>{{ trackSet_list_values[loop.index0][3] }}</td>
|
||
|
<td>{{ trackSet_list_values[loop.index0][0] }}</td>
|
||
|
<td>{{ trackSet_list_values[loop.index0][1] }}</td>
|
||
|
<td>{{ trackSet_list_values[loop.index0][2] }}</td>
|
||
|
<td>{{ trackSet_list_num_of_paste[loop.index0] }}</td>
|
||
|
<td><p style="margin: 0px;">
|
||
|
<span data-toggle="modal" data-target="#mymodal" data-term="{{ set }}" ><button class="btn-link" data-toggle="tooltip" data-placement="right" title="Show concerned paste(s)"><span class="glyphicon glyphicon-info-sign"></span></button></span>
|
||
|
<button class="btn-link btn-interaction" data-toggle="tooltip" data-placement="left" title="Remove this term" data-content="{{ set }}" data-section="followTerm" data-action="delete"><span class="glyphicon glyphicon-trash"></span></button>
|
||
|
</p></td>
|
||
|
</tr>
|
||
|
{% endfor %}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<!-- /.panel-body -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- /.panel -->
|
||
|
</div>
|
||
|
<!-- /.panel -->
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- /.row -->
|
||
|
</div>
|
||
|
<!-- /#page-wrapper -->
|
||
|
|
||
|
<script>
|
||
|
$(document).ready(function(){
|
||
|
activePage = $('h1.page-header').attr('data-page');
|
||
|
$("#"+activePage).addClass("active");
|
||
|
|
||
|
$('[data-toggle="tooltip"]').tooltip();
|
||
|
table_track = $('#myTable').DataTable();
|
||
|
table_black = $('#myTable2').DataTable();
|
||
|
|
||
|
table_track.on( 'draw.dt', function () {
|
||
|
perform_binding();
|
||
|
});
|
||
|
|
||
|
$("#followCredInput").keyup(function(event){
|
||
|
if(event.keyCode == 13){
|
||
|
$("#followTermBtn").click();
|
||
|
$("#followCredInput").val("");
|
||
|
}
|
||
|
});
|
||
|
|
||
|
perform_binding();
|
||
|
|
||
|
// On click, get html content from url and update the corresponding modal
|
||
|
$("[data-toggle='modal']").on("click.openmodal", function (event) {
|
||
|
//console.log(data);
|
||
|
event.preventDefault();
|
||
|
var the_modal=$(this);
|
||
|
var url = "{{ url_for('terms.credentials_management_query_paste') }}?cred=" + encodeURIComponent($(this).attr('data-term'));
|
||
|
$.getJSON(url, function (data) {
|
||
|
if (data.length != 0) {
|
||
|
var html_to_add = "";
|
||
|
html_to_add += "<table id=\"modal-table\" class=\"table table-striped\">";
|
||
|
html_to_add += "<thead>";
|
||
|
html_to_add += "<tr>";
|
||
|
html_to_add += "<th>Source</th>";
|
||
|
html_to_add += "<th>Date</th>";
|
||
|
html_to_add += "<th>Encoding</th>";
|
||
|
html_to_add += "<th>Size (Kb)</th>";
|
||
|
html_to_add += "<th># lines</th>";
|
||
|
html_to_add += "<th>Max length</th>";
|
||
|
html_to_add += "<th>Preview</th>";
|
||
|
html_to_add += "</tr>";
|
||
|
html_to_add += "</thead>";
|
||
|
html_to_add += "<tbody>";
|
||
|
for (i=0; i<data.length; i++) {
|
||
|
curr_data = data[i];
|
||
|
html_to_add += "<tr>";
|
||
|
html_to_add += "<td>"+curr_data.source+"</td>";
|
||
|
html_to_add += "<td>"+curr_data.date+"</td>";
|
||
|
html_to_add += "<td>"+curr_data.encoding+"</td>";
|
||
|
html_to_add += "<td>"+curr_data.size+"</td>";
|
||
|
html_to_add += "<td>"+curr_data.lineinfo[0]+"</td>";
|
||
|
html_to_add += "<td>"+curr_data.lineinfo[1]+"</td>";
|
||
|
html_to_add += "<td><div class=\"row\"><button class=\"btn btn-xs btn-default\" data-toggle=\"popover\" data-placement=\"left\" data-content=\""+curr_data.content.replace(/\"/g, "\'")+"\">Preview content</button><a target=\"_blank\" href=\"{{ url_for('showsavedpastes.showsavedpaste') }}?paste="+curr_data.path+"&num=0\"> <button type=\"button\" class=\"btn btn-xs btn-info\">Show Paste</button></a></div></td>";
|
||
|
|
||
|
html_to_add += "</tr>";
|
||
|
}
|
||
|
html_to_add += "</tbody>";
|
||
|
html_to_add += "</table>";
|
||
|
$("#mymodalbody").html(html_to_add);
|
||
|
$("[data-toggle=popover]").popover();
|
||
|
$('#modal-table').DataTable();
|
||
|
} else {
|
||
|
$("#mymodalbody").html("No paste containing this term has been received yet.");
|
||
|
}
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
$("#mymodal").on('hidden.bs.modal', function () {
|
||
|
$("#mymodalbody").html("<p>Loading paste information...</p>");
|
||
|
var loading_gif = "<img id='loading-gif-modal' class='img-center' src=\"{{url_for('static', filename='image/loading.gif') }}\" height='26' width='26' style='margin: 4px;'>";
|
||
|
$("#mymodalbody").append(loading_gif); // Show the loading GIF
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<script>
|
||
|
function perform_binding() {
|
||
|
$(".btn-interaction").unbind("click.interaction");
|
||
|
$(".btn-interaction").bind("click.interaction", perform_operation);
|
||
|
}
|
||
|
|
||
|
function perform_operation(){
|
||
|
var curr_section = $(this).attr('data-section');
|
||
|
var curr_action = $(this).attr('data-action');
|
||
|
if (curr_action == "add") {
|
||
|
var curr_term = $('#'+curr_section+'Input').val();
|
||
|
} else {
|
||
|
var curr_term = $(this).attr('data-content');
|
||
|
}
|
||
|
var data_to_send = { section: curr_section, action:curr_action, term: curr_term};
|
||
|
|
||
|
if (curr_term != "") {
|
||
|
console.log(data_to_send);
|
||
|
$.get("{{ url_for('terms.cred_management_action') }}", data_to_send, function(data, status){
|
||
|
if(status == "success") {
|
||
|
var json = data;
|
||
|
|
||
|
if(json.section == "followTerm") {
|
||
|
if(json.action == "add") {
|
||
|
// query data
|
||
|
$.get("{{ url_for('terms.cred_management_query') }}", { term: json.term, section: json.section }, function(data2, status){
|
||
|
var action_button = "<button class=\"btn-link btn-interaction\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Remove this term\" data-content=\"" + json.term + "\" data-section=\"followTerm\" data-action=\"delete\"><span class=\"glyphicon glyphicon-trash\"></span></button>"
|
||
|
table_track.row.add( [ json.term, data2[3], data2[0], data2[1], data2[2], 0, action_button ] ).draw( false );
|
||
|
perform_binding();
|
||
|
});
|
||
|
} else if (json.action == "delete") {
|
||
|
// Find indexes of row which have the term in the first column
|
||
|
var index = table_track.rows().eq( 0 ).filter( function (rowIdx) {
|
||
|
console.log(table_track.cell( rowIdx, 0 ).data())
|
||
|
return table_track.cell( rowIdx, 0 ).data() === json.term;
|
||
|
} );
|
||
|
table_track.rows(index).remove().draw( false );
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|