2014-12-24 15:42:20 +01:00
<!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" / >
2016-07-07 16:38:00 +02:00
< link href = "{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel = "stylesheet" type = "text/css" / >
2014-12-24 15:42:20 +01:00
<!-- JS -->
< script type = "text/javascript" src = "{{ url_for('static', filename='js/dygraph-combined.js') }}" > < / script >
< script src = "{{ url_for('static', filename='js/jquery-1.4.2.js') }}" > < / script >
< script language = "javascript" src = "{{ url_for('static', filename='js/jquery.js')}}" > < / script >
2016-07-07 16:38:00 +02:00
< script src = "{{ url_for('static', filename='js/jquery.dataTables.min.js') }}" > < / script >
< script src = "{{ url_for('static', filename='js/dataTables.bootstrap.js') }}" > < / script >
2016-07-05 16:53:03 +02:00
< style >
.tooltip-inner {
text-align: left;
height: 200%;
width: 200%;
max-width: 500px;
max-height: 500px;
font-size: 13px;
}
2016-07-06 14:30:32 +02:00
xmp {
white-space:pre-wrap;
word-wrap:break-word;
}
.modal-backdrop.fade {
opacity: 0;
}
2016-07-05 16:53:03 +02:00
< / style >
2014-12-24 15:42:20 +01:00
< / head >
< body >
< div id = "wrapper" >
< nav class = "navbar navbar-default navbar-static-top" role = "navigation" style = "margin-bottom: 0" >
< div class = "navbar-header" >
< ul class = "nav navbar-nav" >
2016-07-01 16:59:08 +02:00
< li class = "active" > < a href = "{{ url_for('index') }}" > < i class = "fa fa-dashboard fa-fw" > < / i > Dashboard< / a > < / li > < li > < a href = "{{ url_for('wordstrending') }}" > < i class = "glyphicon glyphicon-stats" > < / i > WordsTrendings< / a > < / li > < li > < a href = "{{ url_for('protocolstrending') }}" > < i class = "glyphicon glyphicon-stats" > < / i > ProtocolsTrendings< / a > < / li > < li > < a href = "{{ url_for('tldstrending') }}" > < i class = "glyphicon glyphicon-stats" > < / i > Top Level Domain Trending< / a > < / li > < / ul >
2014-12-24 15:42:20 +01:00
< / div >
<!-- /.navbar - top - links -->
< div class = "navbar-default sidebar" role = "navigation" >
< div class = "sidebar-collapse" >
< ul class = "nav" id = "side-menu" >
{% include 'searchbox.html' %}
< / 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 >
2016-07-05 16:53:03 +02:00
<!-- Modal -->
< div id = "mymodal" class = "modal fade" role = "dialog" >
< div class = "modal-dialog modal-lg" >
<!-- Modal content -->
< div id = "mymodalcontent" class = "modal-content" >
2016-07-06 14:30:32 +02:00
< div id = "mymodalbody" class = "modal-body" max-width = "850px" >
< p > Loading paste information...< / p >
2016-07-05 16:53:03 +02:00
< / div >
< div class = "modal-footer" >
2016-07-06 14:30:32 +02:00
< a id = "button_show_path" target = "_blank" href = "" > < button type = "button" class = "btn btn-info" > Show saved paste< / button > < / a >
2016-07-05 16:53:03 +02:00
< button type = "button" class = "btn btn-default" data-dismiss = "modal" > Close< / button >
< / div >
< / div >
< / div >
< / div >
2014-12-24 15:42:20 +01:00
< div id = "page-wrapper" >
<!-- /.row -->
< div class = "row" > < / div >
< div class = "row" >
< div class = "col-lg-12" >
2016-07-07 16:38:00 +02:00
< / br >
2014-12-24 15:42:20 +01:00
< div class = "panel panel-default" >
< div class = "panel-heading" >
< i class = "glyphicon glyphicon-search" > < / i > {{ r|length }} Results
< div class = "pull-right" >
< / div >
< / div >
<!-- /.panel - heading -->
< div class = "panel-body" >
2016-07-07 16:38:00 +02:00
< table class = "table table-striped table-bordered table-hover" id = "myTable" >
2016-07-05 16:53:03 +02:00
< thead >
< tr >
< th > #< / th >
2016-07-07 16:38:00 +02:00
< th style = "max-width: 800px;" > Path< / th >
< th > Date< / th >
< th > Size (Kb)< / th >
2016-07-05 16:53:03 +02:00
< th > Action< / th >
< / tr >
< / thead >
< tbody >
{% set i = 0 %}
{% for path in r %}
{% set prev_content = c[i] %}
< tr >
< td > {{ i + 1 }}< / td >
< td > < a target = "_blank" href = "{{ url_for('showsavedpaste') }}?paste={{ path }}" > {{ path }}< / a > < / td >
2016-07-07 16:38:00 +02:00
< td > {{ paste_date[i] }}< / td >
< td > {{ paste_size[i] }}< / td >
2016-07-06 14:30:32 +02:00
< td > < p > < span class = "glyphicon glyphicon-info-sign" data-toggle = "tooltip" data-placement = "left" title = "{{ prev_content }}" > < / span > < button type = "button" class = "btn-link" data-num = "{{ i + 1 }}" data-toggle = "modal" data-target = "#mymodal" data-url = "{{ url_for('showsavedpaste') }}?paste={{ path }}&num={{ i+1 }}" data-path = "{{ path }}" > < span class = "fa fa-search-plus" > < / span > < / button > < / p > < / td >
2016-07-05 16:53:03 +02:00
< / tr >
{% set i = i + 1 %}
2014-12-24 15:42:20 +01:00
{% endfor %}
2016-07-05 16:53:03 +02:00
< / tbody >
2014-12-24 15:42:20 +01:00
< / table >
< / div >
<!-- /.panel - body -->
< / div >
< / div >
<!-- /.row -->
< / div >
<!-- /#page - wrapper -->
< / div >
< script src = "{{ url_for('static', filename='js/bootstrap.min.js') }}" > < / script >
< / body >
2016-07-05 16:53:03 +02:00
<!-- enable tooltip -->
< script >
2016-07-07 15:34:08 +02:00
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
$("#button_show_path").hide();
2016-07-07 16:38:00 +02:00
$('#myTable').dataTable();
2016-07-07 15:34:08 +02:00
});
2016-07-05 16:53:03 +02:00
< / script >
<!-- Dynamically update the modal -->
< script type = "text/javascript" >
2016-07-07 09:31:04 +02:00
// static data
2016-07-07 15:34:08 +02:00
var alert_message = '< div class = "alert alert-info alert-dismissable" > < button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true" > × < / button > < strong > No more data.< / strong > Full paste displayed.< / div > ';
var complete_paste = null;
var char_to_display = {{ char_to_display }};
var current_index = 0;
2016-07-07 09:31:04 +02:00
2016-07-05 16:53:03 +02:00
// On click, get html content from url and update the corresponding modal
$("[data-toggle='modal']").on("click", function (event) {
event.preventDefault();
2016-07-06 16:54:27 +02:00
var modal=$(this);
2016-07-06 14:30:32 +02:00
var url = " {{ url_for('showpreviewpaste') }}?paste=" + $(this).attr('data-path') + "& num=" + $(this).attr('data-num');
2016-07-05 16:53:03 +02:00
$.get(url, function (data) {
$("#mymodalbody").html(data);
2016-07-07 15:34:08 +02:00
var button = $('< button type = "button" id = "load-more-button" class = "btn btn-info btn-xs center-block" data-url = "' + $(modal).attr('data-path') +'" data-toggle = "tooltip" data-placement = "bottom" title = "Load more content" > < span class = "glyphicon glyphicon-download" > < / span > < / button > ');
button.tooltip();
2016-07-06 16:54:27 +02:00
$("#mymodalbody").children(".panel-default").append(button);
2016-07-06 14:30:32 +02:00
$("#button_show_path").attr('href', $(modal).attr('data-url'));
$("#button_show_path").show('fast');
2016-07-07 15:34:08 +02:00
if ($("[data-initsize]").attr('data-initsize') < char_to_display ) {
nothing_to_display();
}
2016-07-06 16:54:27 +02:00
// On load more content click, replace paste content
$("#load-more-button").on("click", function (event) {
2016-07-07 15:34:08 +02:00
if (complete_paste == null) {
$.get("{{ url_for('getmoredata') }}"+"?paste="+$(modal).attr('data-path'), function(data, status){
complete_paste = data;
update_preview();
});
} else {
update_preview();
}
2016-07-06 16:54:27 +02:00
});
2016-07-05 16:53:03 +02:00
});
});
2016-07-06 16:54:27 +02:00
// When the modal goes out, refresh it to normal content
2016-07-06 14:30:32 +02:00
$("#mymodal").on('hidden.bs.modal', function () {
2016-07-07 15:34:08 +02:00
$("#mymodalbody").html("< p > Loading paste information...< / p > ");
$("#button_show_path").attr('href', '');
$("#button_show_path").hide();
complete_paste = null;
current_index = 0;
2016-07-06 14:30:32 +02:00
});
2016-07-06 16:54:27 +02:00
2016-07-07 15:34:08 +02:00
// Update the paste preview in the modal
function update_preview() {
if (current_index + char_to_display > complete_paste.length-1){
var final_index = complete_paste.length-1;
var flag_stop = true; // if there is no more data.
} else {
var final_index = current_index + char_to_display;
}
if (final_index != current_index){
$("#mymodalbody").find("#paste-holder").append(complete_paste.substring(current_index+1, final_index+1));
current_index = final_index;
if (flag_stop)
nothing_to_display();
} else {
nothing_to_display();
}
}
// Update the modal when there is no more data
function nothing_to_display() {
var new_content = $(alert_message).hide();
$("#mymodalbody").find("#panel-body").append(new_content);
new_content.show('fast');
$("#load-more-button").hide();
}
2016-07-05 16:53:03 +02:00
< / script >
2014-12-24 15:42:20 +01:00
< / html >